mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-12-27 16:05:37 +00:00
changed 1 to 42 for better understanding
This commit is contained in:
parent
ed9694e557
commit
757826d45a
|
|
@ -730,7 +730,7 @@ const exercises = [_]Exercise{
|
|||
},
|
||||
.{
|
||||
.main_file = "009_if.zig",
|
||||
.output = "Foo is 1!",
|
||||
.output = "Foo is 42!",
|
||||
},
|
||||
.{
|
||||
.main_file = "010_if2.zig",
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@
|
|||
const std = @import("std");
|
||||
|
||||
pub fn main() void {
|
||||
const foo = 1;
|
||||
const foo = 42;
|
||||
|
||||
// Please fix this condition:
|
||||
if (foo) {
|
||||
// We want our program to print this message!
|
||||
std.debug.print("Foo is 1!\n", .{});
|
||||
std.debug.print("Foo is 42!\n", .{});
|
||||
} else {
|
||||
std.debug.print("Foo is not 1!\n", .{});
|
||||
std.debug.print("Foo is not 42!\n", .{});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
--- exercises/009_if.zig 2023-10-03 22:15:22.122241138 +0200
|
||||
+++ answers/009_if.zig 2023-10-05 20:04:06.882763636 +0200
|
||||
--- exercises/009_if.zig 2025-11-28 14:40:19.301738185 +0100
|
||||
+++ answers/009_if.zig 2025-11-28 14:39:07.756077340 +0100
|
||||
@@ -24,7 +24,7 @@
|
||||
const foo = 1;
|
||||
const foo = 42;
|
||||
|
||||
// Please fix this condition:
|
||||
- if (foo) {
|
||||
+ if (foo == 1) {
|
||||
+ if (foo == 42) {
|
||||
// We want our program to print this message!
|
||||
std.debug.print("Foo is 1!\n", .{});
|
||||
std.debug.print("Foo is 42!\n", .{});
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user