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
Real world programming? You are at some point going to run into performance bottlenecks. I deal daily with servers, where a pause in processing as short as 2 seconds can mean the server drops requests, and a pause over 5 seconds can crash the server outright. For me, a server taking more than 10 milliseconds to serve a request is too slow, because users will be able to quickly generate a backlog of requests greater than a mere one or two seconds.
I didn't really understand the direction storage trick. Can you store say upper left and query your upper left from different positions? Probably not, so... You store a position and query it instead of "looking" there? I wonder why this makes a speed difference. X)
--
But if you need 2+1, you may need 1+1, 3+1, 4+1, 5+1, etc ...
if mem1 < 4 then
if mem1 < 2 then
if mem1 = 0 then mem1 = 1 else mem1 = 2
else
if mem1 = 2 then mem1 = 3 else mem1 = 4
endif
else
if mem1 < 6 then
if mem1 = 4 then mem1 = 5 else mem1 = 6
else
if mem1 = 6 then mem1 = 7 else mem1 = 8
endif
endif
Math works slow, but if trees like that proc quickly.
You may also add a hint about the ELSE command. When I was trying to optimize the size of my programs, I could easily skip the Else command on many opportunities, or change the order of the IF structure to completely avoid using the ELSE.