mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-12-27 16:05:37 +00:00
Merge pull request 'changed 1 to 42 for better understanding' (#329) from i326 into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/329
This commit is contained in:
commit
9302d10282
|
|
@ -730,7 +730,7 @@ const exercises = [_]Exercise{
|
||||||
},
|
},
|
||||||
.{
|
.{
|
||||||
.main_file = "009_if.zig",
|
.main_file = "009_if.zig",
|
||||||
.output = "Foo is 1!",
|
.output = "Foo is 42!",
|
||||||
},
|
},
|
||||||
.{
|
.{
|
||||||
.main_file = "010_if2.zig",
|
.main_file = "010_if2.zig",
|
||||||
|
|
@ -1275,7 +1275,7 @@ const exercises = [_]Exercise{
|
||||||
\\Max difference (new fn): 0.014
|
\\Max difference (new fn): 0.014
|
||||||
,
|
,
|
||||||
},
|
},
|
||||||
.{ .main_file = "110_quiz9.zig", .output =
|
.{ .main_file = "110_quiz9.zig", .output =
|
||||||
\\Toggle pins with XOR on PORTB
|
\\Toggle pins with XOR on PORTB
|
||||||
\\-----------------------------
|
\\-----------------------------
|
||||||
\\ 1100 // (initial state of PORTB)
|
\\ 1100 // (initial state of PORTB)
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,13 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
|
|
||||||
pub fn main() void {
|
pub fn main() void {
|
||||||
const foo = 1;
|
const foo = 42;
|
||||||
|
|
||||||
// Please fix this condition:
|
// Please fix this condition:
|
||||||
if (foo) {
|
if (foo) {
|
||||||
// We want our program to print this message!
|
// We want our program to print this message!
|
||||||
std.debug.print("Foo is 1!\n", .{});
|
std.debug.print("Foo is 42!\n", .{});
|
||||||
} else {
|
} 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
|
--- exercises/009_if.zig 2025-11-28 14:40:19.301738185 +0100
|
||||||
+++ answers/009_if.zig 2023-10-05 20:04:06.882763636 +0200
|
+++ answers/009_if.zig 2025-11-28 14:39:07.756077340 +0100
|
||||||
@@ -24,7 +24,7 @@
|
@@ -24,7 +24,7 @@
|
||||||
const foo = 1;
|
const foo = 42;
|
||||||
|
|
||||||
// Please fix this condition:
|
// Please fix this condition:
|
||||||
- if (foo) {
|
- if (foo) {
|
||||||
+ if (foo == 1) {
|
+ if (foo == 42) {
|
||||||
// We want our program to print this message!
|
// We want our program to print this message!
|
||||||
std.debug.print("Foo is 1!\n", .{});
|
std.debug.print("Foo is 42!\n", .{});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user