oregon trail

The game will work as follows:

 The game will boot into a short “splash screen” asking for input to start, quit, or display
o Instructions will explain how to play the game
o Starting the game will display the viewport, and ask for the first input

 The user will begin to traverse the map to attempt to successfully cross the Oregon Trail

o The game will take input as “up/down/left/right” from the user to move to a new
square, or “exit” to allow the user to quit the game
 The viewport is displayed to the player along with his current food status and coordinates on
startup and after each action.
 Upon arriving on the square the user will encounter one of the following
o River – must be crossed/retreated from

 A river crossing will lose a constant amount of food (20)
o Wild animals – may hunt/retreat
 After an animal has been discovered, it will appear on the viewport until it is
 Retreating moves the player back to the previous square

 Hunting the animal will remove the animal from the viewport, and the player
moves into the new square
 Hunting an animal requires a variable amount of days to heal, which will cost
food, but food is also gained from the hunt. The following represents the total
food change:

 Grizzly: -10 food
 Boar: -5 food
 Elk: -0 food
 Hare: 5 food
o Disease – will take time to rest, costing food:

 Cold: -5 food
 Flu: -10 food
 Dysentery: -15 food
 Winning:
o The player wins the game if he successfully traverses the Oregon Trail
o This should display some sort of win screen which displays how much food the player
had remaining
o The screen should require an enter press to send the user back to the splash screen and
allow the user to start the game again
 Losing:
o The player loses the game if he runs out of food at any point
o This should display a lose screen, which requires an enter press to send the player back
to the splash screen, and allow the user to start the game again


The map will be read in from a file, which will be passed into the program using a command line
argument to the location of the file. (To run the program, you will execute something like “./hw3
inputFile.txt”) The map will be read into 2-dimensional linked list of nodes, from which you will be
deriving your viewport. Any changes made to the map (by hunting an animal) will be updated to the
array map. A sample input file has been given which defines N, M, amount of initial food, and the map
layout using the first letter of each danger as the marker (i.e. Grizzly is marked with G, Elk with E, River
with R, etc…). The map is surrounded by O’s, which is for an impassable ocean space. Anything beyond
the map is more ocean.
Your viewport (MxM as defined in input file, M must be an ODD number) can be thought of as a mini map, or what the player can currently see. All squares except ocean, river, your starting point, and the
end point are initially marked as undiscovered.Your viewport should reflect this by displaying a ‘U’ in
that square. You will print the viewport after each action. Discovered squares will display the threat that
is in the square. The viewport will be an MxM 2-dimensional linked list. The viewport will be constructed by copying each
node from the original map into dynamic memory. Each node will only write back to the map whenever
the player will be moving to where that node is no longer displayed. At that point, the node will copy its
changed contents back to the map, and then free itself from memory.
If they viewport is large enough to see beyond the limits of the map, those squares should be filled with
a temporary ocean node which will not be written back to the map.
A node will be a struct object which contains the following variables:
Threat: A union which contains either a disease or an animal.
ThreatType: An enum which contains either “DISEASE” or “ANIMAL”
XLocation : An integer of the x location in the map

YLocation: An integer of the y location in the map
Discovered: A Boolean value as to whether or not the node has been discovered
Node*Up, *Down, *Left, *Right: 4 pointers to the nodes to the top, left, right, and below the node