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

js beta build a RPG step 150 and step 151 can be combined #54866

Open
hbar1st opened this issue May 19, 2024 · 3 comments · May be fixed by #54894
Open

js beta build a RPG step 150 and step 151 can be combined #54866

hbar1st opened this issue May 19, 2024 · 3 comments · May be fixed by #54894
Labels
help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.

Comments

@hbar1st
Copy link
Contributor

hbar1st commented May 19, 2024

Describe the Issue

I noticed that step 150 of the RPG js beta curriculum asks us to create an if statement at a specific line in the editor (which happens to be blank) and then in step 151, it tells us to move the line that is currently below the new if statement inside the if block.

I feel this could have been done in one step by just telling us to create an if statement around the line monsterHealth -= weapons[currentWeapon].power + Math.floor(Math.random() * xp) + 1; so we're not having to move it (or move our curly brace around it in a separate step). It seems like something simple to ask and shouldn't require 2 steps to do this?

The current step 150 instruction is:
In your attack function, below the health variable, create an if statement. Set the condition to call the isMonsterHit function.

which can become for eg:
In your attack function, find the line of code that updates the monsterHealth variable and place it within an if block with a condition that calls the isMonsterHit function.

Affected Page

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-150

Your code

N/A

Expected behavior

ask the learner to create the if statement around the code instead of create the if in step 150 then move the code into it in step 151

Screenshots

No response

System

N/A

Additional context

No response

@hbar1st hbar1st added scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc. labels May 19, 2024
@ilenia-magoni ilenia-magoni added the new javascript course These are for issues dealing with the new JS curriculum label May 20, 2024
@jdwilkin4 jdwilkin4 added help wanted Open for all. You do not need permission to work on these. and removed status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. labels May 20, 2024
@jdwilkin4
Copy link
Contributor

Note to contributors

Since this change involves combining the two steps and removing step 151, you will need to review the docs on how to remove steps if you have never done that before.

https://contribute.freecodecamp.org/#/how-to-work-on-practice-projects?id=using-the-challenge-editor

@AndrewYturaldi
Copy link
Contributor

AndrewYturaldi commented May 21, 2024

I ran into some trouble when I needed to delete the step using my local repo on my Windows system... I tried using both the challenge-editor and the command 'Delete Step,' but ran into the same error both times. I was able to fix it by modifying this function in the get-project-info.ts:

export function getProjectName(): string { return getProjectPath().split('/').slice(-2)[0]; }

into this:

export function getProjectName(): string { const projectPath = getProjectPath(); const directories = projectPath.split(/[\\/]/); return directories.slice(-2)[0]; }

I believe it had to do with the differences in the way Windows and Linux absolute paths are done... was this just a peronal problem? Or do we know if others have had trouble deleting steps on their Windows systems? I am not including this change in the pull request for this issue, but I figured this problem I ran into may need its own issue.

@naomi-lgbt
Copy link
Member

@AndrewYturaldi we do not officially support development on Windows directly - instead, we recommend (and use) WSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants