3 Problem Description
Tigers & Goats is a simple game where one player controls 12 goats to trap 3 tigers to win i.e. the tigers are unable make a valid move. The second player controls tigers to make simple moves or to jump over a goat to eat it and reduce their numbers. Tigers win when the number of goats becomes less than 6, since this is the minimum number required to trap all tigers. However, as the number of goats reduce from 12, their chances of wining diminish rapidly. Figure 1 shows a snapshot of game play in stage 2. The circles represent goats and the squares represent tigers. One of the goats has been eaten and hence there are 11 goats. Goats and tigers can move to an adjacent location connected by a straight line (red or white,
colour is only for cosmetic reasons). Valid locations (where a goat or tiger can be placed) are the corners or intersection of lines.
A tiger can jump over a goat in a straight line to the next location and eat the goat in its way. The destination location must be vacant for this to happen. In Figure 1, tiger 1 can jump over the goat to its left as shown by the arrow. The goat in the way will be eaten and removed from the board. Tiger 2 is blocked. It can neither move nor jump over (eat) any goat since there is no destination location to the left, right or top and the bottom one is occupied by a goat. Goats can move to save themselves or their fellow goats by occupying a location. Tiger 3 can eat the goat on its right.
The game starts with an empty board. In the first phase, players place their pieces only. Player one (human) places 4 goats and then player two (computer) places 1 tiger. This process continues until 12 goats and 3 tigers have been placed on the board. Moving a piece is not allowed in this phase. In the second phase, pieces can be moved only and no more pieces can be added to the board. Players take one turn at a time from now on. Goats try to block the tigers and tigers try to avoid being blocked and eat goats. You are required to complete the Java classes so that a human player can play against the computer. The game should allow a human player to control the goats and should not allow the human to make an illegal move. The game should automatically control the tigers implementing a simple strategy to win. This is not that difficult since the computer controls more powerful pieces i.e. the tigers. All it has to do is to not miss any chance of eating a goat.
15 freelancers estão ofertando em média $418 nesse trabalho
Hi ! I have read all your description. I am professional Java developer. I am sure high quality, good communication. Please contact me and Let's go ahead ! Thanks.
Hello there, I read the description of your game, and it looks pretty simple to me, I can fix that up for you in a few days. Let me know if you need help. -Leo