cl-interpret: Give the interpreter a little love
And stop copying strings around.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// FizzBuzz, using the unstable variadic-`print` builtin
|
||||
|
||||
fn main() {
|
||||
fizz_buzz(10, 20)
|
||||
fizzbuzz(10, 20)
|
||||
}
|
||||
|
||||
// Outputs FizzBuzz for numbers between `start` and `end`, inclusive
|
||||
fn fizz_buzz(start: i128, end: i128) {
|
||||
fn fizzbuzz(start: i128, end: i128) {
|
||||
for x in start..=end {
|
||||
print(if x % 15 == 0 {
|
||||
"FizzBuzz"
|
||||
|
||||
Reference in New Issue
Block a user