Modulinos: Difference between revisions
Content added Content deleted
(Omit from Go, concurring with Dchapes.) |
|||
Line 1,497: | Line 1,497: | ||
Test: The meaning of life is 42</lang> |
Test: The meaning of life is 42</lang> |
||
=={{header|Scala}}== |
=={{header|Scala}}== |
||
[[Category:Scala Implementations]] |
|||
{{libheader|Scala}} |
{{libheader|Scala}} |
||
{{works with|Scala|2.10.2}} |
{{works with|Scala|2.10.2}} |
||
===Unix shell script=== |
===Unix shell script=== |
||
This code must be stored as a shell script. |
This code must be stored as a shell script. |
||
Line 1,513: | Line 1,513: | ||
println(collatz.toList) |
println(collatz.toList) |
||
println(s"It has ${collatz.length} elements.")</lang> |
println(s"It has ${collatz.length} elements.")</lang> |
||
===Windows Command Script=== |
===Windows Command Script=== |
||
This code must be stored as a Windows Command Script e.g. Hailstone.cmd |
This code must be stored as a Windows Command Script e.g. Hailstone.cmd |
||
Line 1,529: | Line 1,530: | ||
println(collatz.toList) |
println(collatz.toList) |
||
println(s"It has ${collatz.length} elements.") |
println(s"It has ${collatz.length} elements.") |
||
</lang> |
|||
⚫ | |||
{{out}} |
|||
⚫ | |||
Use the routine to show that the hailstone sequence for the number: 42. |
Use the routine to show that the hailstone sequence for the number: 42. |
||
List(42, 21, 64, 32, 16, 8, 4, 2, 1) |
List(42, 21, 64, 32, 16, 8, 4, 2, 1) |