Anonymous user
Price fraction: Difference between revisions
→{{header|Perl 6}}: Clean up the "chained conditionals" solution, and use `when` instead of the ternary operator.
(Added Maple implementation.) |
(→{{header|Perl 6}}: Clean up the "chained conditionals" solution, and use `when` instead of the ternary operator.) |
||
Line 2,164:
}</lang>
Yet another approach is to use
This allows each endpoint to be written once, avoiding duplication.
<lang perl6>sub
}
while prompt("value: ") -> $value {
last if $value ~~ /exit|quit/;
say
}</lang>
|