fork download
  1. 1.proc GetBottleNumber(n: int): string =
  2.  
  3. 2. var bs: string
  4.  
  5. 3. if n == 0:
  6.  
  7. 4. bs = "No more bottles"
  8.  
  9. 5. elif n == 1:
  10.  
  11. 6. bs = "1 bottle"
  12.  
  13. 7. else:
  14.  
  15. 8. bs = $n & " bottles"
  16.  
  17. 9. return bs & " of beer"
  18.  
  19. 10.
  20.  
  21. 11.for bn in countdown(99, 1):
  22.  
  23. 12. var cur = GetBottleNumber(bn)
  24.  
  25. 13. echo(cur, " on the wall, ", cur, ".")
  26.  
  27. 14. echo("Take one down and pass it around, ", GetBottleNumber(bn-1), " on the wall.\n")
  28.  
  29. 15.
  30.  
  31. 16.echo "No more bottles of beer on the wall, no more bottles of beer."
  32.  
  33. 17.echo "Go to the store and buy some more, 99 bottles of beer on the wall."
  34.  
  35.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.nim(1, 6) Error: identifier expected, but found 'proc'
stdout
Standard output is empty