COMP1000 - Design, Code and Test a Program - Code Design - Report Writing - IT Assignment Help

Download Solution Order New Solution
Assignment Task

 

Your task for this assignment is to design, code (in C89 version of C) and test a program. In summary, your program will:

• Read the parameters from command line and utilize them for the game configuration.
• Able to create dynamically-allocated 2D char array to make a simple ASCII-based game.
• Receive user input to control the flow of the game.
• Write a suitable makefile. Without the makefile, we will assume it cannot be compiled.

 

Code Design
You must comment your code sufficiently in a way that we understand the overall design of your program. Remember that you cannot use “//” to comment since it is C99-specific syntax. You can only use “/*.........*/” syntax. Your code should be structured in a way that each file has a clear scope and goal. For example, “main.c” should only contain a main function, “map.c” should contain functions that handle and draw the map, and so on. Basically, functions should be located on reasonably appropriate files and you will link them when you write the makefile. DO NOT put everything together into one single source code file. Make sure you use the header files and header guard correctly. Make sure you free all the memories allocated by the malloc() function. Use valgrind to detect any memory leak and fix them. Memory leaks might not break your program, but penalty will still be applied if there is any. Please be aware of our coding standard (can be found on Blackboard under “Resources”) Violation of the coding standard will result in penalty on the assignment. Keep in mind that it is possible to fail the assignment with a fully-working program that is written messily, has no clear structure, full of memory leaks, and violates many of the coding standards. The purpose of this unit is to teach you a good habit of programming.

 

Task Details
Quick Preview
First of all, please watch the supplementary videos on the Assignment link on Blackboard. These videos demonstrates what we expect your program should do. You will implement a simple game inspired from a classical puzzle game “Laser Tank”. Further details on the specification will be explained on the oncoming sections.

 

Command Line Arguments
Please ensure that the executable is called “laserTank”. Your executable should accept eight (8) command-line parameters/arguments:
./laserTank <row_size> <col_size> <player_row> <player_col> <player_direction> <enemy_row>
<enemy_col> <enemy_direction>

• <row_size> and <col_size> determines the size of the playable map. The minimum and maximum value for <row_size> and <col_size> are 5 and 25 respectively. You need these numbers for dynamic memory allocations of 2D char array. (use malloc() function)

• <player_row> and <player_col> are the coordinates of the player tank. You can use these numbers as the array index of the map. Coordinate <0,0> is located at top left of the map.

• <player_direction> is the direction the player is facing upon starting the game. There are 4 choices: u, d, l, r, (lowercase letter) which is derived from the word up, down, left, right.

 

User Input
The user only need to type 1 character for each command (lower case). Here is the list of the possible commands:
• ‘w’ moves the player one block above. If the player tank is not facing upwards, this command will only cause the tank to face upwards.
• ‘s’ moves the player one block below. If the player tank is not facing downwards, this command will only cause the tank to face downwards.
• ‘a’ moves the player one block to the left. If the player tank is not facing leftwards, this command will only cause the tank to face leftwards.

 

Assumptions

For simplification purpose, these are assumptions you can use for this assignments:
• The coordinates of the player tank and enemy tank will not overlap from the provided command line arguments. But, you still need to check whether the coordinates are inside the map boundary.
• The coordinate of the tanks will not overlap with the border of the map as well.
• The player tank will NOT be in front of the enemy tank immediately upon starting the game. (NO instant lose)

 

 

This COMP1000 - IT Assignment has been solved by our IT Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.