(5/5)

CIS1500 ASSIGNMENT3 For any unclear requirements, please review the A3 solution program and post questions to the discussion boards.

INSTRUCTIONS TO CANDIDATES

CIS1500 ASSIGNMENT3

Due Date: Dec 3rd, 2021

Late period begins Dec 6th

Only for extreme medical conditions will submissions be accepted after Dec 8th.

Submission Details

Submit a single C file containing your program. To submit, upload your C file to the submission box for Assignment 3 on CourseLink. Name your file as lastnameFirstnameA3.c (For example, my information is James is the first name, and Fraser is the last name, the file would be called fraserJamesA3.c. The program you submit must compile with no warnings and run identically for full marks.

Requirements

For any unclear requirements, please review the A3 solution program and post questions to the discussion boards.

Program Description

For this assignment, you will be writing a game. The rules of the game are simple you have a game board with hidden tiles. You have to make three guesses if you pick all safe squares, you win, if you select a bad square, you lose. All game boards have are square, meaning both sides have the same length. The game board size will never be larger than 25 or below 1. The gameboard contains only 4 possible values (3 are requirements, the 4th is for bonus).

If the square contains a 'S' it is safe. Meaning you have successfully made one guess.

If the square contains a 'B' you lose. Meaning the game is over.

If the square contains a 'R' you must pick again, this guess doesn’t count towards your guesses.

If the square contains a 'C' it safely clears the area. (See bonus information in code)

A game board file has the format ( for a size of 3. )

3

SSS

SRS

SBS

The game ends after successfully guessing three safe squares or guessing a losing square. After each guess, your program should display the contents of the gameboard square and print the corresponding message.

Assignment Requirements

Unlike previous examples, this assignment provides a starting point. Would you please check the template file provided to start. The assignment file contains multiple function prototypes that must be completed by you. These can not be changed and are required to be used during the completion of the assignment. You may add your own functions as needed. As this assignment will be reviewed in-depth by teaching assistants, all code must be correctly formatted or will be heavily penalized for bad formatting. You may not use global variables or gotos in your program. If you’re concerned about any requirements, please use the discussion boards for clarification.

Example Input/Output

Please note you should run the example solution to determine the output and formatting from other inputs and test your own examples. Several test boards are provided but you may want to create your own for testing.  The user input is highlighted in red and examples in blue highlight some of the error handling in the game.

Example  (Losing)

Please input the filename you wish to open:

board3.txt

For this game you will will pick three squares.

If the square contains an 'S' it is safe.

If the square contains an 'L' you lose.

If the square contains an 'R' you must pick again.

All row columns will be 0 based so 3 columns will be referred to as 0,1, and 2

???

???

???

Please input the row and column you want to select

1 1

The game board tile was R

You must pick again.

Please input the row and column you want to select

2 2

The game board tile was S

You are safe for now.

Please input the row and column you want to select

2 3

You've input an invalid square position, please try again.

Please input the row and column you want to select

3 3

You've input an invalid square position, please try again.

Please input the row and column you want to select

2 1

The game board tile was B

You have hit a bad square.

You've lost the game.

The board game was

SSS

SRS

SBS

Example  (Winning)

Please input the filename you wish to open:

board3.txt

For this game you will will pick three squares.

If the square contains an 'S' it is safe.

If the square contains an 'L' you lose.

If the square contains an 'R' you must pick again.

All row columns will be 0 based so 3 columns will be referred to as 0,1, and 2

???

???

???

Please input the row and column you want to select

0 0

The game board tile was S

You are safe for now.

Please input the row and column you want to select

0 1

The game board tile was S

You are safe for now.

Please input the row and column you want to select

0 2

The game board tile was S

You are safe for now.

You survived!

The board game was

SSS

SRS

SBS

Please note: This assignment will be partially graded using an auto-grader. Output errors not matching the sample input, test cases, and the solution program will result in deductions. The examples are not providing all test cases or errors, but the format of the text will remain consistent.

Coding Quality is still required and will be deducted as an overall error. Please see the codeStyle document under the assignment section for the preferred style.

o Function directly reads the game board and size from the file.

13% - Function  - printBoard.

o The function should print the regular game board.

o The function should print be able to switch to the ??? version.

50% - Function playGame:

o 15% Printing the proper information and format

o 10% Checking the gameboard square and performing the appropriate action

o 25% Determining rounds and if the game has ended.

25% - Main and other functions

o The remaining tasks of managing a user-provided file.

o Starting the main tasks such as reading the board and playing the game.

o Indicating if the game was won or not.

o The function IsvalidSquare

Common Deductions

Other deductions may apply these are simply common issues.

Code that does not compile ( will be marked as 0 )

Please review C/C++ style guide and examples.

Incorrect or inconsistent code formatting.

Printing unrequired information to the screen.

Variables names are non-descriptive or not in camelCase.

Program input and output not matching Samples.

(5/5)

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Hire Me

Hire Me