sample-code: print->println to match interpreter behavior

This commit is contained in:
John 2024-07-26 05:13:52 -05:00
parent 695c812bf5
commit a8b8a91c79
3 changed files with 4 additions and 4 deletions

View File

@ -2,10 +2,10 @@
fn main() { fn main() {
for num in 0..=30 { for num in 0..=30 {
print("fib(", num, ") = ", fib_iterative(num)) println("fib(", num, ") = ", fib_iterative(num))
} }
for num in 0..=30 { for num in 0..=30 {
print("fib(", num, ") = ", fib(num)) println("fib(", num, ") = ", fib(num))
} }
} }

View File

@ -7,7 +7,7 @@ fn main() {
// Outputs FizzBuzz for numbers between `start` and `end`, inclusive // Outputs FizzBuzz for numbers between `start` and `end`, inclusive
fn fizzbuzz(start: i128, end: i128) { fn fizzbuzz(start: i128, end: i128) {
for x in start..=end { for x in start..=end {
print(if x % 15 == 0 { println(if x % 15 == 0 {
"FizzBuzz" "FizzBuzz"
} else if 0 == x % 3 { } else if 0 == x % 3 {
"Fizz" "Fizz"

View File

@ -1,3 +1,3 @@
fn main() { fn main() {
print("Hello, world!") println("Hello, world!")
} }