You are asked to implement scissors-rock-paper game where the players are a computer and a user. The player that wins 3 hands You are asked to implement scissors-rock-paper game where the players are a computer and a user. The player that wins 3 hands successively is the winner of the game. Your program should prompt the user with a message at the beginning of each hand to enter one of scissors, rock or paper. If the user’s entry is not valid, i.e. entry is neither scissors, rock, nor paper, your program throws a message to the user to enter a valid entry and waits for that to happen Computer randomly chooses among scissors, rock or paper at each hand Scissors beats paper. Rock defeats scissors and paper whips rock Hint: it is highly recommended to have a modular implementation. Write a function which accepts two arguments one for computer’s choice and the other for the user’s pick and returns whether computer is winner of the hand or the user. You may also write two functions where one maps scissors, rock or paper to 3 positive integers with respect to an order and the other maps the other way around It is not necessary to follow the approach stated in the hint.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *