aboutsummaryrefslogtreecommitdiff
path: root/17_quiz2.zig
diff options
context:
space:
mode:
authorDave Gauer <dave@ratfactor.com>2021-02-09 18:36:57 -0500
committerDave Gauer <dave@ratfactor.com>2021-02-09 18:36:57 -0500
commit55ad7c32f2d534b1fbd438204d21738f958c51a5 (patch)
tree16be4b53193105a759b3eec25be5e664d41c428d /17_quiz2.zig
parentcf0920de31e9b5f3c5ba6de19a1b4c8d0c58b907 (diff)
downloadziglings-55ad7c32f2d534b1fbd438204d21738f958c51a5.tar.gz
ziglings-55ad7c32f2d534b1fbd438204d21738f958c51a5.tar.bz2
ziglings-55ad7c32f2d534b1fbd438204d21738f958c51a5.tar.xz
ziglings-55ad7c32f2d534b1fbd438204d21738f958c51a5.zip
Moved exercises to exercises because exercises
Diffstat (limited to '17_quiz2.zig')
-rw-r--r--17_quiz2.zig28
1 files changed, 0 insertions, 28 deletions
diff --git a/17_quiz2.zig b/17_quiz2.zig
deleted file mode 100644
index 339f733..0000000
--- a/17_quiz2.zig
+++ /dev/null
@@ -1,28 +0,0 @@
-//
-// Quiz time again! Let's see if you can solve the famous "Fizz Buzz"!
-//
-// "Players take turns to count incrementally, replacing
-// any number divisible by three with the word "fizz",
-// and any number divisible by five with the word "buzz".
-// - From https://en.wikipedia.org/wiki/Fizz_buzz
-//
-// Let's go from 1 to 16. This has been started for you, but there's
-// some problems. :-(
-//
-const std = import standard library;
-
-function main() void {
- var i: u8 = 1;
- var stop_at: u8 = 16;
-
- // What kind of loop is this? A 'for' or a 'while'?
- ??? (i <= stop_at) : (i += 1) {
- if (i % 3 == 0) std.debug.print("Fizz", .{});
- if (i % 5 == 0) std.debug.print("Buzz", .{});
- if ( !(i % 3 == 0) and !(i % 5 == 0) ) {
- std.debug.print("{}", .{???});
- }
- std.debug.print(", ", .{});
- }
- std.debug.print("\n",.{});
-}