Hands-on Rust: "iterates x from": (Page 92)

This may just be an issue with my understanding (math isn’t my strong suit). On page 92 (PDF):

Range iterators expect that the starting value of a range will be the minimum value, and the destination the maximum. This function uses min() and max() to find the lowest and highest of a pair of values—in this case, the starting position. It then iterates x from the start to the end of the corridor, carving the tunnel along the way.

Add a second function to add horizontal tunnels in the same way, but traversing the x axis instead of the y axis:

Is this supposed to be y instead of x?

It then iterates x from the start to the end of the corridor, carving the tunnel along the way.

1 Like

Thank you! I’ve added it to the issue tracker so I won’t lose it. I’ll have to check that section and see if its just worded confusingly or I got my axes the wrong way around (that section got rearranged a few times, it’s quite possible I flipped something). I’ll try to get that into beta3, maybe beta 4.

2 Likes

Also, I don’t see there the constructor, the new function is never mentioned,jumps to the fill function

wait that is on page 96, sorry