COMP1000 UNIX and C Programming Assignment

Assignment Help Programming Languages
Reference no: EM132495614

COMP1000 UNIX and C Programming Assignment - Curtin University, Australia

1. Introduction -

Your task for this assignment is to design, code (in C89), test and debug a modified battleships game.

In short, your assignment will:

Extract the game settings and values needed from a file

Interface with the user via a Terminal based menu

Play an adapted game of battleships (single player)

Be able to do conditional compilation

Generate new input files.

2. Code Design

You must thoroughly document your code using C comments (/* ... */). For each function you define and each datatype you declare (e.g. using struct or typedef), place a comment immediately above it explaining its purpose, how it works, and how it relates to other functions and types. Collectively, these comments should explain your design.

Your code should also be separated logically into multiple c and h files that overall have a single purpose. Marks will be deducted if monolithic functions and/or files are used.

3. Task Details -

1. Input Files - Your program should accept two (2) command-line parameters that will be the filenames of the input files.

2. Menu - After the 2 input files have been read and appropriately stored in memory it is time to have a menu for the user. This menu is to have the following options initially and is to be controlled via integer input:

1 Play the Game

2 List all missiles

0 Exit

3. Playing the Game - Now that the files have been read its time to play the game. The game will consist of a number of rounds and will finish when there are either no missiles left or all ships have been destroyed. For each turn you must display the following:

The board showing all shots (hits and misses) made. (Similar to above)

The amount of missiles left (Not including the current one)

The name of the currently loaded missile (for example "v-line")

A prompt for the user to input the next coordinate to target

This part has many components and as such as been broken down to make it simplier.

4. Add Some Colour - To make the board look nicer were going to print the tiles in different colours depending on what their status is.

5. Remove Some Colour (Conditional Compilation 1) - Now that we have colour lets create a way to disable it.

Your goal is to add a condition compilation called "MONO" that when compiled with your program no longer prints any colours.

6. Find Your Ships (Conditional Compilation 2) - Lets add another conditional compilation to help us find our ships.

Add another conditional compilation called "DEBUG". With this one defined your board is to now print the '#' in a magenta colour if a ship is there and hasnt been shot yet.

7. Need Help - So by now you should be able to shoot missiles at the board and the tiles will change character and colour depending on what was there. However what if a player didnt know how to play the game.

The challenge with this part is to allow the user to type in "help" when they are prompted to enter a coordinate to shoot at. When entered you are to print a description of what that missile does. Remember though that you cant do any checks outside of FileIO on which missile it is.

8. Creating Files - Add another 2 options to your Menu

3 Create Board File

4 Create Missile File

The goal of these options is to allow the user to create new input files for the program. As such they must save to the same format as above. These functions should ask the user for all the required information and save them in a file that is named by the user.

How you decide to setup these function and get user input is completely up to you. And to test that your function works, just use the newly created file as the next input file.

4. Report -

You must prepare a report that outlines your design and testing. Specifically:

1. For each file that you have, write a paragraph explaining the overall purpose of it. (Hint: If you cant explain in 1 simple paragraph then its doing to much)

2. Describe (in 1-2 paragraphs) how you implement the storing and using of the ships on the board and the board. Talk about any complications that you can into while designing this component.

3. Demonstrate that your program works and how to use it (only need to show valid input files), including:

The contents of the input files

The command-line used to execute your program

The output of the board as shown on the screen

The input the user uses to interact with the menu.

The input the user used to play the game.

Your report should be professionally presented, with appropriate headings, page numbers and a contents page. You will loose marks for poorly written/badly formatted reports!

Attachment:- UNIX and C Programming Assignment File.rar

Reference no: EM132495614

Questions Cloud

How the mortgage will be reported on the july : Which of the following best represents how the mortgage will be reported on the July 31, 2020 statement of financial position?
Develop appropriate null and alternative hypotheses : Develop appropriate null and alternative hypotheses such that rejection of H0 will support Dr. Smith's argument.
Compute the cash proceeds from bond issues : Compute the cash proceeds from bond issues under the following terms. For each case, indicate whether the bonds Cash proceeds vs Discount or premium
What is the fabs dollar cash outflows : If the spot rate in 90 days is $0.84, what is the FAB's dollar cash outflows, assuming FAB wishes to minimize its cost (please round to a dollar)?
COMP1000 UNIX and C Programming Assignment : COMP1000 UNIX and C Programming Assignment Help and Solution - Curtin University, Australia. Design, code (in C89), test and debug a modified battleships game
COMP1000 UNIX & C Programming Assignment : COMP1000 UNIX & C Programming Assignment help and solution, Curtin University - assessment writing service - Write a C program to read a file and store
Record a lease amortization schedule for the lessor : Record the journal entries on Sahali Air's books to record the lease agreement, to reflect payments received under the lease, and to recognize income
Calculate the value to be assigned to the bonds : The bonds are quoted at 99 ex-rights, and the warrants are quoted at $5 each. Calculate the value to be assigned to the bonds and to the warrants
What kind of lease is to dufferin corp : What kind of lease is this to Dufferin Corp and why? Calculate the present value of the minimum lease payments over the life of the lease. Round to the nearest

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd