From f5b60ea2ff7beb39b7f925876636175de2a241f0 Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 10 Oct 2023 17:21:28 -0400 Subject: [PATCH] Rewrite example --- examples/fizzbuzz.ds | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/fizzbuzz.ds b/examples/fizzbuzz.ds index c4c9cb0..bcf9084 100644 --- a/examples/fizzbuzz.ds +++ b/examples/fizzbuzz.ds @@ -1,14 +1,17 @@ count = 1 while count <= 15 { - (output count) + mod_three = count % 3 == 0 + mod_five = count % 5 == 0 - if count % 3 == 0 { + if mod_three && mod_five { + (output 'fizzbuzz') + } else if mod_three { (output 'fizz') - } - - if count % 5 == 0 { + } else if mod_five { (output 'buzz') + } else { + (output count) } count += 1