Chained operators, cont'd
Perl 5:
if ( 1 <= $roll1 && $roll1 <= 6 && $roll1 == $roll2 ) { print "Doubles!"; }
Perl 6:
if ( 1 <= $roll1 == $roll2 <= 6 ) { print "Doubles!"; }
Perl 6 | Perl 6 | #14 |
Perl 5:
if ( 1 <= $roll1 && $roll1 <= 6 && $roll1 == $roll2 ) { print "Doubles!"; }
Perl 6:
if ( 1 <= $roll1 == $roll2 <= 6 ) { print "Doubles!"; }
Copyright © 2008 Patrick Michaud |