Programming Assignment 2
CMPS 352 Operating Systems
Fall 2009

Gomoku

This programming assignment is to design the Gomoku, or Connect Five, game in the C languate. A Gomoku wiki article can be found at  Gomoku Wiki which describes how to play the game in details. Gomoku is a board game of two players on a board of 15 x 15 intersections. The players alternate in placing a stone of their color (white and black) on an intersection of the board, and whoever having five consecutive stones horizontally, vertically, or diagonally wins the game.

Graphical user interface is not required for this assignment. You may choose your own appropriate user interface. For example, the players may enter, from keyboard,  the coordinate, e.g., 3  4 of the intersection(row 3 and column 4) where they want to place their stone, and  it displays the board and stones as textual output with letter O for white and X for black stones and symbol - for unoccupied intersections.

Let us assume the following:

  1. Two players: Player 1 using White stone (O) and Player 2 Black stone (X),
  2. Player 1 always places the first stone on the board,
  3. The intersections of the board are numbered from the left top corner as (0, 0) and bottom right corner as (14, 14),
  4. A player places his/her stone by entering the coordinate of the intended intersection in the form: row_# column_# , separated with a single space.

For example, if Player 1 and Player 2 have entered the following:

2 10            // Player 1
4 6             // Player 2
14 1            // Player 1

the board would be printed like the following:

 012345678901234
0---------------
1---------------
2----------O----
3---------------
4------X--------
5---------------
6---------------
7---------------
8---------------
9---------------
0---------------
1---------------
2---------------
3---------------
4-O-------------

The game stops when the winner is determined by the server and the final board is displayed. It is optional to highlight the winning connected five stones in some fashion, e.g., in bold face or different color.

To submit your assignment, email the instructor (bi@cs.scranton.edu) and ATTACH your source files to the email. The subject of your email should appear like “CMPS 352 Assignment 2 – Your FirstName LastName”. Correctly naming your file and following submission procedure is considered part of the assignment requirements.

Help Links:

How to Use 2 D arrays