首页 > 其他分享 >Text Based Game

Text Based Game

时间:2024-12-11 18:43:22浏览次数:4  
标签:code Based Text game uob Game classes org your

Assignment 2 – Text Based Game

For each class refer to its corresponding test to verify field and method naminconventions.

  1. Although there are many ways to construct an application, you are required tadhere to the rules stipulated below (to achieve marks).
  1. If variable names are not stipulated, you can use your own names for variables.his shows that you have written the application (we will check for plagiarism).
  1. For Assignment 2 you MAY import additional Java packages in your project, butonly those that are part of the standard Java library (e.g., java.util, java.io, etc.).Using third-party libraries or packages not included with the standard JDK isNOT permitted.
  1. Do NOT change or modify files included in the "test", "lib" or "out" folders.
  2. Do NOT modify the template code. However, you are allowed to create your owmethods or classes if they are needed.
  1. You MUST complete this assignment independently – Do NOT discuss or shareyour code with others, and Do NOT use ChatGPT! Any cheating behaviour willresult in a zero score for this module and will be subject to punishment by thUniversity.It is *STRONGLY ADVISED AGAINST* utilizing any translation software (suchasGoogle Translate) for the translation of this document.The jUnit tests included in the skeleton code are basic and only scratch the surfacein evaluating your code. Passing these tests does not guarantee a full mark.Wrong filestructure leads to a substantial penalty. Make sure you have followedMake sure you have pushed the version of your code that you want marked togitlab.
  1. Make sure you keep your video recording to the time limit. Any videos longerthat 7 minutes will be penalised and videos over 10 minutes will receive zero. DONOT compress your video in SIZE or TIME.
  1. Late submissions are accepted only for 24 hours after the deadline and are penalised at 5% of the final assessment mark.3IMPORTANT READ THIS FIRST:

1 Process For Assignment 2 Make sure you follow the process as outlined below. Assignment 2 has a differentstructure and a somewhat different approach to Assignment 1:Clone the repo for assignment 2. (If you haven’t yet accessed gitlab.cs.bham.ac.ukdo so ASAP.)

  1. Download and unzip the docs.zip JavaDoc file to your own device. In the rootfolder open the IndexAll.html file. Read through all the package, class, methodand field definitions and descriptions.Complete each class in the src folder as defined in the docs.
  1. The suggested order for completing classes is:(a) All classes in org.uob.a2.gameobjects.

(b) All classes in org.uob.a2.commands.(c) All classes in org.uob.a2.parser.(d) All classes in org.uob.a2.utils.(e) The Game.java class.For each class(a) Complete the required code (methods and attributes).

(b) Run your code using the run.sh command, ensuring it compiles withouterrors.

(c) Test your code using the test.sh command. You will have errors at firstbut they should hopefully decrease as you progress.

(d) git add, git commit, and git push your code.

  1. Keeping testing after each class is implemented until everything is working.
  2. Add the required new features:

(a) Display a map.(b) Adding a score. You can decide on the rules for how the scoring works butyou need to clearly explain it in the video and game.c) Combining items.

42 Introduction

