Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// 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

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

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

=+16.9. 1 Suppose that u (f) Answered: 1 week ago

Answered: 1 week ago