Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVASCRIPT Simple Rock/Paper/Scissors. Use the prompt box to ask the user, Pick 0 for Rock, 1 for Paper, or 2 for Scissors (youll have to

JAVASCRIPT

Simple Rock/Paper/Scissors. Use the prompt box to ask the user, Pick 0 for Rock, 1 for Paper, or 2 for Scissors (youll have to use ParseInt on this one). Then generate a random number between 0 and 3 (remember, when we generate a random number it goes up to but not including 3). Okay, heres the part I always get confused. Rock (0) beats Scissors (2), paper(1) beats rock (0), and scissors(2) beats paper(1). So you must write out who won by checking your answer against the computers randomly generated answer, e.g., (&& means and) if ((myanswer == 0) && (randnum == 1) ) { document.write(

Sorry, the computer won.

) }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Marketing Database Analytics

Authors: Andrew D. Banasiewicz

1st Edition

0415657881, 978-0415657884

More Books

Students also viewed these Databases questions