Skip to content

Improvements to lesson 17 and 18 #641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

henriquelalves
Copy link
Contributor

@henriquelalves henriquelalves commented Sep 1, 2022

fix #626
fix #612
fix #593
fix #615
fix #589

Related issue (if applicable): #636 , #626, #612, #593, #615, #589
There were a lot of small but good suggestions for lessons 17 and 18, this pull request tries to solve most of them.

What kind of change does this PR introduce?

  • Fix code highlight on lesson 17 on while-loop "step"
  • Add some clarification on cell in lesson 17
    • I didn't go further with the suggested changes from Lesson 17 clarity #615 because that would imply changing the exercise and all "cell" references of Lesson 18 too; since it would be a more complex refactor (if taking into consideration changing cell to current_cell in the real code as well), I thought it would be best to leave this to a different PR.
  • Add some clarification on starting counting cells at 0 in lesson 17
  • Add some clarification on the loop code in lesson 18
  • Fix some code illustration in lesson 18

This does add some repetition between lesson 18 and lesson 19 (it's mostly the same thing and examples on both lessons), but lesson 19 later explains arrays more thoroughly, while lesson 18 just use them on loops.

Also, I couldn't figure out a way to "unwrap" lesson 17 while-loops without giving room for misinterpretation. The problem is that while-loops branch out only when the condition is not true anymore, unlike the for-loops we used as examples that had a compile-time finite amount of loops. So unwrapping the while-loop as:

if value < 4:
  print(value)

if value < 4:
  print(value)

...

May give the impression that it works similar as the for-loop in the sense that while value < 4 will always repeat the code for times max.

Does this PR introduce a breaking change?
Nope.

@henriquelalves henriquelalves changed the title Improvements to lesson 18 Improvements to lesson 17 and 18 Sep 1, 2022
@@ -122,9 +122,49 @@ title = ""
type = 0
text = "In the above example, for each item in the list [code][0, 1, 2][/code], Godot sets [code]number[/code] to the item, then executes the code in the [code]for[/code] loop.

In this example, we're printing the value of [code]number[/code] as Godot moves through the loop.
We'll get to explain arrays more throughly in the next lesson, but pay notice on the fact that [code]number[/code] is just a variable you are assigning values to using the [code]for[/code] loop, and you could name it anything you want. The above code has the exact same behaviour as the next example:"
Copy link
Contributor

@NathanLovato NathanLovato Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pay notice of the fact that -> redundant, maybe incorrect, but for conciseness, just notice that is good. Avoid extra words like "more"

Use US English: behaviour -> behavior

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other conciseness examples: exact same -> same

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above code has the exact same behaviour as the next example

Edited:

This code behaves the same as the previous example

@NathanLovato NathanLovato merged commit ca15f48 into GDQuest:main Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment