❔ 'if' command not working.
Hi, In my program, it uses user input to execute a command (just a mini IDE) but these commands are executed to draw shapes. I am having a problem if my case: "if" and my case "endif". I have attached an image to this post.
the explanation of the commands :
moveto 200 200 (this sets the location of the coordinates to 200, 200)
var size 10 (this declares a variable called size with the value of 10)
If 10 > 20 (if 10 is greater than 20)
Loop 10 (it will draw the shape 10 times)
Circle size (this will draw circle with the value retrieved from the variable called size)
size size + 10 (each time circle is drawn, it will increase variable size by 10.
End (the loop ends here)
Endif (if statement ends here)
my problem is, 10 is not greater than 20, so nothing below the if command should be executed.
the code is below.
https://hastebin.com/novohajilo.http
the explanation of the commands :
moveto 200 200 (this sets the location of the coordinates to 200, 200)
var size 10 (this declares a variable called size with the value of 10)
If 10 > 20 (if 10 is greater than 20)
Loop 10 (it will draw the shape 10 times)
Circle size (this will draw circle with the value retrieved from the variable called size)
size size + 10 (each time circle is drawn, it will increase variable size by 10.
End (the loop ends here)
Endif (if statement ends here)
my problem is, 10 is not greater than 20, so nothing below the if command should be executed.
the code is below.
https://hastebin.com/novohajilo.http

Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.