I'm taking an intro to computer science class. We have to write code for a 2 player game. This is the game: There are three stacks (A, B and C) of sticks on the table. Each stack is initialized with a random number of sticks between 3 and 10 (inclusive). Each player takes turns choosing a stack and taking a number of sticks form that stack. A player may take either ONE stick or TWO sticks from that (selected) stack. After a player has removed a number of sticks from a stack,
play is then passed to the other player. The game continues as long as there are sticks in any one of the stacks.The player who takes the last stick is the winner. Im having trouble starting the code. Could someone please guide on how to start? any help would be greatly appreciated.
Did your professor teach you pseudo code, flow charting, or grammars? Those are the tools programmers use to organize their thoughts about a problem BEFORE they set out to write the actual code.
You should first try to do the problem by hand, write out what you are doing in regular English, then translate the English into code.