From: Sven Schott Date: 2009-11-03T18:00:43+09:00 Subject: Re: Hamurabi (#223) --0016367f92a78a04b2047773bad9 Content-Type: text/plain; charset=ISO-8859-1 Cool. Caveat for the non-bleed users: ruby1.9 required (1.8.6 here). I must admit, I didn't even try to understand certain design decisions. I basically followed flow and then cleaned up the code a little later. I believe the for loop was to play the system alert seven times (ASCII char 7). I think. Sound effects on a PDP-8 terminal. :) On Tue, Nov 3, 2009 at 7:18 PM, Benoit Daloze wrote: > Hi, I did the hard-way too, but no so sure I regret :) > > In fact it was interesting how to transform jumps into methods. > > So here is my pastie: > http://pastie.textmate.org/681199 > > Still bugged, because I couldn't understand so much the part with planting > seeds. (and why using the variable dead at that moment?) > > For the "for" loop at the end, what is it supposed to do? output > 7.chr(bell) > ? > > 2009/11/3 genericpenguin > > > Well, here goes. I did it the bad way (no flowcharts or anything) and > > it was pretty painful (meaning I regretted it later). I got it to the > > point where it is semi-reasonable but it's not very um, Rubyish. I > > ironed out all the showstopper bugs but I'm sure there's quite a few > > more. In any case it works after a fashion (compared the output to a > > running instance of http://www.calormen.com/applesoft/) and it doesn't > > make my eyes bleed (no guarantees on yours). > > > > http://dl.getdropbox.com/u/1826667/hamurabi.rb > > > > I spent so much time on it that in the end I didn't clean up all the > > puts'. Sorry! > > > > > > On Nov 3, 11:50 am, James Edward Gray II > > wrote: > > > On Nov 2, 2009, at 6:37 PM, genericpenguin wrote: > > > > > > > Sorry I'm new to the list. Is it ok to post solutions at this point > > > > (Nov 1 10:30am to now +48hrs)? > > > > > > It sure is. Post away. > > > > > > And welcome to the list. > > > > > > James Edward Gray II > > > > > --0016367f92a78a04b2047773bad9--