fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 256: Count backwards
Idiom # 256: Count backwards
See
programming-idioms.org
:
Code
(5..0 : -1) ! say
What are effects?
Running Example
ex256 is # using pipe and partially applied call (5..0 : -1) ! say # using reverse, pipe and partially applied call (0..5).reverse ! say # using a loop for x in 5..0 : -1 do say x # using tail-recursion f(n i32) => say n if n > 0 f n-1 f 5 # using as_string on a Sequence say ((5..0 : -1).as_string "\n")
What are effects?
last changed: 2024-07-01
next: Idiom # 257: Traverse list backwards