Ok.. I've done this one in C some time ago and it was one of my biggest efforts in programming since i only knew about printf and getch.. So I've reached a solution after quite some work. I cant give you the code( it's written in C anyways ) but i can give you a tip that saved my nerves
You need to use 4 "cup" or "glass" variables. Just pass the info between them and it's gonna be a piece of cake
They are called from the famous example of the two cups used to describe variables to a total beginner.
Glass variables are variables that are often used to transfer data between them.
The best example is the fibbonnaci codex, and I cant figure out any example that will put the concept in the correct light;
But this is how it works:
In an iteration, you may need, at a point, to use a variable as a storage matter. I dont want to make any contact with the fibbonacci codex, so i posted my latest use of "cup" variables.
This chunk of code checks for a double quote sequence to detect strings.
"string" code "string"
so in order to omit the code part ( which is also between 2 quotes) i used a "glass variable".