-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Rewrite "rock paper scissors" project #26037
Rewrite "rock paper scissors" project #26037
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for revisiting this lesson. I think it could indeed do with a nice makeover, great work!
I left a few comments. I hope I caught them all but it was quite a lot to review. Let me know your thoughts!
Sidenote: You can leave the resolving up to the reviewer usually. That way they can check and resolve their requests for changes once they are committed. I'll check back tomorrow for it's late here. Thanks for taking this on! |
I've made significant changes to the original, including the requested changes. I'm unsure about using tip note boxes on the assignment; tell me what you think. |
Thanks @cakegod ! Those changes are a lot more than expected. I can't review them today anymore. I'll review this lesson once I get some time. Thanks again! |
Indeed, this is also my overall feeling. We could probably have a specific tip note-box-like for the assignment box. Adding tips requires us to add them as bullet points, which is odd since they are not strictly part of the assignment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a lot to review!
I do think this lesson was in need of some clarification judging by the amount of questions surrounding the wording in our discord.
For big changes or full lesson rewrites like this we usually start with an issue first so discussion can happen there to flesh out the exact details regarding areas of improvement.
I expect most of my comments could use some discussing as well, and I welcome your input.
I also would like another maintainer to review this after we have gone through most since it encompasses a full rewrite at this point.
I may have missed things so please go through it carefully but my key points are this:
- the different -- lines between sentences are not what we normally use so I removed them
- code elements reserved for code and not for boldening or other emphasis
- the numbered list should be fully encompassing what the step is. I approached it as: could someone experienced code this without the added steps (not numbered) below?
- the steps below are breaking the problem in the numbered list item down.
Let me know what you think!
The initial idea was to fix punctuation and make minor improvements. It then evolved into something bigger, sorry! I like the em dashes; they emphasize certain parts. I used them since I saw nothing in the layout style guide forbidding their use. In a way, the multiple steps are mixed into each step in the current assignment, so I split them into sub-steps. |
It happens! It just takes a lot more resources than the initial PR you filed. I do think this project could be enhanced and think you put in a great step to doing so!
They are not mentioned but also stand out for they are not generally used and I think the sentences don't lose a lot by not inserting them here.
Yes I can see that, and I left the sub-steps. I do think the numbering might need to go for those. And I rewrote the main steps a bit. The substeps are still an elaboration for those who need it. The only thing I wondered while reviewing is if it now doesn't go overboard on handholding, but judging from the amount of issues people have with this project being the first JS one, I think it will be a hard project either way. |
The current assignment already handholds. We're simply making the assignment clearer by breaking the steps into sub-steps. 😉 I'll commit your changes and re-check everything. |
I can't say I disagree, it's just more obfuscated by it all being crammed in a sentence I guess 😅 |
Co-authored-by: Manon <[email protected]>
3. Your game is going to play against the computer, so begin with a function called `getComputerChoice` that will randomly return either 'Rock', 'Paper' or 'Scissors'. We'll use this function in the game to make the computer's play. *Tip: use the console to make sure this is returning the expected output before moving to the next step!* | ||
4. Write a function that plays a single round of Rock Paper Scissors. The function should take two parameters - the `playerSelection` and `computerSelection` - and then return a string that declares the winner of the round like so: `"You Lose! Paper beats Rock"` | ||
* Make your function's playerSelection parameter case-insensitive (so users can input `rock`, `ROCK`, `RocK` or any other variation). | ||
Since this is your first JavaScript program built from scratch, remember the [previous wise words from the problem-solving lesson](https://www.theodinproject.com/lessons/foundations-problem-solving). Before diving into this project, first plan or pseudocode your solution, then write the code, then ensure the code works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Proofreading] The last sentence seems to describe some steps, so I provided a suggestion on how to make it clearer.
Since this is your first JavaScript program built from scratch, remember the [previous wise words from the problem-solving lesson](https://www.theodinproject.com/lessons/foundations-problem-solving). Before diving into this project, first plan or pseudocode your solution, then write the code, then ensure the code works. | |
Since this is your first JavaScript program built from scratch, remember the [previous wise words from the problem-solving lesson](https://www.theodinproject.com/lessons/foundations-problem-solving). Before diving into this project, First, plan or pseudocode your solution. Next, write the code. Lastly, ensure the code works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, we are still in the exploratory phase it seems so no final version to review yet.
console.log(playRound(playerSelection, computerSelection)); | ||
~~~ | ||
|
||
1. Your game plays for 5 rounds. Write a function called `game` which will keep score for 5 rounds, utilizing your 'playRound' function, before it declares a winner: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Proofreading] Parts of this step were a bit unclear, so I gave some ideas on how to revise it. Check out my suggestions below:
1. Your game plays for 5 rounds. Write a function called `game` which will keep score for 5 rounds, utilizing your 'playRound' function, before it declares a winner: | |
1. Write a function called `game` which will keep score for 5 rounds and utilize your 'playRound' function before it declares a winner: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope you saw my last comment. We're still finding a direction for this so no need to review just yet. Thank you however :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @cakegod! :) I found some parts of your pull request that could be improved, so check out my in-line comments for context. Other than that, your entry is off to a great start! :) Great job! :)
@cakegod I have converted this lesson to draft for now so people can see it's still a work in progress. |
@cakegod what's the status on this? If you're ready for a review again after making changes, there's a button to request it. |
Still a work in progress. I have started creating a checklist of pain points, but I have yet to write fixes for them. I'll see if I can finish it this week. |
It's time to finish this before I forget again. Tell me what you think about the latest changes. I'm not sure if we should add more tips or leave it as it is. |
I wanted to let you know it will be a while before I get to sit down for this. My focus is on an internship currently and I expect to get back to maintaining at the start of the new year. Thanks for the work you've put in! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this rewrite, I've read and I have some small ideas that could improve the readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like the overall direction this is going in @cakegod!
A couple of suggestions and considerations below, as well as some small fixes.
Co-authored-by: MaoShizhong <[email protected]>
Co-authored-by: MaoShizhong <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some additional comments below. Some are nits/things I wouldn't block over so lemme know if you have thoughts on them.
1. Plan or pseudocode your solution. | ||
1. Write the code. | ||
1. Test your code to make sure it works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is meant to echo the problem solving lesson, we probably want these items to be about understanding the problem, planning, writing pseudo code, and then dividing and conquering, no?
Maybe it's the wording leading into it, though. "Before you start this project" could maybe be removed, then just say, "For each step in this project, be sure to do the following:"
} | ||
1. Create a new function named `playGame`. | ||
1. Get the human player choice using the `prompt` method. Read this [MDN article about the prompt method](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt) learn more about it. | ||
1. Put the previous `playRound` function inside `playGame`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the intent with this line here that users should literally move their playRound declaration inside of playGame, or just that they should call playRound inside of playGame? The wording makes it sound like the former which we probably don't want users to do. We could honestly probably just remove this step since we're already telling users to call playRound 5x on the next line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This depends on where we want the user to declare the scores. If the scores are declared inside the playGame
, we won't be able to increment the scores inside the playRound
. We can use the return of playRound
to conditionally increment the winner's score variable declared in playGame
, but this makes the project much more complicated.
So, I thought about guiding the Oditinite to one of those two outcomes: https://gist.github.com/cakegod/2f5f63295ff606a1a729f67564cd7d43
Or we could keep the outcome return in playRound
, but it becomes more messy and complicated without loops: https://gist.github.com/cakegod/269810a537de15cc427a0b35f4b8c39f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be declaring the scores as global variables, though yeah as the project is currently written and remains written here the intent seems to be that playGame houses the scores.
If you feel having the playRound moved inside of playGame is the better option I'm good with that. Maybe just tweak the verbiage of this instruction to, "Move your playRound
function so that it's declared inside of the new playGame
function"
Co-authored-by: Eric Olkowski <[email protected]>
Co-authored-by: Eric Olkowski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more tweak below. Would you mind also looking at the two unresolved comments from me above?
Co-authored-by: Eric Olkowski <[email protected]>
@cakegod Mind fixing up the remaining HTML blank lines lint errors? You can ignore the "unchanged files with check annotations" thing, just annoying noise from Github's beta feature. Then once the blank line lint errors are gone, if @thatblindgeye doesn't have any further change requests, we could get this merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the above, looks good. Awesome job on this!
I am not sure if we want to include validation on the human player input, as it would require a loop or recursion. 🤔 |
I'd say no need for validation for that exact reason. |
Old review - maintainer busy, so has passed this PR to other maintainers to review and approve
Because
This PR
Issue
Closes #XXXXX
Additional Information
Pull Request Requirements
location of change: brief description of change
format, e.g.Intro to HTML and CSS lesson: Fix link text
Because
section summarizes the reason for this PRThis PR
section has a bullet point list describing the changes in this PRIssue
section