View Problem

Perform an action a fixed number of times with a counter

Display the string "10 .. 9 .. 8 .. 7 .. 6 .. 5 .. 4 .. 3 .. 2 .. 1 .. Liftoff!"
DiskEdit
python 2.4
print " .. ".join(str(i) for i in range(10, 0, -1)), ".. liftoff!"
DiskEdit
csharp
for (int i = 10; i > 0; i--)
{
Console.Write("{0} .. ", i);
}

Console.WriteLine("Liftoff!");
ExpandDiskEdit
java
for(int i=10; i>=1; i--) {
System.out.print(i + " .. ");
}
System.out.print("Liftoff!");
ExpandDiskEdit
fantom
(10..1).each { Env.cur.out.print("$it .. ") }
Env.cur.out.print("Liftoff!")
ExpandDiskEdit
fantom
for (i := 10; i >= 1; i--)
Env.cur.out.print("$i .. ")
Env.cur.out.print("Liftoff!")
DiskEdit
clojure
(dotimes [i 10]
(print (str (- 10 i) " .. ")))

(println "Liftoff!")

Submit a new solution for python, csharp, java, fantom ...
There are 16 other solutions in additional languages (cpp, erlang, fsharp, groovy ...)