File tree Expand file tree Collapse file tree 14 files changed +28
-33
lines changed
Expand file tree Collapse file tree 14 files changed +28
-33
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Time to move on to the next stage!
3030
3131Note: This section is for stages 2 and beyond.
3232
33- 1 . Ensure you have ` zig (0.14 ) ` installed locally
33+ 1 . Ensure you have ` zig (0.15 ) ` installed locally
34341 . Run ` ./your_program.sh ` to run your program, which is implemented in
3535 ` src/main.zig ` .
36361 . Commit your changes and run ` git push origin master ` to submit your solution
Original file line number Diff line number Diff line change @@ -4,9 +4,10 @@ const std = @import("std");
44pub fn build (b : * std.Build ) void {
55 const exe = b .addExecutable (.{
66 .name = "main" ,
7- .root_source_file = b .path ("src/main.zig" ),
8- .target = b .standardTargetOptions (.{}),
9- .optimize = b .standardOptimizeOption (.{}),
7+ .root_module = b .createModule (.{
8+ .root_source_file = b .path ("src/main.zig" ),
9+ .target = b .graph .host ,
10+ }),
1011 });
1112
1213 // This declares intent for the executable to be installed into the
Original file line number Diff line number Diff line change 99 // This field is optional.
1010 // This is currently advisory only; Zig does not yet do anything
1111 // with this value.
12- .minimum_zig_version = "0.14.0 " ,
12+ .minimum_zig_version = "0.15.1 " ,
1313
1414 // This field is optional.
1515 // Each dependency must either provide a `url` and `hash`, or a `path`.
Original file line number Diff line number Diff line change @@ -2,10 +2,8 @@ const std = @import("std");
22const net = std .net ;
33
44pub fn main () ! void {
5- const stdout = std .io .getStdOut ().writer ();
6-
75 // You can use print statements as follows for debugging, they'll be visible when running tests.
8- try stdout .print ("Logs from your program will appear here!\n " , .{});
6+ std . debug .print ("Logs from your program will appear here!\n " , .{});
97
108 // Uncomment this block to pass the first stage
119 // const address = try net.Address.resolveIp("127.0.0.1", 4221);
@@ -15,5 +13,5 @@ pub fn main() !void {
1513 // defer listener.deinit();
1614 //
1715 // _ = try listener.accept();
18- // try stdout .print("client connected!", .{});
16+ // std.debug .print("client connected!", .{});
1917}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Time to move on to the next stage!
3030
3131Note: This section is for stages 2 and beyond.
3232
33- 1 . Ensure you have ` zig (0.14 ) ` installed locally
33+ 1 . Ensure you have ` zig (0.15 ) ` installed locally
34341 . Run ` ./your_program.sh ` to run your program, which is implemented in
3535 ` src/main.zig ` .
36361 . Commit your changes and run ` git push origin master ` to submit your solution
Original file line number Diff line number Diff line change @@ -4,9 +4,10 @@ const std = @import("std");
44pub fn build (b : * std.Build ) void {
55 const exe = b .addExecutable (.{
66 .name = "main" ,
7- .root_source_file = b .path ("src/main.zig" ),
8- .target = b .standardTargetOptions (.{}),
9- .optimize = b .standardOptimizeOption (.{}),
7+ .root_module = b .createModule (.{
8+ .root_source_file = b .path ("src/main.zig" ),
9+ .target = b .graph .host ,
10+ }),
1011 });
1112
1213 // This declares intent for the executable to be installed into the
Original file line number Diff line number Diff line change 99 // This field is optional.
1010 // This is currently advisory only; Zig does not yet do anything
1111 // with this value.
12- .minimum_zig_version = "0.14.0 " ,
12+ .minimum_zig_version = "0.15.1 " ,
1313
1414 // This field is optional.
1515 // Each dependency must either provide a `url` and `hash`, or a `path`.
Original file line number Diff line number Diff line change @@ -2,14 +2,12 @@ const std = @import("std");
22const net = std .net ;
33
44pub fn main () ! void {
5- const stdout = std .io .getStdOut ().writer ();
6-
75 const address = try net .Address .resolveIp ("127.0.0.1" , 4221 );
86 var listener = try address .listen (.{
97 .reuse_address = true ,
108 });
119 defer listener .deinit ();
1210
1311 _ = try listener .accept ();
14- try stdout .print ("client connected!" , .{});
12+ std . debug .print ("client connected!" , .{});
1513}
Original file line number Diff line number Diff line change 1- @@ -1,19 +1,15 @@
1+ @@ -1,17 +1,13 @@
22 const std = @import("std");
33 const net = std.net;
44
55 pub fn main() !void {
6- const stdout = std.io.getStdOut().writer();
7-
86- // You can use print statements as follows for debugging, they'll be visible when running tests.
9- - try stdout .print("Logs from your program will appear here!\n", .{});
7+ - std.debug .print("Logs from your program will appear here!\n", .{});
108+ const address = try net.Address.resolveIp("127.0.0.1", 4221);
119+ var listener = try address.listen(.{
1210+ .reuse_address = true,
2119- // defer listener.deinit();
2220- //
2321- // _ = try listener.accept();
24- - // try stdout .print("client connected!", .{});
22+ - // std.debug .print("client connected!", .{});
2523+ _ = try listener.accept();
26- + try stdout .print("client connected!", .{});
24+ + std.debug .print("client connected!", .{});
2725 }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ var listener = try address.listen(.{
1111defer listener.deinit();
1212
1313_ = try listener.accept();
14- try stdout .print("client connected!", .{});
14+ std.debug .print("client connected!", .{});
1515```
1616
1717Push your changes to pass the first stage:
You can’t perform that action at this time.
0 commit comments