Question

How to write an IF condition syntax in the DOG language. I don't know how to write an IF condition syntax. Any Ideas.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top