Anonymous user
99 Bottles of Beer/Scala: Difference between revisions
Previous version failed with line spacing
(ParRange) |
(Previous version failed with line spacing) |
||
Line 2:
The trivial solution to it would be this:
<lang scala>99 to 1 by -1 foreach { n =>
println(
f"$n%d bottles of beer\n" +
f"${n -
}</lang>
The above running in
<lang scala>(99 to 1 by -1).par foreach { n =>
println(
f"$n%d bottles of beer\n" +
f"${n -
}</lang>
A Regex solution:
|