Skip to main content

CODE_FIBONACCI

Constant CODE_FIBONACCI 

Source
pub const CODE_FIBONACCI: &str = r#"# Fibonacci
-- Each number is the sum of the two before it.

## Main

Let n be 10.
Let mutable a be 0.
Let mutable b be 1.

Show "The first {n} Fibonacci numbers:".

Repeat for i from 1 to n:
    Show b.
    Let next be a + b.
    Set a to b.
    Set b to next.
"#;