COAL Semester Project Spring 2016 Course

COAL Semester Project
This projects aim to a better understanding of the Labs, Project is to be done by every student
individually. (Means not a group project)
A ‘Project Report’ is required with the Demonstration of complete logic. The report should be no
more than ten pages and not less than five. Project grade will contribute 40% of Lab’s final grade
and 10 % of class

Spring-2016

Course Instructor


Ms Saba Rasheed Malik

Lab Instructor


Mr Muhammad Nauman

National University of Computer & Emerging Sciences, Islamabad


.

Four Up
The project that you are going to implement is a board game that follows some basic and very simple
rules. Let's call this game "Four Up". In the game the players will first choose a symbol and then take
turns dropping the selected symbols from the top into a seven-column, six-row grid. The pieces fall
straight down, occupying the next available space within the column.
The objective of the game is to connect four of players' symbol next to each other vertically, horizontally,
or diagonally before your opponent. The game can only have 3 states as outcome.




Win
Lose
Draw

Now the way you are going place each symbol down the column is by pressing the keys 1 to 7. This will
make the particular symbol of the player taking the turn fall until it has either hit the bottom or any of the
two symbols. As shown in image 1.


Image 1
Now this is only a sample image. But, you can decide on your own about what characters to use for
making grid or symbols for the 2 players.
The winning outputs in case of player 1 with symbol



horizontally →

inside the grid can be as follows:



vertically →



Diagonally→


or

Scoring criteria:
The scores for each player will be updated as soon he makes a pattern (mentioned above). The player with
the maximum pattern score will win.
There will be 2 parts of this project: part 1 will be slightly student friendly and part 2 will be teacher
friendly. How? Read below.

Part 1: You will implement the game for two human players to play. We will manually decide which
column to throw the symbol in.

Part 2: You will implement the game for human vs. computer. This means that in one turn we will
decide in which column to thrown the symbol. For the other turn your program will decide which column
to throw the symbol in so that the human player does not win.

If you want to play the game you are going to implement: check the following
link:
http://www.coolmath-games.com/0-connectfour

Submissions

Phase 1:- (09-April-2016)
 In phase 1 you are required to implement the game for two human players to play.

Phase 2:- (19-April-2016)
 You will implement the game for human vs. computer. This means that in one turn we will decide
in which column to thrown the symbol. For the other turn your program will decide which
column to throw the symbol in so that the human player does not win.

Guidelines

Implementation details:
To implement this game you need do the following:
 Make menu for your game and allow the users to select their symbols
 Make a grid of the size of console.
 Game will continue until the whole grid has no more empty box. Until then the player will keep
on taking turns respectively.
 Implement a procedure that takes in consideration about the status of game and updates the score
for each player accordingly.
 You will also have to write a procedure that calculates the score for each player.
 You will also have to write a procedure that can play with a single human player in the absence of

the other (part 2). This procedure must try its best to win against the player.
 Last but the not least make sure you use functional programming as much as you can. A code
that’s written all in main will get less marks.
These are the basic guidelines for the project; you are free to implement the project as per your logic; but
by staying in the domain of concepts taught during this semester.

General coding details:
 Code should be properly commented
 Use proper terminologies for your variables/arrays declaration. And follow the proper notations
for formatting the variable like: camelCase → myCounter, PascalCase→MyCounter, or
underscores→my_counter.
 You are the sole owner and care taker of your code; so make sure you have 2 or 3 backup location
where you have saved your most recent work. Because over the years I have found that PC's get
stolen, broken and even things in them burn write before submissions. Make sure this does not
happen.
 Emails will not be accepted in any case what so ever. It’s a big NO - NO!
 If you are working on emulator then it must be MASM611 compatible.
 Plagiarism will result in ZERO marks in all the evaluations of Class and Lab.
 You will upload only the .txt file. With the following format Name_Roll
Number_Section.txt. Another format of submission will have consequences. Zipped Folder

will not be graded.

~*Good Luck*~