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.07k stars 153 forks source link

Lesson 20 Looping over arrays bug in Practice 2 #452

Closed Tharanel7 closed 2 years ago

Tharanel7 commented 2 years ago

Error Meassage even if the Code is right

So i had the issue that the Code was correct but i got always the Error that 1 of the Rectangle have the wrong size, even with the Solution code.

Steps to reproduce the bug:

  1. Go to Practice 2 in Lesson 20
  2. Write the Code for the Practice, but for draw_rectangle(size.x, size.y) use draw_rectangle(rectangle_sizes.x, rectangle_sizes.y) and run the Code now the turtle should do the jumps but spin on point and dont draw the Rectangles. If you now correct the Code to draw_rectangle(size.x, size.y) the Code works but you get the Error that 1 Rectangle is not the size it should be even with the Solution Code.

Screenshots Screenshots from wrong Code, Correct Code and Solution Code after running in Additional context

Information about your device :

Additional context Add any other context about the problem here.

Lesson 20 Practice 2 Wrong Code Lesson 20 Practice 2 correct Code Lesson 20 Practice 2 Solution Code
pudgypoultry commented 2 years ago

I am also experiencing this same issue, here is my error log gdquest-1647667036762.log :

ShadowMitia commented 2 years ago

Same here, sharing my log in case it helps. Given solution doesn't work, and own solutions don't work.

gdquest-1648495436790.log .

Operating System: Linux (Pop OS) Browser: Firefox Nightly100.0a1 (2022-03-26) (64-bit)

katch33 commented 2 years ago

I am experiencing the same issue. By going back to the lesson and doing both practices again the solution code worked for me. Log below

gdquest-1648722753592.log .

NathanLovato commented 2 years ago

Could you guys please try again with the latest staging build and tell me if the solution code still shows up as incorrect?

Here's the direct link: https://gdquest.github.io/learn-gdscript/staging/#course/lesson-20-looping-over-arrays/practice-clsFcSrG.tres

When doing so, please click on your browser's URL bar and press Ctrl Shift R to clear the page's cache. Otherwise, it may reload the version of the app you last used and that still has the bug.


Also, this code shouldn't work.

func run():
    for size in rectangle_sizes:
        draw_rectangle(rectangle_sizes.x, rectangle_sizes.y)

The function expects a decimal value but this code tries to pass an array.

In the Godot editor, this will trigger an error, but in the browser, it seems the array gets converted to a value of 0 when used as an invalid argument type.

Anyway, hopefully, the more important issue of the practice not passing with the correct code should be solved. It's working fine on my end.

NathanLovato commented 2 years ago

Got some people to test this, seems it's fixed already. Please let me know if it's not and we'll look into it again.

ShadowMitia commented 2 years ago

Confirming it's workig for me! Thanks!