Skip to content
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

Error in code example logic in first lesson (1. What code is Like) #947

Open
nocturnalmc opened this issue Apr 24, 2024 · 0 comments
Open
Labels
content Issues with the lessons, practices, including their code examples

Comments

@nocturnalmc
Copy link

Issue description:
A clear and concise description of what the issue is.

  • In the section to try to spot similarities & differences in different languages there are error in the code logic
function take_damage(amout) {
    health -= amount
    if (health < 0) {
        die()
    }
}
  • Where as if health is exactly === 0 the function die() will not be called. Which mean the character still alive when health is exactly === 0
  • I think the correct comparison operator here is <=
@nocturnalmc nocturnalmc added the content Issues with the lessons, practices, including their code examples label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Issues with the lessons, practices, including their code examples
Projects
None yet
Development

No branches or pull requests

1 participant