Question: As a second step towards the games solution, you will make the computer select a hand sign and log the results on the console. After

As a second step towards the games solution, you will make the computer select a hand sign and log the results on the console. After you click a button, the program generates a random number from 0 to 2, representing the hand sign the computer has selected. The program logs the human and computer choices on the console and who wins. Fig. 2 shows a Using Javascript on the web page that illustrates this behavior. Extend the function play to call the function randomSelection( ); this function returns a string representing the hand sign name (i.e., paper, rock, or scissors.) After selecting the computers hand sign, play must call the function whoWins(human, computer); this function takes as arguments two strings that represent the hand signs chosen by the human and computer, respectively, and returns the identifier of the winner. whoWins returns human, computer, or draw. whoWins must call the Boolean function beats(A, B), where A and B are selections (i.e., paper, rock, or scissors.) beats(A, B), returns true if A beats B, and false otherwise. create and modify the file buttons.html if needed and save the new version as computer-plays.html. Extend the style file rps.css as needed. Save all the functions in the files rps-cp.js. As a second step towards the games solution, you will make the

No Issues

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!