GDQuest / learn-gdscript

Learn Godot's GDScript programming language from zero, right in your browser, for free.
https://gdquest.github.io/learn-gdscript/
Other
2.11k stars 160 forks source link

Lesson 6: Drawing squares of any size: direction check fails #466

Closed Sheshuk closed 2 years ago

Sheshuk commented 2 years ago

Describe the bug In the practice part the test for the turtle direction fails when the code is not composed of four turn_right(90)

To Reproduce Steps to reproduce the bug:

  1. Go to 'Lesson6/Drawing sqares of any sizes' practice
  2. Enter code:
    func draw_square(length):
    for i in range(4):
        move_forward(length)
    turn_right(90)
  3. Run
  4. See the squares and the direction are correct, but the check fails

Expected behavior The test should pass for the given code, as well as more complicated examples. The test is expected to be checking the exact conditions in the test description (turtle direction), instead of parsing the code.

Information about your device (please complete the following information):

Additional context Probably this is an easy fix, something like checking _turn_degrees value instead of https://github.com/GDQuest/learn-gdscript/blob/fb5de4d757dbfbf172f3c46db5ab7b73fc44ef43/course/lesson-6-multiple-function-parameters/drawing_squares/TestsDrawingSquares.gd#L33

NathanLovato commented 2 years ago

We need to change the test names/practice description rather. It's intentional, you want the squares to always draw in the same direction.

EDIT: my bad, I misread the issue. Indeed, the test needs a fix.

NathanLovato commented 2 years ago

Thanks for the report! Please let us know if you encounter anything like this again.