Wolves and sheep: design a game

Assignment Help JAVA Programming
Reference no: EM13271

In this game, we have a number of players interacting in a simple way. The game takes place on a (virtual), two-dimensional piece of land. There are two types of player: Sheep, and Wolves. Sheep start at one point of the land, and they have to get to get to a green pasture to win. They move one step at a time. Usually, there are several sheep that start out at the same time. The more sheep get to the destination, the better. This diagram shows five sheep ("s") and the green pasture at the top:

758_Wolves and Sheep.png

Unfortunately, there is also a wolf. The wolf's objective is to find (and eat) as many sheep as possible. The wolf may be a little faster than the sheep, but it always needs a number of steps to finish eating one.Sheep and wolves are realized as separate Java classes. Each student will submit either a Sheep or a Wolf class. We're going to play a tournament: we're going to have an instance of each wolf and instances of four or five different sheep play the game and tally up the results.

Beware... the rules of the game are simple, but its dynamics can be very complex.

Example: Suppose we have 30 students (numbered 0..29) in this class. We will form 7 teams (A,B,C,D,E,F,G). Teams A,B,C,D will write the sheep - this means we'll have about 16 Sheep classes coming in. Teams E,F,G will write wolves - which makes another 14 Wolf classes.

In the tournament, we'll run many thousand games, each with one combination of the sheep classes from one of the four sheep teams, and exactly one wolf (out of 14) - that's 56 combinations. We need three rules of engagement to make this work.

Rule 1: You may not collaborate with other students outside of the team.

Rule 2: You should collaborate with the other students within your team. While everyone has to do their own implementation, you, for
example may collude to plot joint strategies against the wolf (if you're programming a sheep agent).

Rule 3: You must submit only your own code and may not write code for others. Small, shared functions that are marked as such are OK.

The playing field is a m by n rectangular grid with m*n cells. In each game, there are a number of players (several sheep players, and one wolf). Each player occupies exactly one cell in the grid, and no cell will contain more than one player (except a combination of the wolf and a sheep). Cells may also contain an obstacle, in which case no player can occupy the cell.

Players start at an assigned location. There are multiple steps (iterations): In each iteration, each sheep may move exactly one step to the left, the right, up, down, or diagonally, but not beyond the boundaries of the grid. In each iteration, the wolf may also move a constant k steps (k is to be determined by the game, and fixed throughout the tournament. All players will be told k). All players make one move at a time and see the updated positions. The wolf moves last. The player instance determines a move and communicates it as Δx and Δy (steps in each direction), where Δx and Δy are signed integers. For sheep, (Δx2 + Δy2) <= 2.0. For the wolf, (Δx2 + Δy2) < k2. For instance, if the wolf decides to move 2 steps to the left (Δx=-2) and 3 steps up (Δy=-3), then that would be a legal move if k is at least 2.9, because:

996_Wolves and Sheep1.png

If more than one sheep try to occupy the same cell, one of the sheep's moves fails and the sheep will not move. If the wolf and a sheep attempt to occupy the same location, the wolf begins to eat the sheep. A meal takes a number of steps f, during which the wolf will not move. The sheep perishes. Several green pastures ("goal cells") are determined by the game. Their location is known to all players. If a sheep reaches one these pastures, the sheep wins its game and disappears. The wolf cannot enter a pasture. The game terminates when all sheep have reached pastures or have been eaten, or after m+n steps, whichever comes first.

Parameters: The game parameters are available to the players upon instantiation:

1817_Wolves and Sheep2.png

Reference no: EM13271

Questions Cloud

Write a paper on boyle''s law : Write a paper on Boyle's law and describe Compression and Combustion stroke . Also explain Charles's law and illustrate SI engine and CI engine.
Research report on software design : Write a Research Report on software design and answer diffrent type of questions related to design. Report contain diffrent basic questions related to software design.
Managerial decision making : This assignment is based on Managerial Decision Making. Compare and contrast the theoretical and practical differences between "formal research" and "business proposals".
Paper on orthogonal frequency-division multiplexing : This document is shown a paper on Orthogonal frequency-division multiplexing with advantages, disadvantages and uses.
Wolves and sheep: design a game : This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.
Long term financial planning : This assignment is designed for analyze Long term financial planning begins with the sales forecast and the key input in the long term fincial planning.
Questions on ferris wheel : Prepare a Flexible Budget Gator Divers is a company that provides diving services such as underwater ship repairs to clients in the Tampa Bay area.
Write a paper on obesity : Write a paper about what normal operations of the system that has gone wrong with obesity. Then the effects of obesity and how does it cause the function of the human body to be abnormal.
Essay assignment: literary analysis with research : Essay Assignment: Literary Analysis with Research,  Your paper must demonstrate a clear thesis, unified paragraphs, and topic sentences that both describe and direct the paragraphs they head.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd