Hey everyone,
I wanted to make a more involved project, and that involves having some sort of scripting engine. This is a string parser basically, and it takes it's roots from good 'ol BASIC with line numbers.
I've attached all of my code and a sample script.
//set the variable "bar" in the hashtable to -1
10 SetNumberHashValue: bar -1
//set the variable "foo" in the hastable to the value of "chi"
20 SetStringHashValue: foo "chi"
//message prompt the value of foo
30 MessageStringHashValue: foo
//change the value of the variable bar by this amount
40 ChangeNumberHashValueBy: bar 1
//change the value of the number bar by this amount
50 ChangeNumberHashValueBy: bar -5
//message the value of the variable bar
60 MessageStringHashValue: bar
//simple testing. if bar is less than -20, goto 80. otherwise goto 90
70 TestNumberHashValue: bar < -20 ? 80 ? 90
80 Message: "Stop Subtracting"
// simple test for a string
90 TestStringHashValue: foo = "chi" ? 120 ? 110
//break interpretor to allow other code to run
100 Break
//endless loop
110 Goto: 20
120 Message: "Nice to meet you chi. Have a good
As only one script can be loaded at a time, it's functionality might be limited. However, it would work great if you wanted to program cut-scenes or simple interactive decision trees in your app.
Hi there. My name is Dug. I have just met you, and I love you.