Re-sync patches with current changes

This commit is contained in:
Dave Gauer 2021-06-14 11:52:22 -04:00
parent de322fab46
commit 9209879d73
7 changed files with 57 additions and 15 deletions

View file

@ -1,12 +1,12 @@
22c22
25c25
< const d: u8 = ziggy[???];
---
> const d: u8 = ziggy[4];
26c26
29c29
< const laugh = "ha " ???;
---
> const laugh = "ha " ** 3;
33c33
36c36
< const major_tom = major ??? tom;
---
> const major_tom = major ++ " " ++ tom;

View file

@ -1,12 +1,12 @@
32c32
34c34
< blue = ???,
---
> blue = 0x0000ff,
54c54
56c56
< \\ <span style="color: #{}">Blue</span>
---
> \\ <span style="color: #{x:0>6}">Blue</span>
59c59
62c62
< @enumToInt(???), // Oops! We're missing something!
---
> @enumToInt(Color.blue), // Oops! We're missing something!

View file

@ -1,12 +1,12 @@
96c96
95c95
< const print = ???;
---
> const print = std.debug.print;
152c152
160c160
< levelUp(glorp, reward_xp);
---
> levelUp(&glorp, reward_xp);
157c157
166c166
< fn levelUp(character_access: Character, xp: u32) void {
---
> fn levelUp(character_access: *Character, xp: u32) void {

View file

@ -1,10 +1,10 @@
34,35c34,35
35,36c35,36
< const hand1: []u8 = cards[???];
< const hand2: []u8 = cards[???];
---
> const hand1: []u8 = cards[0..4];
> const hand2: []u8 = cards[4..];
45c45
46c46
< fn printHand(hand: ???) void {
---
> fn printHand(hand: []u8) void {

View file

@ -1,4 +1,4 @@
33c33
35c35
< const zen12_string: []const u8 = zen_manyptr;
---
> const zen12_string: []const u8 = zen_manyptr[0..21];

View file

@ -1,4 +1,46 @@
132,133c131,132
20c20
< // statement. Does that mean you can return a value from any
---
> // statement. Does that mean you can return a value from any
28,30c28,30
< // Labels can also be used with loops. Being able to break out of
< // nested loops at a specific level is one of those things that
< // you won't use every day, but when the time comes, it's
---
> // And all of that also applies to loops. Being able to break out
> // of nested loops at a specific level is one of those things
> // that you won't use every day, but when the time comes, it's
32,33c32
< // inner loop is sometimes so handy, it almost feels like cheating
< // (and can help you avoid creating a lot of temporary variables).
---
> // inner loop is is almost too beautiful to look at directly:
41,44c40,44
< // In the above example, the break exits from the outer loop
< // labeled "two_loop" and returns the value 2. The else clause is
< // attached to the outer two_loop and would be evaluated if the
< // loop somehow ended without the break having been called.
---
> // The break exits from the outer loop labeled "two_loop" and
> // returns the value 2. The else clause is attached to the outer
> // two_loop and would be evaluated if the loop somehow ended
> // without the break having been called. (Impossible in this
> // case.)
55,56c55,56
< // As mentioned before, we'll soon understand why these two
< // numbers don't need explicit types. Hang in there!
---
> // As mentioned before, we'll soon understand why these numbers
> // don't need explicit types. Hang in there!
100c100
< // numbers (based on array position) will be fine for our
---
> // numbers (based on array position!) will be fine for our
108c108
< // Now look at each required ingredient for the Food...
---
> // Now look at each required ingredient for the food...
131,132c131,132
< break;
< };
---

View file

@ -1,8 +1,8 @@
83c83
86c86
< for (???) |s| {
---
> for (my_seq) |s| {
95c95
98c98
< while (??? != my_sentinel) {
---
> while (my_seq[i] != my_sentinel) {