Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I have no idea if my description made enough sense. My solution has 23 steps, the short one should have 15, so it is not that great. However, if it's of any help for you, I can paste it in here.
Personally, I try to use labels when it gets more complex, as writing everything in one row can become messy. Especially those damn jumps can annoy the hell out of me.
You can use forward jumps to implement 'if' blocks:
You can use backward jumps for do-while loops (i.e. where it's always going to execute the loop body at least once):
and combine with an unconditional jump to get a while loop:
or you can do one with the opposite condition:
You can build up more complex control flow from those basic ones - e.g. a 'for' loop is just a 'while' loop where you modify the condition variable before jumping back to the top. But to get the most efficient programs you might have to break out of those patterns and do something more convoluted.
(I think this makes it clear why high-level languages all have good support for structured control flow, and rely on a compiler to translate it all into the conditional jumps that the hardware understands. Given the theme of the game, it's kind of ironic that we have to do that translation manually here!)