How to write an IF
condition syntax in the DOG language. I don't know how to write an IF
condition syntax. Any Ideas.
Asked
Active
Viewed 297 times
-4

Earth
- 3,477
- 6
- 37
- 78
1 Answers
4
From your Wikipedia link:
Any command can be preceded with a number or variable (dishx, platex, or floor)...But if a plate variable precedes a command, the command is only executed once if the number of cookies on the plate is not 0.
So a plate variable preceding a command acts as an if statement. It is the equivalent of writing something like this in a "real" programming language:
if (plate > 0) { do this command }
if you want many commands to be conditional on your if
statement, then you would have to combine it with a jump
command.

dan1111
- 6,576
- 2
- 18
- 29
-
One doubt is that whether we can use the set brackets as you mentioned above. – Earth Dec 14 '12 at 14:11
-
@super, no, I was giving pseudo-code that describes how it will work. You obviously have to put it in dog syntax. – dan1111 Dec 14 '12 at 14:12
-
Ok. Thanks. I will follow the syntax. – Earth Dec 14 '12 at 14:14