Assignment 6: Blokus Process EC327 Summer 2017

Assignment 6: Blokus Process

EC327 Summer 2017
Contents
1 Introduction 1
1.1 Assignment Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Due Date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Late policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Submission Link . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Blokus Tiles 2
3 Details: requirements and specifications 3
3.1 Types of tiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Input Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.4 Command-line issues . . . . . . . . . . . . . . . . . . . . . . . . . 4
4 Checker 5
1 Introduction
1.1 Assignment Goals
The assignment goals are to help you learn about
• two-dimensional data structures
• error handling
• command-line arguments
1.2 Due Date
This assignment is due 2017-06-13 at midnight.
1
1.3 Late policy
Late assignments will be accepted until the beginning of the lecture immediately
following the due date.
If the natural grade on the assignment is g, the number of hours late is h, and
the number of hours between the assignment due time and the next class is H,
the new grade will be
(h > H) ? 0 : g * (1- h/(2*H))
If the same assignment is submitted ontime and late, the grade for that component
will be the maximum of the ontime submission grade and the scaled late
submission grade.
1.4 Submission Link
You can submit here: blokus process submit link
2 Blokus Tiles
Summary: write A C++ program blokusprocess.cpp that reads information
about game tiles (tiles) for the game Blokus.
The program should expect three command line arguments:
• the size of the blokus textboxes
• the input file name
• the output file name
Blokus tiles are free polyonimoes. Here is an excerpt from wikipedia:
A polyomino is a plane geometric figure formed by joining one or
more equal squares edge to edge. It is a polyform whose cells are
squares.
The format of the tiles is a square text box with * indicating the location of the
cells, and . filling in the picture but meaning the absense of a cell.
Empty lines separate the textboxes for readability.
Here is an example file (called a tileset) with 3 5×5 textboxes:
…..
.*…
**…
*….
2
*….
…..
…..
**…
*….
**…
…..
…..
*….
***..
*….
The tiles represented are
*
**
*
*
**
*
**
*
***
*
3 Details: requirements and specifications
3.1 Types of tiles
• polyonimoes with holes are permitted
• although official Blokus tiles are no bigger than 5 squares (cells), we allow
for larger polyonimoes (they must be accepted)
• each textbox must have a tile. If a textbox is empty, exit the program
immediately, with no output, and with a return code of 3.
3
3.2 Input Format
• if any character other than . or * is encountered in a tileset (other than
the appropriate newlines), exit the program immediately, with no output,
and with a return code of 1.
• there must be exactly one empty line after each textbox. If this condition
is not met, exit the program immediately, with no output, and with a
return code of 2.
• if any textbox is encountered with an incorrect overall size (not NxN), exit
the program immediately, with no output, and with a return code of 2.
3.3 Output
If no errors occur, the program should output the same textboxes as contained
in the input tileset, and exit with a return code of 0.
The output format for the tiles is the same as the input format: they are printed
inside a textbox with ’*‘and’.’ characters.
In addition:
• the program should output nothing “extra”
• the output textboxes should be in the same order as the input textboxes
3.4 Command-line issues
• if no arguments are provided, use a textbox size of 5, standard input, and
standard output.
• if only one argument is used, it will be a positive integer representing the
textbox size.
• if two arguments are used, the first is the textbox size and the second is the
filename of the input tileset. The output will be to standard out (cout).
• if three arguments are used, the first is the textbox size and the next are
the input tileset filename and the output tileset filename.
• any extra arguments (more than three) should be ignored.
You will also be provided proper command line arguments. The only error
conditions relate to the contents of the tileset text.
4
4 Checker
The checker will be available here:
• blokusprocess_checker.py
Download by clicking the link or using ecget inside the DevBox.
Use it by typing
python blokusprocess_checker.py
in the directory that has your programs in it.
5

                                                                                                                                  Order Now

Place Order