In this assignment, you are tasked with updating the Zork style text based game fromAssignment 1(https://en.wikipedia.org/wiki/Zork). Please note that it is likely that youwill need to start from scratch due to the redesign of the game, but you ARE allowed toreuse your story and and puzzles from Assignment 1.The game is played by the user entering in various commands (e.g. "move south",代写Text Based Game "look room", "get key", "use key on chest"), to which the game responds with text basedoutput (e.g. "You pick up the rusty key").

3 Mark allocations

You will receive marks based on two aspects of the game: Firstly, the results of running the test.sh command. We will run our own version of these tests once you havesubmitted. This command will test each class and method (detailed as in the provideddocs.zip and in Tasks 1 - 6). You need to implement all the classes and methods asdescribed in the docs as well as any required for your new features.Secondly, you will need to submit a screen recording showing you playing the gamend discussing the code. Your screen recording needs to have the following:Show yourface and your student card.Play through the game once showing all the rooms, puzzles and an example ofeach of the expected commands.

  • Show and briefly explain the code in your Game.java file.
  • Show and briefly explain your required new features.
  • Show and briefly explain anything else that you did beyond the normal scope ofthe assignment. This includes any additional features you’ve added.The screen recording must be shorter than 7 minutes. You can use a text-to-speech

app if you do not want to record your own voice.

3.1 Minimum expected commands

The following is a complete list of commands the game must be able to parse (valuesin angle brackets refer to arguments given to a command, the pipe symbol referstodifferent options):move <exit name>: Move to a different location as defined by an exit’s name(e.g., ’move north’).

  • look <room|exit|features>|<item name>|<equipment name>|<featurename>: Look around the current room, at an exit, at a feature, or, at a specific item,equipemnt or feature.5• get <item name|equipment name>: Pick up an item orequipment from thecurrent room (e.g., ’get key’).drop <item name|equipment name>: Drop an item or equipment from yourinventory (e.g., ’drop key’).
  • use <equipment name> on|with <feature|item>: Use an item in your inventory on its own, or on a feature or item (e.g., ’use lamp’ or ’use key on chest’)status <inventory|player|item name|equipment name|map|score>: Checkyour current status, or inventory; or get more information about a specific item orequipmentin your inventory.(e.g. ’status player’, ’status inventory’, ’status key).Also able to display the map and your score.
  • help <topic>: Display this help information or get help on a specific topic (e.g.,help move’ or ’help’).ombine <item1> and <item2>: Combine two items into a new item or equipment. (e.g., ’combine stick and rock’ or ’combine egg andlour’).
  • quit: Exit the game.NOTE: Some of these commands are not included in the template code and need to be added i.e. combine, status map, status score

3.2 Minimum game requirements The following are the minimum requirements for the game. You are welcome to addmore if you want to:

  • At least ten (10) unique rooms or areas.
  • At least two (2) features/chests.
  • At least four (4) items.
  • At least two (2) pieces of equipment.

64 Full class hierarchy org.uob.a2

- Gameorg.uob.a2.commands Command (abstract)-

5 Task 1 - org.uob.a2.gameobjectsThese classes represent all the game objects (i.e. Map, Item etc.) that will be used inthe game. The GameState class contains the current state of the game. The Containerclass represents anything that can "contain" another object. This is implemented asanother hidden equipment or item in the room which is then revealed when the containeris "opened". Usable is an interface that makes GameObjects usable by enforcing access7to a GameObjects UseInformation attribute.

6 Task 2 - org.uob.a2.commandsThese classes represent all the commands that the player can execute in the game andthat are generated from the parser package. Commands work on the object name, notthe id. This package also includes an enum of all CommandTypes and an Exception.

7 Task 3 - org.uob.a2.parser

These classes convert the player’s text into into Commands that can be executed by thegame. It firstly sanitises the players input to get it into a correct format. Then it convertit into Tokens using the tokenise method and finally it parses these Tokens use the parsemethod.

8 Task 4 - org.uob.a2.utils

These classes read in a text file (as stored in the data directory) into a GameStateObject.An example of the file is shown below and also included in the data directory:player:pietermap:m1room:r1,test room,This is a test room for testing. It is bland.,false,

 

标签:code,Based,Text,game,uob,Game,classes,org,your
From: https://www.cnblogs.com/CSE2425/p/18598983

相关文章

  • RTSP播放器EasyPlayer.js报错“Too many active WebGL contexts” 是什么原因?
    随着互联网技术的飞速发展,流媒体视频已成为信息传播和娱乐消费的重要形式。无论是在线视频平台、社交媒体还是在线教育,流媒体视频的应用无处不在。而在这一生态系统中,开发者选择什么样的播放器进行集成和开发,也是至关重要的。随着技术的发展,越来越多的H5流媒体播放器开始支持H.26......
  • ChatGPT回答:机器学习中的 energy-based model 是什么?
    机器学习中的energy-basedmodel是什么?低能量对应高概率,高能量对应低概率。......
  • textillate-jQuery和css3文字动画特效库
    textillate.js是一款效果炫酷的jQuery和css3文字动画特效库插件。它通过结合其它一些动画库来制作各种CSS3文字动画特效。在线演示下载 如何使用基本的html结构如下:<h1class="tlt">MyTitle</h1>在页面的头部引入jQuery和jquery.textillate.js文件。......
  • 【android】如何在Android head中获取Android.Content.Context对象
    在Android头部中获取Android.Content.Context对象,可以通过以下方法实现:通过Activity的getContext()方法获取Context对象:通过Activity的getContext()方法获取Context对象:通过View的getContext()方法获取Context对象:通过View的getContext()方法获取Context对象:通过Application......
  • 【源码】Sharding-JDBC源码分析之SQL中读写分离动态策略、数据库发现规则及DatabaseDi
     Sharding-JDBC系列1、Sharding-JDBC分库分表的基本使用2、Sharding-JDBC分库分表之SpringBoot分片策略3、Sharding-JDBC分库分表之SpringBoot主从配置4、SpringBoot集成Sharding-JDBC-5.3.0分库分表5、SpringBoot集成Sharding-JDBC-5.3.0实现按月动态建表分表6、【源码......
  • 昇腾920B2成功运行bge-large-zh-v1.5后(text embeddings inference方式,也被称为TEI),如何
    文章目录引言什么是bge-large-zh-v1.5?在昇腾920B2上运行bge-large-zh-v1.5编写fastapi服务,将TEI转化成兼容OpenAI的方式将模型注册到dify结论引言在上一篇中,我们抱着侥幸的,试一试的心态,竟然真的用昇腾显卡跑通了用于embedding的bge-large-zh-v1.5......
  • MCP(Model Context Protocol)模型上下文协议 实战篇
    2024年11月底,Anthropic公司发布了全新的MCP(ModelContextProtocol)协议,即模型上下文协议。该协议作为一种开放标准,旨在实现大型语言模型(LLM)应用程序与外部数据源和工具之间的无缝集成。无论是在开发AI驱动的集成开发环境(IDE)、增强聊天界面,还是创建自定义AI工作流程,MCP都提供了......
  • 从代码解析Spotting LLMs With Binoculars: Zero-Shot Detection of Machine-Generate
    本文是对一篇ICML2024文章SpottingLLMsWithBinoculars:Zero-ShotDetectionofMachine-GeneratedText进行计算过程的讲解该文章主要提供了一种zero-shot的AIGC文本检测方法,在文章中所说,使用较少的计算量就起到了不错的效果主要计算过程如下图所示:perplexityperp......
  • Improved LiDAR Localization Method for Mobile Robots Based on Multi-Sensing
    ImprovedLiDARLocalizationMethodforMobileRobotsBasedonMulti-Sensing哈尔滨工业大学机电工程系机器人与系统国家重点实验室,哈尔滨150001*通讯地址:21b908026@stu.hit.edu.cn刘艳杰、王超*、吴恒、魏彦龙、任美轩、赵长森MDPIRemotesensing摘要:本文通过......
  • Model MIP Puzzle Game
    Theaimofthispracticalistomodelapuzzlegamecalled‘Stitch’asaMIPproblem,usingthelinprogfunctioninscipy.WewillthenextendourMIPmodeltoproducenew‘Stitch’puzzles.Youwillalsoprovideareport,intendedtobereadbyanon-spe......