Loops/Infinite: Difference between revisions
< Loops
Content added Content deleted
(New page: ==Perform the same series of actions indefinitely.== Specifically print out "SPAM" followed by a newline in an infinite loop. =={{header|Ada}}== <pre language="ada">loop Put_Line("SPAM...) |
|||
Line 15: | Line 15: | ||
=={{header|Groovy}}== |
=={{header|Groovy}}== |
||
<pre language="groovy">while (true) { |
<pre language="groovy">while (true) { |
||
println ' |
println 'SPAM' |
||
}</pre> |
}</pre> |
||
Revision as of 04:03, 11 April 2008
Perform the same series of actions indefinitely.
Specifically print out "SPAM" followed by a newline in an infinite loop.
Ada
loop Put_Line("SPAM"); end loop;
C
while(1) puts("SPAM");
Common Lisp
(loop (write-line "SPAM"))
Groovy
while (true) { println 'SPAM' }
Haskell
forever (putStrLn "SPAM")
Java
while(true) { System.out.println("SPAM"); }
Logo
forever [print "SPAM]
Perl
while(1){print"SPAM\n"}
Prolog
repeat, write('SPAM'), nl, fail.
Python
while 1: print "SPAM"
Ruby
while true do puts "SPAM" end