You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the second example of this section's lesson, board_size.x - 1 is used as a parameter in the range() function when it should be board_size.x as void range(length: int) creates a list of numbers from 0 to length - 1.
This mistake can be seen again in the first practice lesson 'Using a for loop to move to the end of the board'. The user must recreate the mistake shown in this lesson's example to succeed in the practice lesson.
The text was updated successfully, but these errors were encountered:
sin3to1faith
changed the title
Lesson 17 "Using a for loop instead of a while loop"
Lesson 17. Introduction to For Loops: "Using a for loop instead of a while loop"
May 13, 2024
sin3to1faith
changed the title
Lesson 17. Introduction to For Loops: "Using a for loop instead of a while loop"
Lesson 17. Introduction to For Loops: "Using a for loop instead of a while loop" contains mistakes.
May 13, 2024
Thanks for taking the time to give feedback. In this case, the lesson's correct. To move to the end of a grid of 5 cells, if you're on cell 1, you need to move 4 times. range(5) (the size of the array) would produce 5 numbers (0, 1, 2, 3, 4) and make you move 5 steps, so 1 cell past the limit. That's why you need to subtract 1 from the board size.
I'm changing the issue title to add a new sentence about that to the lesson.
NathanLovato
changed the title
Lesson 17. Introduction to For Loops: "Using a for loop instead of a while loop" contains mistakes.
Lesson 17. Introduction to For Loops: Explain why we need to subtract 1 to board_size.x
May 13, 2024
I'm guessing cell 1 refers to the 0 on y in Vector2? My apologies for the oversight. I assumed there was a "cell 0" and forgot that it was just an index.
Is it correct to presume that we can use range(board_size.x) if the robot is not already on the board?
In the second example of this section's lesson,
board_size.x - 1
is used as a parameter in therange()
function when it should beboard_size.x
asvoid range(length: int)
creates a list of numbers from 0 to length - 1.This mistake can be seen again in the first practice lesson 'Using a for loop to move to the end of the board'. The user must recreate the mistake shown in this lesson's example to succeed in the practice lesson.
The text was updated successfully, but these errors were encountered: