Jump to content

Talk:100 doors: Difference between revisions

mNo edit summary
Line 104:
 
I just edited in missing initializations and fixed an off-by one termination test. I also commented some assumptions and a few 6502 quirks. This example has no output code -- the referenced emulator displays the memory directly. If I've counted the pixels(!) correctly, the output is numerically correct. It probably was anyway, but if so, only because of unstated initial conditions in the emulator. I don't know if I need to do anything to log the user (Gary Tippery) and time (11-Feb-2014 03:14 PDT).
 
== the optmized version ==
 
Well, the optimized version for the C, and C++ codes are just this for loop
<pre>
for(var i=1;i<=10;i++){
print("Door %d is open",i*i);
}
</pre>
But in the examples it goes to 100, and not to 10, that means it's calculating 1000 doors, and not 100 doors? [[User:Rainb|Rainb]] ([[User talk:Rainb|talk]]) 07:03, 21 July 2014 (UTC)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.