to expand upon Pixie's post, about the concept:
Attribute Type and Value Type matter
Strings are text (a collection/sequence of letters, numbers, and other symbols). Concatenation (literally putting together/next to each other) can be done on Strings/text
Integers/Doubles are amounts (arithmetic/math operations can be done on amounts) represented by non-decimal (integers) and decimal (doubles) numbers
String Atribute+Value: game.state = "0"
Integer (int) Attribute+Value: game.state = 0
game.state = "5"
game.state = game.state + 5
// ERROR! can't combine string:"5" and int:5, no comprehension!
game.state = 5
game.state = game.state + "5"
// ERROR! can't combine int:5 and string:"5", no comprehension!
game.state = "5"
game.state = game.state + "5"
// game.state = "55"
game.state = 5
game.state = game.state + 5
// game.state = 10
game.state = "mama"
game.state = game.state + 5
// ERROR! can't combine string:"mama" and int:5, no comprehension!
game.state = "mama"
game.state = game.state + "5"
// game.state = "mama5"
game.state = "mama"
game.state = game.state + "mia"
// game.state = "mamamia"
---------
get input: converts whatever you type in (into the command/text box during game play) into a String Value, and automatically stores it into the built-in 'result' Variable
result <- returned/outputted String Value <- get input () <- (your typed-in input)
get input {
// your typed-in input is converted into a String Value, by the 'get input' Script/Function
// automatically (hidden from you) sets/stores your String Value into the built-in 'result' Variable: result = (your typed-in input)
msg (result)
}
-------
ToInt (String Value): converts the intputted String Value into a returned/outputted Integer (int) Value
VARIABLE <- returned/output Integer Value <- ToInt (input String Value)
game.state_string = "0"
game.state_integer = ToInt (game.state_string)
// game.state_integer = 0
------
and then your other question was on how to do iteration (cycling), which Pixie already covered.