Monday, 3 December 2012

Update

I have started to link up my Interpreter to GUI, all seems to be working well. Before I had connected them together It was really difficult to test certain features of the interpreter, e.g. if statements and loops, so I jumped at the opportunity.

Using the code:

create("a")

0 -> a

while(a < 10)        
        if(a % 2 = 0)
                printline(a)
        otherwise
                printline("odd")
        endif

        a + 1 -> a
endwhile

At first the if statement caused a few problems at the otherwise statement was executing twice, but after a bit of tweaking with the code, I got my result, the IDE printed all the even numbers.


No comments:

Post a Comment