{"id":59350,"date":"2021-10-14T00:30:08","date_gmt":"2021-10-14T00:30:08","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/10\/14\/oregon-trail\/"},"modified":"2021-10-14T00:30:08","modified_gmt":"2021-10-14T00:30:08","slug":"oregon-trail","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/10\/14\/oregon-trail\/","title":{"rendered":"oregon trail"},"content":{"rendered":"<p>The game will work as follows: <\/p>\n<p> \uf0b7 The game will boot into a short \u201csplash screen\u201d asking for input to start, quit, or display<br \/> instructions<br \/> o Instructions will explain how to play the game<br \/> o Starting the game will display the viewport, and ask for the first input <\/p>\n<p> \uf0b7 The user will begin to traverse the map to attempt to successfully cross the Oregon Trail <\/p>\n<p> o The game will take input as \u201cup\/down\/left\/right\u201d from the user to move to a new<br \/> square, or \u201cexit\u201d to allow the user to quit the game <br \/>\uf0b7 The viewport is displayed to the player along with his current food status and coordinates on<br \/> startup and after each action.<br \/> \uf0b7 Upon arriving on the square the user will encounter one of the following<br \/> o River \u2013 must be crossed\/retreated from <\/p>\n<p> \uf0a7 A river crossing will lose a constant amount of food (20) <br \/>o Wild animals \u2013 may hunt\/retreat <br \/>\uf0a7 After an animal has been discovered, it will appear on the viewport until it is<br \/> hunted <br \/>\uf0a7 Retreating moves the player back to the previous square <\/p>\n<p> \uf0a7 Hunting the animal will remove the animal from the viewport, and the player<br \/> moves into the new square <br \/>\uf0a7 Hunting an animal requires a variable amount of days to heal, which will cost<br \/> food, but food is also gained from the hunt. The following represents the total<br \/> food change: <\/p>\n<p> \uf0b7 Grizzly: -10 food <br \/>\uf0b7 Boar: -5 food <br \/>\uf0b7 Elk: -0 food <br \/>\uf0b7 Hare: 5 food <br \/>o Disease \u2013 will take time to rest, costing food: <\/p>\n<p> \uf0a7 Cold: -5 food <br \/>\uf0a7 Flu: -10 food <br \/>\uf0a7 Dysentery: -15 food <br \/>\uf0b7 Winning: <br \/>o The player wins the game if he successfully traverses the Oregon Trail<br \/> o This should display some sort of win screen which displays how much food the player<br \/> had remaining <br \/>o The screen should require an enter press to send the user back to the splash screen and<br \/> allow the user to start the game again <br \/>\uf0b7 Losing: <br \/>o The player loses the game if he runs out of food at any point <br \/>o This should display a lose screen, which requires an enter press to send the player back<br \/> to the splash screen, and allow the user to start the game again <\/p>\n<p> Implementation <\/p>\n<p> Map <br \/>The map will be read in from a file, which will be passed into the program using a command line<br \/> argument to the location of the file. (To run the program, you will execute something like \u201c.\/hw3<br \/> inputFile.txt\u201d) The map will be read into 2-dimensional linked list of nodes, from which you will be<br \/> deriving your viewport. Any changes made to the map (by hunting an animal) will be updated to the<br \/> array map. A sample input file has been given which defines N, M, amount of initial food, and the map<br \/> layout using the first letter of each danger as the marker (i.e. Grizzly is marked with G, Elk with E, River<br \/> with R, etc\u2026). The map is surrounded by O\u2019s, which is for an impassable ocean space. Anything beyond<br \/> the map is more ocean. <br \/>Viewport <br \/>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<br \/> end point are initially marked as undiscovered.Your viewport should reflect this by displaying a \u2018U\u2019 in<br \/> that square. You will print the viewport after each action. Discovered squares will display the threat that<br \/> is in the square. The viewport will be an MxM 2-dimensional linked list. The viewport will be constructed by copying each<br \/> node from the original map into dynamic memory. Each node will only write back to the map whenever<br \/> the player will be moving to where that node is no longer displayed. At that point, the node will copy its<br \/> changed contents back to the map, and then free itself from memory.<br \/> If they viewport is large enough to see beyond the limits of the map, those squares should be filled with<br \/> a temporary ocean node which will not be written back to the map. <br \/>Node <br \/>A node will be a struct object which contains the following variables: <br \/>Threat: A union which contains either a disease or an animal. <br \/>ThreatType: An enum which contains either \u201cDISEASE\u201d or \u201cANIMAL\u201d <br \/>XLocation : An integer of the x location in the map <\/p>\n<p> YLocation: An integer of the y location in the map <br \/>Discovered: A Boolean value as to whether or not the node has been discovered<br \/> Node*Up, *Down, *Left, *Right: 4 pointers to the nodes to the top, left, right, and below the node <\/p>\n","protected":false},"excerpt":{"rendered":"<p>The game will work as follows: \uf0b7 The game will boot into a short \u201csplash screen\u201d asking for input to start, quit, or display instructions o Instructions will explain how to play the game o Starting the game will display the viewport, and ask for the first input \uf0b7 The user will begin to traverse [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20],"class_list":["post-59350","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-programming"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/59350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=59350"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/59350\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=59350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=59350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=59350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}