211 Project 1
Tile Display Class
Due:______________________
The
project will be graded with these proportions:
|
Style |
30 |
Comments, Variable Names,
Indenting |
|
Design |
30 |
Over use of Global
Variables, Under use of functions or poor separation into files, or
poor organization of objects. Uninitialized Variables, Misuse or Disorganization of
loops, recursion, etc. |
|
Success |
40 |
Code doesn't compile,
Crashes, Doesn't do what was in assignment and fails to include
clarifications in class. |
·
You will write a
class called TileDisplay in a package called game
that extends the acm.graphics.GLabel class.
·
The TileDisplay class will have in it:
·
A private Tile
instance variable that holds the tile to be displayed
·
A public
constructor that takes the tile to display as its parameter
·
A public getTile method that returns the tile in the TileDisplay
·
A toString method with no parameters that puts the tile's
data into a String that is returned.
·
A tester class
that extends acm.program.GraphicsProgram creates a
Deck, Shuffles it, deals a Card, uses the Card to create a CardDisplay,
and displays it.
When
the application is executed, the program will display a window with a card
drawn from a shuffled deck.
Extra
credit:. Graphic tiles.
Tile Hands
Due:______________________
The
project will be graded with these proportions:
|
Style |
30 |
Comments, Variable Names,
Indenting |
|
Design |
30 |
Over use of Global
Variables, Under use of functions or poor separation into files, or
poor organization of objects, Uninitialized
Variables, Misuse or Disorganization of loops, recursion, etc. |
|
Success |
40 |
Code doesn't compile,
Crashes, Doesn't do what was in assignment and fails to include
clarifications in class. |
You write a class called Hand. This class will have:
·
A protected
array of 20 TileDisplay variables.
·
A protected int size variable that holds how many TileDisplays
are actually available.
·
A public
method push that adds a new TileDisplay to the
end of the hand
·
A public
method pop that removes the last TileDisplay from
the hand
·
A public
method top that returns the last TileDisplay in
the hand
·
A public updateDisplay method that displays all the TileDisplays in the hand in a GCanvas
supplied as a parameter and no other TileDisplays.
·
A public
method called toString that returns a String containing
the TileDisplays in the Hand separated by newlines.
·
You will write a
tester class called HandTester that will
extend acm.program.GraphicsProgram. It will deal out 7 cards into a hand. It will have a Hand menu with items that
allows the user to:
·
Draw a new card
from the bag
·
Remove the last tile
in the hand
·
Output the hand
to the console (by println'ing toString).
The main method will create
at least 2 hands (more are extra credit).
The user will use the selector to execute commands on the hands. Extra credit: Hard – clicking a
mouse on a card causes the index of the card to be printed to the console.
211 Project 3
Word Game
Due:______________________
The
project will be graded with these proportions:
|
Style |
30 |
Comments, Variable Names,
Indenting |
|
Design |
30 |
Over use of Global
Variables, Under use of functions or poor separation into files, or
poor organization of objects, Uninitialized
Variables, Misuse or Disorganization of loops, recursion, etc. |
|
Success |
40 |
Code doesn't compile,
Crashes, Doesn't do what was in assignment and fails to include
clarifications in class. |
You will add these methods
and classes to the Hand class
·
A public insert
method that inserts its TileDisplay parameter at its
location (int) parameter.
·
A public remove
method that removes the TileDisplay at its location
parameter
·
A public
index method that returns the TileDisplay at its
location parameter.
·
A private int
that will hold the score.
·
A public getScore
method that returns the score.
·
A public changeScore
method that adds its parameter to the score.
You
will write another class called Word that extends acm.program.GraphicsProgram. The Word class will have in it two hands for
the two players. It will also have 1 TileBag and a discard pile (implemented as a Hand). Each player will start with an empty Hand. When a player’s hand has a word of 3 or
more letters (according to the dictionary) the total of the tiles in his hand
is added to the score and his hand is cleared.
During a player’s turn these are displayed:
·
The
player’s score
·
The
player’s tiles
·
The
player’s Hand
·
The top TileDisplay in the discard pile.
There
will be a menu called Word with these options:
211 Project 4
Linked
Hands
Due:______________________
The project will be graded with these proportions:
|
Style |
30 |
Comments, Variable Names, Indenting |
|
Design |
30 |
Over use of Global Variables, Under use of functions or poor separation into files, or poor organization of objects, Uninitialized Variables, Misuse or Disorganization of loops, recursion, etc. |
|
Success |
40 |
Code doesn't compile, Crashes, Doesn't do what was in assignment and fails to include clarifications in class. |
This project has the same requirements as project 2, except the Hand class must be implemented by a linked list. You can insert and remove from the beginning rather than the end.
211 Project 5
Linked
Word Game
Due:______________________
The project will be graded with these proportions:
|
Style |
30 |
Comments, Variable Names, Indenting |
|
Design |
30 |
Over use of Global Variables, Under use of functions or poor separation into files, or poor organization of objects, Uninitialized Variables, Misuse or Disorganization of loops, recursion, etc. |
|
Success |
40 |
Code doesn't compile, Crashes, Doesn't do what was in assignment and fails to include clarifications in class. |
This project has the same requirements as the project 3, but you need to implement your Hand class with a linked list.