문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top