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
Loops loops loops.
http://imgur.com/a/nyjwB
Each circle represents a state. These could be things such as "last 2 inputs were zeroes". Put an "S" in one to mark it as your starting state. From each state you draw 1 arrow leading to another state for each possible input or set of inputs, in this case it would be =0 or ≠0. Along each each arrow you would write "<input value> / <output value>".
If you can make up a state diagram for this puzzle, translating it into code should be fairly straightforward.
http://steamcommunity.com/sharedfiles/filedetails/?id=774477558
The top left node executes one more line of code when the input is not zero than when it is zero. The majority of inputs are zero, so that's not optimal.
Otherwise the biggest difference you could make would be to change the way you're remembering what state you're in. You're using a number stored in an ACC but another method would be to remember it by what line of code is being executed. You basically use labels to mark your states and jump between them as necessary. Using this method I got it down to 174/4/15 or 179/4/13 with all the work being done in one node.