Giter Club home page Giter Club logo

Comments (4)

NathanLovato avatar NathanLovato commented on June 16, 2024

Did you clone the project in Godot? If so, you need to use the exported app to use it, you can´t just import the project in the Godot editor.

You can follow the series in the browser here: https://gdquest.github.io/learn-gdscript/

Or download a desktop copy here: https://gdquest.itch.io/learn-godot-gdscript

from learn-gdscript.

reneawil000 avatar reneawil000 commented on June 16, 2024

i didn't import the project into the godot editor, i'm using the web version.

from learn-gdscript.

NathanLovato avatar NathanLovato commented on June 16, 2024

Thanks for the precision! I think what could be causing this is we try to rewrite while loops to ensure they're never infinite. The rewrite may be failing when using two while loops in a row.

from learn-gdscript.

NFulkerson avatar NFulkerson commented on June 16, 2024

I think there may be another issue here, as I ran into a similar problem. When I initially tried to write a solution for this exercise, I wrote the following:

func move_to_bottom():
    while cell.y < board_size.y:
        cell.y += 1

Essentially, the solution posted above, but without the additional loop. The script verifier couldn't catch the issue, and then I noticed the first issue -- the robot can move outside the board grid. So I fixed it:

func move_to_bottom():
    while cell.y < board_size.y - 1:
        cell.y += 1

But still no dice from the script verifier. That's when I realized the second issue: I was trying to assign a new value to the y property of the cell. Assigning a new vector as the solution suggests works:

func move_to_bottom():
    while cell.y < board_size.y - 1:
        cell += Vector2(0, 1)

For a final experiment, I changed the condition to the following:
while cell.y < board_size.y - 1

This doesn't pass tests, but the script verifier helpfully tells me that the robot has moved beyond the grid. Long story short, it seems like the script verifier isn't catching attempts to assign/add values to a property of the vector where it expects you to add/assign a new vector.

from learn-gdscript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.