Question
// CHALLENGE!!! // you never lose here because of a logical error! // do you know why? // // well you need to fix the
// CHALLENGE!!!
// you never lose here because of a logical error! // do you know why? // // well you need to fix the bug - so hopefully you do.
// logic: // the computer wins if it is one ahead of user in a 'circular' list // rock paper scissors // rock paper scissors // rock paper scissors
// replace the below "0" with conditional statement where the // computer wins. // // HINT: // to check whether the computer pick is clockwise // one unit 'ahead; of user pick, imagine // that the list is circular
if( 0 ) // computer wins, because it is clockwise one unit away // from what user selected.
{ printf( " %s (you) < %s (puter) You Lost " , users_pick_string, computers_pick_string ); } else if( computer_pick == user_pick ) { printf( " %s (you) = %s (puter) It's a TIE " , users_pick_string, computers_pick_string ); } else { printf( " %s (you) > %s (puter) You Won " , users_pick_string, computers_pick_string ); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started