” 写作CAB201留学生程序、 辅导programming程序、Java,c/c++Life – Part 1: Assignment SpecificationCAB201 Semester 2, 2020Last Updated: 04/09/2020Assigment DetailsThere is no intention to have This assignment specification change over time. However, if anything doeschange or additional detail is added to the specification, the table below will be updated to reflect thechanges.Version Date Description1.0 11/08/2020 Initial Specification1.1 13/08/2020 Added warning about external libraries to the Academic Integrity section1.2 17/08/2020 The minimum valid grid size has been increased to 41.3 04/09/2020 Added more test casesOverviewIn memoriam of the legendary mathematician John Conway, we will be be exploring one of his most famouscreations as an exercise in programming principles – the Game of Life. Also referred to as Life, the game isa zero-player game, meaning that its behaviour is determined by its initial state with no additional input.Conway explains the rules for the Game of Life in a Numberphile interview (explanation starts at 1:00). Therules will be described in detail further into the document.Your task is to create an command line application that can simulate Life. The application must be designedto be invoked from The command line, where game states and program settings can be provided. Additionally,the application must display a running animation of Life in a graphical display window (this functionalityhas been partially completed for you in the form of a small and simple API that you must utilize). Thisassignment is designed to test your ability to:Build command-line applicationsDevelop high-quality file I/O functionalityDesign a solution To a non-trivial computational problemUnderstand and utilize an external API 写作CAB201留学生作业、 辅导programming作业、Java,c/c++Game BehaviorThe game of life exists in universe comprised of a two-dimensional grid of square cells. The number of rowsand columns in the universe may be specified by command line arguments (see Command Line Interfacebelow). By default, the dimensions of the universe will be 16 16 (16 rows and 16 columns). Each cell canbe referred to by its row and column, starting in the bottom left with 0 for each dimension. An example ofa 5 5 Life universe is illustrated in Figure 1.Figure 1: A 5 5 Life universe. Row and column indices are labelled. All cells are dead (inactive)Each cell in the grid can exist in one of two states – dead or alive (also referred to as inactive and activerespectively). Each cell is aware of its eight closest neighbours during any generation of the life universe.These neighbours are the cells positioned horizontally, vertically and diagonally adjacent of any given cell.Figure 2: Visual representation of a neighbourhood in Life. The neighbours of the cell highlighted in blueare highlighted in light blue.Life progresses (or evolves) through a series of generations, with each generation depending on the one thatproceeded it. The rules that determine the next generation are rather simple and can be summarized by thefollowing:Any live cell with exactly 2 or 3 live neighbours survive (stay alive) in the next generation.Any dead cell with exactly 3 live neighbours resurrect (become alive) in the next generation.All other cells are dead in the next generation.Generation 4Figure 3: Generational Evolution of a glider. Note how the pattern repeats after 4 generations of evolution.An example of the effects of these rules is given in Figure 3, which contains five consecutive generations.To describe how one of the rules work with an example, from generations 0 to 1, cell (3, 1) is changed from2dead to alive because it has exactly 3 live neighbors in generation 0 (cells (2, 0), (2, 2), and (2, 3)). For thisassignment, life will continue to evolve for a pre-determined amount of generations (50 by default).SeedsThe first generation of the game is called the seed, which will be determined randomly, or through a formattedfile. The long term behaviour of the game is determined entirely by the seed, meaning that the future stateof any game is deterministic. This is one way you can determine whether your program is running correctlyand will be the basis for grading your assignment.RandomisationThe default method for generating a seed is through randomization. For each cell in the seed, the probabilityof the cell being alive is 50% and is otherwise assumed dead. The probability that any given cell is initiallyalive can be modified through command line arguments.FileAlternatively, the seed can be defined by a file that is supplied through the command line arguments. Ifa file is supplied in the command line arguments then the randomization process described above will notoccur. The seed files will have the extension of .seed and will be formatted according to the following rules:The first line of the file will always be #version=1.0.Each line of the file represents a cell that is initially alive (the rest are assumed dead).Each line will contain two integers, separated by a space character. The first integer represents the row index of the live cell. The second integer represents the column index of the live cell.Below is an example of a seed file that would result in the glider pattern shown in Figure 3 (Generation 0):Because the file And the universe size are specified independently, it is possible for a file to specify alive cellsthat exist outside the bounds of the universe. If this occurs, the user should be presented a warning and therecommend universe size that would suit the seed file (the maximum row and column indices). See detailedrequirements in Command Line Interface below.Periodic Boundary ConditionsPeriodic boundary conditions can be applied to a Life universe for some more interesting behaviour. Underperiodic boundary conditions, a cell that exists on the boundary of universe will have neighbours that wraparound to the other side of the universe.You will find it particularly useful to draw on your knowledge of integer arithmetic operators (such asmodulus) when attempting to implement this feature.This is best described visually, see Figure 4. Consider the last pair of examples in the figure. In thenon-periodic case, the the neighbouring cells that would exist if the universe was any larger ((5, 3), (5, 4),(5, 5), (3, 5) and (4, 5)) Are non-existent. In the periodic case…3The neighbouring cells that would normally be located at (5, 3) and (5, 4) are located at (0, 3) and(0, 4).The neighbouring cells that would normally be located at (3, 5) and (4, 5) are located at (3, 0) and(4, 0).The neighbouring cell that would normally be located at (5, 5) is located at (0, 0).PeriodicFigure 4: Examples of neighbouring cells in contrasting non-periodic and periodic boundary condition baseduniverses. The neighbours of the cell highlighted in blue are highlighted in light blue.Update RatesEven in the most inefficient implementations of Life, the computation time for a single generational evolutioncan be quite fast (for small universes). As such, it is often necessary to limit the number of generationalevolutions that can occur every second. This can be accomplished using a number of different differentmethods, two of which Are briefly described below:(Simple) Add a delay between each generational evolution by sleeping the main thread. Althoughsimple, this method can be inaccurate, particularly if your algorithm for evolving your universe is slow.(Accurate) Use a stopwatch or timer to delay the next evolution until the correct time has elapsed.Keep in mind that the time between updates can be found with the following formula (where T is the timebetween updates in seconds, and f is the update rate/frequency):You will not be required to write your own display component for this program. Instead it has been providedto you in the form of a library called Display. It is your task to integrate this library into your program. Theproject library is already contained within the assignment template provided on Blackboard. To interfacewith the display, you will need to use the Grid class. The classes in the library are well documented usingXML style comments, you are encouraged to read these comments to help you understand the code. Ensurethat you do not modify the code in this library so that the display works as intended.Command Line InterfaceMany modern software applications are controlled via graphical user interfaces (GUI), however command lineinterfaces (CLI) are Still frequently used by software developers and system administrators. The creationof GUIs are outside the scope of this unit (event driven programming is covered more in CAB302), soyour application must be created using a CLI instead. Depending on the application, CLIs have differentusages. This section will describe the general structure and usage of a CLI, and the specific usage that yourprograms CLI must follow. Failure to follow these CLI requirements precisely will mean thatyour program cannot be tested correctly and will likely result in severe academic penalty.4CLI Command StructureA lot of single purpose CLI programs follow the following structure: executable [arguments]The right angle bracket () indicates the beginning of the command line prompt, you do not type thisyourself. The executable is the name of the program. In this assignment, the program will be called life.More specifically, because we are creating a .NET Core application, the .dll file that is built for our programcan be executed on MacOS and Windows like so: dotnet life.dll [arguments]The [arguments] are a series of optional arguments for your program. These arguments will allow theprogram to run With a variety of different settings that differ from the defaults. Each of the option typearguments are described below.Rows and ColumnsThe number of rows and columns of the game board may be specified using the dimensions option. Theflag must be followed by two parameters, the first specifying the number of rows and the second specifyingthe number of columns.Defaults: The game board will have 16 rows and 16 columns.Validation: Both values must be provided and must be positive integers between 4 and 48 (inclusive).Usage: –dimensions rows columnsPeriodic BehaviourWhether the game board acts in a periodic manner (see Behaviour) may be specified using the –periodicoption. This flag should not be followed by any parameters.Defaults: The game board will not behave in a periodic manner.Validation: N/AUsage: –periodicRandom FactorThe probability of any cell to be initially active may be specified using the –random option. This flag shouldbe followed by a single parameter.Defaults: The probability will be 0.5 (50%).Validation: The Value must be a float between 0 and 1 (inclusive).Usage: –random probabilityInput FileThe path of the file representing the initial game state may be specified using the –seed options. This flagshould be followed by a single parameter.Defaults: No input file is used.5Validation: The value must be a valid absolute or relative file path. The value must be a valid filepath have the .seed file extension.Usage: –seed filenameGenerationsThe number of generations in the game may be specified using the –generations option. This flag shouldbe followed by a single parameter.Defaults: The game should run for 50 generations.Validation: The value must be a positive non-zero integer.Usage: –generations numberMaximum Update RateThe maximum number of generational updates per second (ups) may be specified using the –max-updateoption. This flag should be followed by a single parameter.Defaults: The maximum update rate is 5 updates per second.Validation: The value must be a float between 1 and 30 (inclusive).Usage: –max-update upsStep ModeWhether the Program will wait for the user to press the space-bar key to progress to the next generation,may be specified using the –step option.Defaults: The program will not run in step modeValidation: N/AUsage: –stepValidationEach of the command line arguments that can be provided to the program have the potential to modify thebehaviour of the program. The program must check to see if each of the arguments are valid in accordancewith the descriptions above. If the arguments for a particular category happen to be invalid, your programshould revert to the defaults for that category and continue to run your program. The user should be issueda warning with a brief Description of the problem.Test CasesTo ensure your program is working as intended you should test it thoroughly. Appendix A contains a seriesof test cases for your program. It is imperative that you test your program using these test cases beforesubmission as your program will be marked using similar test cases. However, that does not mean you shouldnot limit yourself to the test cases presented here.6Each test case has a link to a video that shows the intended behaviour of each test case. Note that fortest cases that involve a random seed, you will not be able to exactly replicate the video demonstration, butit will give you an expectation on the type of behaviour.Program FlowYour program should Follow the following program flow:1. The program displays the success or failure of interpreting the command line arguments in the consolewindow.2. The program displays the runtime settings based on a combination of command line arguments anddefaults.3. The program waits until the user presses the space-bar key to begin.4. The Life simulation is run using the runtime settings. If step mode is active, the program must waituntil the user presses the space-bar key before showing the next generation.5. Once the simulation is complete, the program must wait until the user presses the space-bar key toclear the screen and end the program.DeliverablesFor this assignment, You are required to submit a zip file via Blackboard containing the following items: The solution folder (containing your whole solution and its projects). A brief user manual (in the form of a README.md). A self-filled CRA and statement of completeness.A submission template has been provided on Blackboard that you should download and use for your submission.Do not submit just the .cs files. Do not submit just the .sln file. You must submit thefolder which contains the .sln file and all folders and files contained within.If you are unsure how to submit your assignment correctly, please seek advice from your tutor. Be suretest by zipping your folder, moving it to a lab computer or virtual machine, and unzipping. Ensure that youcan open your solution via the .sln file and that your solution builds and runs as expected.Below is a description of each of the non-code items required for submission. You will be awarded points forcompleting each of the following items in full, make sure you complete and submit both to maximize yourgrade.1. User Manual: Briefly explain How to build and run the Release version of your program usingVisual Studio. Describe the location of your executable and how it should be run with command linearguments (adhering to the command line argument guidelines detailed in this specification). Thisneeds to be formatted using Markdown formatting which you can read more about here.2. CRA and Statement of Completeness: This document acts as a declaration of your work andprogress on the assignment. The process of filling out this document will ensure that you full understandthe task and its markable requirements. You must fill this document honestly (dont give yourself fullmarks unless you really believe you have aced the assignment), it exists purely for your own benefit.7Getting StartedTackling a large project such as this assignment may initially seem daunting. However, breaking it downinto smaller tasks that can be implemented and tested will make the task much more manageable. This isa crucial skill for professional practice.This assignment specification is being released before you get to any OOP related topics. As such, youmay find it difficult to start Implementing any classes for a couple of weeks. As you have been exposed toa significant amount of I/O, begin with the design and functionality of the command line arguments, andmove on from there as you are introduced to new topics.Make sure that you keep the CAB201 C# Programming Style Guide document on Blackboard handy whilecompleting this assignment. It is important that your maintain well documented and formatted code fromthe very beginning.This specification will be uploaded alongside a video demonstration of the completed program. You shouldwatch this video before getting started to help you understand how your program should function or howLife works.Submission InstructionsPlease follow the instruction details detailed below:1. Test your program on the practical lab computers or on the QUT VMs to ensure that your code worksas intended on a standard machine. Code that does not compile or run will not receive anymarks.2. Arrange your deliverables in a zip folder labelled CAB201_2020S2_ProjectPartA_nXXXXXXXX where thelast part is replaced with your student ID. Your archive must have a .zip extension.3. Submit a preliminary version of your assignment at least once before the progress submission due date.This progress submission does not need to be a completed version of your assignment, but you musthave made some quantifiable Progress. There are grades allocated for the progress submission.4. Submit the final version of your assignment before the final submission due date. The code in yourfinal submission will be the only thing marked directly.Academic IntegrityAll submissions for this assignment will be analysed by the MoSS (Measure of Software Similarity) plagiarismdetection system ( https://theory.stanford.edu/~aiken/moss/). Serious violations of the universityspolicies regarding plagiarism will be forwarded to the SEFs Academic Misconduct Committee for formalprosecution. As per QUT rules, you are not permitted to copy or share solutions to individual assessmentitems. In serious plagiarism cases SEFs Academic Misconduct Committee prosecutes both the copier andthe original author equally.It is your responsibility to keep your solution secure. In particular, you must not make your solutionvisible online via cloud-based code development platforms such as GitHub. If you wishto use such a resource, do So only if you are certain you have a private repository that cannot be seen byanyone else. However, it is recommended to keep your work well away from both the Internet and yourfellow students to avoid being prosecuted for plagiarism.Please note that using external libraries for this project will result in academic penalty, youmust only use code within the standard .NET API (3.1). You may use any class in the Systemnamespace (do not use the Microsoft namespace).如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。