Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

it is c program please help me as soon as possible Cs 1412, Programming Principles I, Spring 2019 bipana.thapaliya@ttu.edu LAB 4: IN-CLASS ASSIGNMENT Names: You

image text in transcribed

image text in transcribed

it is c program please help me as soon as possible

Cs 1412, Programming Principles I, Spring 2019 bipana.thapaliya@ttu.edu LAB 4: IN-CLASS ASSIGNMENT Names: You must demo your work during your lab session and before exiting the lab NOTE: Lab 4 covers Chapter 5 of Hanly and Koffman. Nothing should be open on the computer, but the C programming IDE, the BlackBoard web interface, an electronic version of the book, the book's PPT (PowerPoint) slides (if posted), and the lecture's program examples. Please put cell phones, other classwork, and music players away. This assignment is of 5 points. Nim is a strategy game between two players. 1. 2. 3. 4, 5. Start by placing counters (coins or toothpicks or something) into 3 piles. Player #1 picks a pile, then removes one or more counters from that pile (it's okay to take the whole pile.) Player #2 picks a pile, then removes one or more counters from that pile Player #1 plays again. (it's okay to choose a different pile this time ) Whichever player is farced to take the last counter is the LOSER. Please draw the flow chart and write down the complete flow of the program's logic that allows players to play Nim against each other. As you make flow chart and write the flow, show to the course instructor Name the file lab4_ 1412_501/503_lastname_firstname_lastname_firstname.c For this one, no need to worry about detecting cheating. Grading rubric would remain same as previous labs. two human Here is an example to make you easier to understand the problem with starting piles of 3, 4, and 5 counters. Player 1, enter your name: Alice Player 2, enter your name: Bob A: 3 8:4 Alice, choose a pile: A How many to remove from pile A: 2 A:1 B:4 Bob, choose a pile: C How many to remove from pile C: 3 A:1 B:4 C:5 C:5 Alice, choose a pile: B How many to remove from pile B: 1 A: 1 B:3 C:2 Bob, choose a pile: B How many to remove from pile B: 1 A:1 B:2 Alice, choose a pile: A C:2 How many to remove from pile A: 1 A: 0 Bob, choose a pile: B How many to remove from pile B: 1 A:0 B:1 C: 2 Alice, choose a pile: C How many to remove from pile C: 2 A: 0 B:1 C:O Bob, choose a pile: B How many to remove from pile B: 1 A:0 B:0 C:0 Alice, there are no counters left, so you WIN

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions

Question

Understand why customers are loyal to a particular service firm.

Answered: 1 week ago