We’re going to make a simple implementation of grade-school classic "rock paper scissors". If you don’t know what that is check the wikipedia article or this ridiculous step-by-step. For the moment we’re just going to play the game from the browser console, but we will revisit it and add a front end later so don’t forget to keep the code on GitHub!
For most beginners (in programming), problem solving can be a challenging skill regardless of the programming concepts or commands you know. Staring at a blank screen and not knowing where to start is a pretty common situation for beginner programmers. In order to overcome this blocking situations, here are some helpful techniques:
Make sure you understand exactly the problem you are trying to solve. Explaining the problem to someone or even yourself can greatly improve your understanding. Drawing diagrams or writing the problem on paper also helps a lot.
Come up with a Plan before starting to code. What are the steps that you need to follow and implement? In what order? What technologies, algorithms or commands must you use for each step? How can one step affect subsequent steps?
- Get input from the user in form of two numbers
- Multiply the two numbers and store them in a variable
- Display the variable that contains the result in a modal box
- Divide and Conquer: split your problem into smaller, easier to solve problems. If you feel stuck, you can start from the easiest problem at hand. Avoid trying to solve the problem all at once. It’s always a good approach to break your problem down into smaller ones and reduce complexity.
Check the instructions here.
LOOKING FOR HELP?
When looking for help, try doing so in the following order:
- Did you try everything you could?
- Did you read the documentation?
- Did you Google for it?
- Did you post your question on Slack/Forum?
- Did you ask your fellow students for help?
- Did you ask your Mentors for help?
- Did you leave a comment on the comments section of this page?
- Did you ask your Instructor for help?
- [Added Problem Solving section]