Difficulty: Hard!
In challenge #1, we created a programm, which parsed a string and gave out the string, that was to write.
NOW: Let's imagine, we want to create Variables in our Interpreter.
EXAMPLE:
INPUT (=File):
new_int_var (Hello = 123)
write (Hello + " HI")
OUTPUT (Terminal or output-field):
123 HI
HOW TO DO THAT? Well, first we need to parse the command and the arguement to it.
BUT: thats not the problem. We need to add an array, which saves the 1-NAME and the 2-VALUE. Once you add string-variables, you need to add the 3-TYPE.
EXTENSIONS:
EX1: add string-variable-types
EX2: add a function for input
EX3: BE HAPPY, THAT YOu JUST WROTE A BASIC INTERPRETER (this isn't something, everybody can do.)
BTW: If you are german and want to see my interpreter (#competition), check out
sites.google.com/sites/gerinterpreter.
As this is a really difficult question, feel free to ask me at any times. BUT don't post the answer to others ;-)