Loops/Infinite
< Loops
Loops/Infinite
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
Specifically print out "SPAM" followed by a newline in an infinite loop.
Ada
<ada>loop
Put_Line("SPAM");
end loop;</ada>
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"); }
for(;;){ 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
UnixPipes
while true ; do echo "YES" ; done