This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Tron's profile picture

How do I use =< and >= ?

Started by Tron, 13 September 2012 - 07:06 PM
Tron #1
Posted 13 September 2012 - 09:06 PM
Im making a game that has xp, and you fight more powerful enemys with higher xp, but for some reason it says
"bios:206: [string "gametest"]:34: 'then' expected" line 34 is line 1 of the code below.

if xp =< 10 then
enemy = "knight"
end
Cranium #2
Posted 13 September 2012 - 09:21 PM
The operator is actually reversed. So what you think is "=<" needs to be "<=". Think of it this way: "less than or equal to" and "greater than or equal to" easy to remember which comes first if you use that syntax.