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!
30
30
31
31
Note: This section is for stages 2 and beyond.
32
32
33
- 1 . Ensure you have ` zig (0.14 ) ` installed locally
33
+ 1 . Ensure you have ` zig (0.15 ) ` installed locally
34
34
1 . Run ` ./your_program.sh ` to run your program, which is implemented in
35
35
` src/main.zig ` .
36
36
1 . 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");
4
4
pub fn build (b : * std.Build ) void {
5
5
const exe = b .addExecutable (.{
6
6
.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
+ }),
10
11
});
11
12
12
13
// This declares intent for the executable to be installed into the
Original file line number Diff line number Diff line change 9
9
// This field is optional.
10
10
// This is currently advisory only; Zig does not yet do anything
11
11
// with this value.
12
- .minimum_zig_version = "0.14.0 " ,
12
+ .minimum_zig_version = "0.15.1 " ,
13
13
14
14
// This field is optional.
15
15
// 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");
2
2
const net = std .net ;
3
3
4
4
pub fn main () ! void {
5
- const stdout = std .io .getStdOut ().writer ();
6
-
7
5
// 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 " , .{});
9
7
10
8
// Uncomment this block to pass the first stage
11
9
// const address = try net.Address.resolveIp("127.0.0.1", 4221);
@@ -15,5 +13,5 @@ pub fn main() !void {
15
13
// defer listener.deinit();
16
14
//
17
15
// _ = try listener.accept();
18
- // try stdout .print("client connected!", .{});
16
+ // std.debug .print("client connected!", .{});
19
17
}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Time to move on to the next stage!
30
30
31
31
Note: This section is for stages 2 and beyond.
32
32
33
- 1 . Ensure you have ` zig (0.14 ) ` installed locally
33
+ 1 . Ensure you have ` zig (0.15 ) ` installed locally
34
34
1 . Run ` ./your_program.sh ` to run your program, which is implemented in
35
35
` src/main.zig ` .
36
36
1 . 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");
4
4
pub fn build (b : * std.Build ) void {
5
5
const exe = b .addExecutable (.{
6
6
.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
+ }),
10
11
});
11
12
12
13
// This declares intent for the executable to be installed into the
Original file line number Diff line number Diff line change 9
9
// This field is optional.
10
10
// This is currently advisory only; Zig does not yet do anything
11
11
// with this value.
12
- .minimum_zig_version = "0.14.0 " ,
12
+ .minimum_zig_version = "0.15.1 " ,
13
13
14
14
// This field is optional.
15
15
// 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");
2
2
const net = std .net ;
3
3
4
4
pub fn main () ! void {
5
- const stdout = std .io .getStdOut ().writer ();
6
-
7
5
const address = try net .Address .resolveIp ("127.0.0.1" , 4221 );
8
6
var listener = try address .listen (.{
9
7
.reuse_address = true ,
10
8
});
11
9
defer listener .deinit ();
12
10
13
11
_ = try listener .accept ();
14
- try stdout .print ("client connected!" , .{});
12
+ std . debug .print ("client connected!" , .{});
15
13
}
Original file line number Diff line number Diff line change 1
- @@ -1,19 +1,15 @@
1
+ @@ -1,17 +1,13 @@
2
2
const std = @import("std");
3
3
const net = std.net;
4
4
5
5
pub fn main() !void {
6
- const stdout = std.io.getStdOut().writer();
7
-
8
6
- // 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", .{});
10
8
+ const address = try net.Address.resolveIp("127.0.0.1", 4221);
11
9
+ var listener = try address.listen(.{
12
10
+ .reuse_address = true,
21
19
- // defer listener.deinit();
22
20
- //
23
21
- // _ = try listener.accept();
24
- - // try stdout .print("client connected!", .{});
22
+ - // std.debug .print("client connected!", .{});
25
23
+ _ = try listener.accept();
26
- + try stdout .print("client connected!", .{});
24
+ + std.debug .print("client connected!", .{});
27
25
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ var listener = try address.listen(.{
11
11
defer listener.deinit();
12
12
13
13
_ = try listener.accept();
14
- try stdout .print("client connected!", .{});
14
+ std.debug .print("client connected!", .{});
15
15
```
16
16
17
17
Push your changes to pass the first stage:
You can’t perform that action at this time.
0 commit comments