Docsity

Advanced Software Engineering - Programming Assignment 1 | CSI 5V93, Assignments of Software Engineering

Toggle sidebar
bg1
Programming Assignment 1
Due Feb 7
Create a board component that can be used to play checkers. The board will have 64
squares in an 8x8 array. The squares will be alternately red and black. The top row will
have a black square on the left. The width and height of each square will be given by the
property SquareWidth. There will be one event called SquareClick with two parameters.
The event will be fired when a mouse-down event occurs on the board. The two
parameters will indicate the square that has been clicked. The square will be identified by
a pair of numbers from 0-7. The top left square will be 0,0, while the top right square will
be 0,7. The parameters will be called Row and Column, in that order. The component
will have two functions, SetSquare and GetSquare. SetSquare will not return a value, and
will have three parameters, Row, Column, and State. Row and Column are the same as
those parameters for SquareClick. State will have three values 0, 1, and 2. 1 will cause
the square to be redrawn with a white circle inside it, 2 will cause it to be redrawn with a
grey circle inside it, and 0 will cause it to be redrawn empty. GetSquare have two
parameters Row and Column and will return 1, 2, or 0 depending on whether the
addressed square has a white circle, a grey circle or is empty.
This does not provide the capability of creating kings. If you wish, think up some way of
doing that and implement it.

Partial preview of the text

Download Advanced Software Engineering - Programming Assignment 1 | CSI 5V93 and more Assignments Software Engineering in PDF only on Docsity!

Programming Assignment 1 Due Feb 7

Create a board component that can be used to play checkers. The board will have 64 squares in an 8x8 array. The squares will be alternately red and black. The top row will have a black square on the left. The width and height of each square will be given by the property SquareWidth. There will be one event called SquareClick with two parameters. The event will be fired when a mouse-down event occurs on the board. The two parameters will indicate the square that has been clicked. The square will be identified by a pair of numbers from 0-7. The top left square will be 0,0, while the top right square will be 0,7. The parameters will be called Row and Column, in that order. The component will have two functions, SetSquare and GetSquare. SetSquare will not return a value, and will have three parameters, Row, Column, and State. Row and Column are the same as those parameters for SquareClick. State will have three values 0, 1, and 2. 1 will cause the square to be redrawn with a white circle inside it, 2 will cause it to be redrawn with a grey circle inside it, and 0 will cause it to be redrawn empty. GetSquare have two parameters Row and Column and will return 1, 2, or 0 depending on whether the addressed square has a white circle, a grey circle or is empty.

This does not provide the capability of creating kings. If you wish, think up some way of doing that and implement it.