mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 10:22:15 +00:00
26 lines
234 B
Nim
26 lines
234 B
Nim
discard """
|
|
output: '''10
|
|
9
|
|
8
|
|
7
|
|
6
|
|
5
|
|
4
|
|
3
|
|
2
|
|
1
|
|
go!
|
|
'''
|
|
"""
|
|
|
|
type Integral = concept x
|
|
x == 0 is bool
|
|
x - 1 is type(x)
|
|
|
|
proc countToZero(n: Integral) =
|
|
if n == 0: echo "go!"
|
|
else:
|
|
echo n
|
|
countToZero(n-1)
|
|
|
|
countToZero(10) |