t8558.nim 234 B

1234567891011121314151617181920212223242526
  1. discard """
  2. output: '''10
  3. 9
  4. 8
  5. 7
  6. 6
  7. 5
  8. 4
  9. 3
  10. 2
  11. 1
  12. go!
  13. '''
  14. """
  15. type Integral = concept x
  16. x == 0 is bool
  17. x - 1 is type(x)
  18. proc countToZero(n: Integral) =
  19. if n == 0: echo "go!"
  20. else:
  21. echo n
  22. countToZero(n-1)
  23. countToZero(10)