美文网首页
讲解:COMP517、LinkedList structure、

讲解:COMP517、LinkedList structure、

作者: hanguafang | 来源:发表于2019-12-29 13:03 被阅读0次

    COMP517 Assignment 10(Worth 25% of the module marks)In this exercise you are asked to add more features to the adventure game you have been workingon.Start by creating a Temple of Wishes, which is made up from a 6x6 matrix of chambers. Thepresence of doors in each chamber should be read in from a file. For each chamber, the file has arow of 4 numbers for each of the positions North, East, South and West, with 1 indicating a door and0 indicating no door. For example, if the file begins with:0 1 1 00 0 1 1…then the first chamber has doors in its east and south walls, and the second chamber has doors in itssouth and west walls. (NB. This needs to be consistent, so that each door connects two adjacentchambers. You may wish to draw a plan of your temple first!)Next, randomly scatter 18 items around the Temple, ensuring that each chamber does not containmore than one item. Each item has a name (String) and a value (int). The name should be read infrom your input file, and the value should be a random integer in the range 1-20.Your hero has a pouch that can be used to contain items. The pouch should be implemented using aJava LinkedList structure, with items always stored in ascending order of value (i.e. you should neverhave to call a sorting function).Each item is also guarded by a dragon (with a name, and firepower in the range 5-10). When youplace an item, you should also add a dragon to that chamber. (Ideally you should create thedragons using the shuffled pack of dragon cards from Assignment 6, although you could also createdragons randomly as in Assignment 2).In addition to collecting the items, your hero should fight the dragons. The outcome of a battle isdecided by firepower. If both firepowers are equal, the winner is decided at random. A loss for thehero causes his or her firepower to be decreased by 1 (down to a minimum of 5); a win causes it tobe increased by 1 (up to a max of 10). Note that the firepower of a dragon remains constant.The hero can also increase their firepower by resting for a turn. (Use of this would probably belimited in some way, but that is outside the scope of this partCOMP517留学生作业代做、LinkedList structure作业代写、Java程序语言作业调试、代写Java实icular assignment).Begin the game by dropping your hero into a random chamber. You then have the following singlelettercommands available to you:n, e, s, w : head north, east, south or west, assuming there is a door allowing itf : fight the dragon, if one is present in the chamberi : inventory – list all items in your backpackp : pick up itemr : rest (increases firepower by 1)The aim of the game is to defeat all the dragons and collect all the items.Good luck!MARKING CRITERIAProgram correctness and approach: 60%Documentation (commenting and report): 15%Program style (e.g. layout): 10%Testing: 15%SUBMISSIONAs usual, submit your program, test data and output electronically. Include a brief report to explainyour approach. The deadline for submission of your solution is 12 noon on Wednesday December11SAMPLE RUNStarting the game …You are in chamber (3, 5)There is a door going eastThere is a door going northThere is a red dragon here!There is a golden orb here (value 9)What would you like to do? fPreparing to fight . . .You have won the battle! Your firepower is now 8.What would you like to do? pOK. Item taken.What would you like to do? wYou can’t go that wayWhat would you like to do? nYou are in chamber (2,4)There is a door going eastThere is a door going southThere is a door going westThere is a green dragon here!There is a magic key here (value 10)What would you like to do? fPreparing to fight . . .Oh, dear! You have lost the battle! Your firepower is now 7. Come back when you are stronger.What would you like to do? eYou are in chamber (2, 5)There is a door going southThere is a door going westThere is a blue dragon here!There is a silver chalice here (value 6)What would you like to do? fPreparing to fight . . .You have won the battle! Your firepower is now 8.What would you like to do? pOK. Item taken.What would you like to do? iHere are the items in your pouch:1: silver chalice (value 6)2: golden orb (value 9)Total value of all items is 15What would you like to do?Etc.转自:http://www.daixie0.com/contents/9/4465.html

    相关文章

      网友评论

          本文标题:讲解:COMP517、LinkedList structure、

          本文链接:https://www.haomeiwen.com/subject/ryeyoctx.html