HW 1

The Mickey Mantle Card Game

One of the most important skills a software engineer can have is the ability to take a large problem, like a software specification, and view it as a series of small, easily solvable problems. For this assignment, do not simply dive into the coding, that is a recipe for failure. Instead, develop a plan for solving this problem. Break this assignment down into smaller problems. Do this by dividing the data into appropriate classes, and then deciding what methods are necessary for implementing the solutions to these smaller problems. Helper methods help!

Test as you go! I cannot emphasize it enough that you need to get used to testing your code as you go. Write a little bit of code (one method), and then make sure it works properly before moving on to the next one.

For this assignment, you will implement a program that plays the Mickey Mantle Card Game. This a fun card game, best with 4 players, that your humble instructor liked to play growing up. In your version of the game, there will only be at most one human player, and from 2 - 4 computer players. The user will get to select how many computer players, and if the user selects 4, there will be no human players (only bots).


Game Play

In this game, the winner will be the one who plays all their cards first. Playing a card means placing a card in its proper order onto one of the four suit piles. Note that players build the four piles out in both directions from the seven card (i.e. the middle of the suit). So the first card played in the game must be a seven. To play the game, first, all the cards are dealt out evenly to the players. Players then place cards on the suit piles in turn according to the following rules. For the player whose turn it is:


Game Requirements

Code the Mickey Mantle Card Game such that it provides a game menu that allows a player to play the game as many times as one likes. In addition, it should allow for:


Coding Rules


No Crashing

Under no circumstances should your program terminate (crash) unless the player has requested to quit. You must handle all faulty user input in an intelligent way such that your game can recover from user error and continue. Note that your professor will try to break your program using all kinds of bad input.


NOTE: It is not likely you will be able to complete this assignment in one or even two nights. You must carefully think about all the components to this assignment and then break down the work into pieces that you can implement. Make sure to have some sort of design before you start, and again, make sure you test your code as you go. The intention here is to get you back in the flow of Java programming and get you thinking about data structures.


EXAMPLE SESSION

The MickeyMantleCardGameExampleSession.txt file provides an example of how your game application may look. You should use a similar menu.



Handin Instructions

When you are done, zip up and submit your project via Blackboard.


Grading

Note that grading for this assignment is done purely based on functionality and how closely your work resembles that of the example session. Code that does not compile will not receive credit and points will be deducted for each thing that does not work according to the requirement.




Stony Brook CS

Web page created and maintained
by Richard McKenna