首页 > 其他分享 >Introduction to Systems Programming .

Introduction to Systems Programming .

时间:2024-12-10 20:32:51浏览次数:2  
标签:tiles zip Introduction user Programming game Systems your board

Introduction to Systems Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Assignment 2 Accompanying this assignment you will find an archive file gt2048.zip. The zip contains a directory gt2048,with a BlueJ Java project for the GT 2048 application.2048 is a puzzle game implemented originally as a web-based video game in 2014. The game has a 4 × 4 gridsliding board with numbered tiles, where tiles get combined according to user moves. The goal of the game isto combine tiles so as to reach a board configuration containing a tile with value 2048Initially, the board starts with only two tiles, placed in random positions, and containing each either 2 or 4. Theuser interacts with the game by moving in four possible directions (up, down, left or right). The user movementcauses the tiles to move as far as possible in the chosen direction, until reaching another tile, or the edge of theboard. When two tiles of the same number collide while moving, they will merge into a tile whose value is thesum of the two colliding tiles. After each movement, and only if the board has changed its configuration as aconsequence of the move, a new tile is randomly located at a free slot in the board, with either 2 or 4 (randomlychosen). When a board with no free slots where to placethe spawning tile is reached, the game ends. There aresome subtleties in the game playing too, such as a “merged tile” not being able to be combined with anothertile in the same movement, as well as in the order in which the merging occurs (tiles closer to the edge of theboard limiting the movement merge first).Project GT2048 is a text-based implementation of the 2048 game. It consists of four classes:

  • GT2048Cell: it is the simplest of the classes. It models a cell of the 2048 board, with all its possiblestates: “empty”, or containing a numeric value. The value of a non-empty cell must be a power of two,due to the rules of the game. This class is accompanied by a test suite, i.e., a class containing unit testsfor some of the methods of the GT2048Cell class.
  • GT2048Board: it models the board through a bi-dimensional array of cells, each cell being represented bya GT2048Cell object. It contains methods to initialize the game, react to user movements, etc.
  • GT2048InputReader: it implements the reading of input commands.
  • GT2048: the main class of the game. Its constructor creates the input reader object and game board, andenables initiating the game by calling method startGame().Your assignment consists of various tasks:
  1. Study the behavior of the game by interacting with it in https://play2048.co.
  2. Study the provided implementation (including the provided tests), so as to understand how the solutionis organized and partially implemented.
  1. Implement all the methods with missing implementations in class GT2048Board. These include all themethods that implement movements, as well as the ones that decide whether a given movement is possible.
  1. Create a test class for testing GT2048Board. Design and implement in the test class sufficient unit teststo thoroughly check the correct behavior of at least one movement method. Try to cover with your testsall the statements in the selected method (i.e., every statement in the method should be executed by at

east one test).If you find errors (bugs) in 代写Introduction to Systems Programming . the existing code (not your implementation, but the existing code), you mustfix them and provide unit tests that fail for the original buggy code, and pass with your fix. Your unittests should describe, in the comment, what the found bug was, and how was solved.6. The previous tasks should lead you to a fully functional implementation of the game. Identify at leastone design problem in the implementation (e.g., tight coupling, low cohesion, duplicate code). Textuallydescribe the problem, and a potential solution, at the bottom of the README file in the project.

  1. Make a copy of your solution to all tasks, and bundle it in a zip file, as version 1.zip, before continuingwith the following tasks.
  1. Extend your implementation with behavior that implements user login, and scores. Your implementationmust not modify neither GT2048Cell nor GT2048Board (i.e., these classes should be exactly the same thatyou bundled into version 1.zip. Your extension must implement the following behavior:
  • Ask the user to provide its username (no password) before starting the game.
  • Maintain, for each user, its corresponding highest score. The score of a finished game play is the sumof all the cells in the board; it is computed only for finished games (either reaching 2048 or not). Foreach user, we only maintain his/her highest score. When a user plays the game for the first time, itscore is created with zero at the start of the game; it is updated when the player finishes the game.
  • The application must allow players to play subsequent games without exiting, possibly changing thuser for each game play. When no game is being played, the application must allow one to print outhe scores of all players.To implement the above score related functionality, you may modify existing classes (except GT2048Cell

and GT2048Board), and add new classes. Your solution must not implement any persistence mechanism,i.e., when the application is terminated, all scores are lost.

Your assignment is to fulfill all the above tasks. You may decide to add auxiliary methods as private, or

implement the required functionalities within the provided method bodies. For the first part (until “version 1”of your game), you are not allowed to change the APIs of the classes, i.e., not change method names, numberof parameters or their types.You must submit the solution through moodle, as a zip archive containing the whole final project, as well asthe version 1 project, either in a separate zip, or as a zip inside the main submission archive. This assignmenmust be solved individually. The correctness of your solution is important, as so is the quality of the code(clarity, readability, structure, etc.). The quality of your design for the score functionality, including how theimplementation is organized and how you decide to representthe necessary information (what data structuresto use), will be important.

标签:tiles,zip,Introduction,user,Programming,game,Systems,your,board
From: https://www.cnblogs.com/CSE2425/p/18596860

相关文章

  • CS-UY 4563 - Introduction to Machine Learning
    FinalProjectCS-UY4563-IntroductiontoMachineLearningOverviewPartnerwithonestudentandselectamachinelearningproblemofyourchoice.Applythemachinelearningtechniquesyou’velearnedduringthecoursetoyourchosenproblem.Present......
  • CPT109 C Programming and Software
     CPT109CProgrammingandSoftwareEngineering1–GroupProject AssessmentObjectiveThisassessmentaimstoevaluatestudents’abilitytodevelopasignificantsoftwaresolutiontoarealworldproblembyworkingasamemberofateam.Yourteamwi......
  • CCIT4020 Introduction to Computer
     CCIT4020IntroductiontoComputerProgrammingAssignment3–SectionCGeneralguidelines:Useconciseanddirecttechniques/programcodeswelearninourcourse.Uselessorover-complicatedtechniques/programcodesmaybeignoredorpenalized.Stud......
  • 【论文精读】Multi-modal Knowledge Graphs for Recommender Systems
    【论文精读】Multi-modalKnowledgeGraphsforRecommenderSystems论文链接:Multi-modalknowledgegraphsforrecommendersystems年份:2020引用数:270+影响:首次将知识图谱用于多模态推荐目录【论文精读】Multi-modalKnowledgeGraphsforRecommenderSystems1.什么是......
  • CS-350 - Fundamentals of Computing Systems
    CS-350-FundamentalsofComputingSystemsHomeworkAssignment#8-BUILDDueonNovember14,2024—Latedeadline:November16,2024EoDat11:59pmProf.RenatoMancusoRenatoMancuso1CS-350-FundamentalsofComputingSystems::HomeworkAssignment#8......
  • Daiwa Securities Co. Ltd. Programming Contest 2024(AtCoder Beginner Contest 383)-C
    题目大意一个\(H\)行和\(W\)列的网格图。\((i,j)\)表示从上到下第\(i\)行和从左到下第\(j\)列的单元格。每个单元格用字符\(S_{i,j}\)表示。如果\(S_{i,j}\)为#,则该单元格有一个障碍物;如果\(S_{i,j}\)是.则该单元格是空的;如果\(S_{i,j}\)为H,则该单元网格图......
  • CodeBERT: A Pre-Trained Model for Programming and Natural Languages
    本次介绍的论文是《CodeBERT:APre-TrainedModelforProgrammingandNaturalLanguages》原文链接:http://www.semanticscholar.org/paper/0fe2636446cd686830da3d971b31a004d6094b3c源代码和数据集:GitHub-microsoft/CodeBERT:CodeBERT本篇论文主要是介绍了CodeBERT......
  • COMP42215 Introduction to Computer Science
    INTRODUCTIONTOCOMPUTERSCIENCE2024/2025MastersProgrammesCourseworkAdministrativeDetailsModule/LectureCourse:COMP42215IntroductiontoComputerScienceeadlineforsubmission:14:00Friday13thDecember2024Workreturned:WeekBeginning13th......
  • 4CCSAPPA Programming Practice and Applications
    4CCSAPPAProgrammingPracticeandApplicationsCoursework2:TheSquareInthisassignmentyoumustimplementatext-basedgamecalledTheSquare.Thegameisinspiredbythe1997,sci-fihorrormovie,Cube(Ihighlyrecommendit,ifyouhaven’tseenit).T......
  • ROP(Return Oriented Programming) 是一种控制流劫持攻击技术,攻击者通过利用已存在的程
    ROP(ReturnOrientedProgramming)是一种控制流劫持攻击技术,攻击者通过利用已存在的程序代码片段(通常是函数中的一小段指令),将这些片段连接起来,从而构造出恶意的控制流,绕过传统的防御机制如数据执行保护(DEP)或非可执行栈(NX)。ROP攻击通常与缓冲区溢出攻击结合使用,目的是执行攻击者......