Sie sind auf Seite 1von 2

Programming Assignment

Topic: GUI and Event handling


Deadline: Sep 7, 2017 (Check submission instructions for the late policy)

1. 8-Queens Puzzle Game

The goal in Eight Queens puzzle is to place 8 chess queens on an


8 x 8 chess board so that no two queens threaten each other.
Your job in this assignment is to develop an Android App that –

• Lets a human player play the 8 queens chess problem,


• Detects and reports wrong moves, and
• (extra credit) If the person gives up in the middle of the
game, the program automatically finishes the puzzle, from
where the person left the game.
Fig 1. One of the 92 valid solutions to
the Eight Queens puzzle.

2. Point Distribution

Tasks Points Grading


1. A running app with a GUI showing an 8 x 8 chess 10
board. Keep something on the screen which tells us
that it’s your app e.g. app Name, icons, etc. Hint: 1)
Use 64 buttons, 2) Use GridLayout [video]

2. Add a “Restart” button. When clicked, it will clear 10


the entire board and let us play from the beginning.

3. Touching a cell will show or hide a queen on that 10


cell (i.e. toggles the queen’s presence). A human
can touch at any cell (i.e. in no particular order).

4. Detect wrong moves (i.e. attacking queens) 10


immediately and report the error in some way (be
creative here).

5. Extra Credit – Keep a “Give Up” button, when 10


pressed, the app takes the current state of the
game, figures out a possible valid arrangement
keeping the current pieces in their position (e.g.
using back-tracking algorithm), and shows the
solution on the board.
6. Extra Credit – show total number of valid solutions 10
when the “give up” button is pressed and an option
to choose which solution we want to see. You can
use a slider or two buttons (next & prev) to help the
user navigate through the valid solutions.

Total: 40 + 20 (EC)

3. Submission Instruction

• Bring your laptop, source code, and the running app on your phone/tablet for grading.
Assignments must be demonstrated in person to get the points.
• Upload the code (entire Android project folder zipped) to Sakai before the deadline. Uploaded
codes will be used to check honor code violations only. Note that just uploading the code to Sakai
will not get you any points. You must demonstrate your assignment in person.
• Late policy – 50% points will be taken off for being up to one week late and 75% will be taken off
for being up to two weeks late. No points will be awarded after two weeks.
• Extra credit policy – extra credit points are not limited to this assignment only, they will help you
raise your overall course grade.

Das könnte Ihnen auch gefallen