in reply to P6: OO Wizard Game (RPG kinda, sorta)
I think that
Is much prettier when written aswhen 'f' { say "You ran away from the $enemy.name()!" } if ($.weapons.exists($_)) { .attack($enemy, $.weapons{$_}); } else { say "Please enter a valid command!" }
"when" combined with "if"/"else" just doesn't feel right. It's better style to write %.weapons, by the way. (Why would $.weapons even work? It's not declared!)when 'f' { say "You ran away from the { $enemy.name }!" } when $.weapons { .attack($enemy, $.weapons{$_}); } default { say "Please enter a valid command!" }
Note that my comments are not tested against the reality of Pugs.
Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: P6: OO Wizard Game (RPG kinda, sorta)
by dragonchild (Archbishop) on May 13, 2005 at 13:00 UTC | |
by Juerd (Abbot) on May 13, 2005 at 13:27 UTC | |
by eric256 (Parson) on May 13, 2005 at 13:38 UTC | |
|
Re^2: P6: OO Wizard Game (RPG kinda, sorta)
by eric256 (Parson) on May 13, 2005 at 13:11 UTC | |
by Juerd (Abbot) on May 13, 2005 at 13:15 UTC |