I don't know about this Daniel. Even for all its goto's, I found the original more reaable.
I actually found his code quite readable, and felt I lost some of that. I felt it a tradeoff worth making at this stage, but I didn't like it.
I think Joel needs to understand that Perl function calls need no extra verbs, and that closing braces should align vertical with the beginning of the line that opens the block, but otherwise his code is very nice and tight.
Agreed.
In particular, I feel that the insertion of gratuitous blank lines detracts from the overall readability.
Most of those were inserted by my email program... (My copy has very few blank lines.) Sorry.
If anything, I would have modified those assignments by breaking the lines, using the concatenation operator, to bring the whole assignment statement into view.
I thought about that. In the end, I just didn't want to do the work. ;-)
Joel's code was very nice. The advantage I believe my version has is scalabilty: you can add rooms and variable tracking without touching anything. For that matter, a 'save' function would be trivial in my version, while it would be extremely difficult in his. (Mine can even do a general 'teleport' quite easily...) Also, since the input is centralized you can put in much better (and more uniform!) validation of input.
For a four-room spaceship I would probably prefer Joel's code. For a six or seven hundred room environment I would prefer mine. I was trying to come up with a good subroutine-based code that offered a real advantage over his code. (I could have just replaced GOTOs with subs, but there was no compelling value in that.)
Daniel T. Staal
--------------------------------------------------------------- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---------------------------------------------------------------
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>