Lab 10: Putting it all together: Defining your own class
Due: 10pm Thursday April 26
Purpose: In this assignment, you will combine all that you have learnt in this course. You will learn how to design the solution to a problem, write your own classes, re-use the concepts of input/output, looping and 2-D arrays that you have used previously.
Important: This assignment counts double compared with others. Work with your pairs on how to break the problem down, along with how to code it. Spend some time discussing design issues - what classes you might need, how the different objects would interact with each other etc. on paper before you start typing it up!
You will implement the following features of the game:
At the begining of a game, you will have a deck of SET cards. Each SET card has a color (Red, Green, Purple), a shape (Oval, Diamond, Squiggle), a number(One, Two,Three) and a shading (Solid, Open, Striped). You will start with a deck of all possible SET cards.
When the game starts, you will pick 12 cards from the deck and display it to the user as a game board. You will also ask the user to figure out a SET. The objective of the game is to pick three cards that have the all the same or all different values for any feature. Detailed rules of the SET game are here.
If the user has formed a SET, you will remove these three cards and add three new cards from the deck to the game board. The cards cannot be reused. If the user has picked three cards that do not form a SET, you will display the same game board. The user should be able to quit or start a new game at any time.
The user should also have an option to say that no SET is possible from the cards on the game board. If the user selects this, then you will check the game board to see if a SET exists. HINT: enumerate all possible combinations of cards possible from the game board and check if they form a SET. If yes, prompt the user to find it, else discard three cards from the board and add three new cards from the deck.
You will need to break the problem down and figure out the different parts that you need to implement. It might help to think of the different objects that you need and describe a class for each of the objects.
You will also write the input/output interface for your game. Feel free to use your imagination to display the game board. You can use image and graphics to represent the cards (like the image manipulation lab) or use terminal output.
Extra Credit: As a bonus, you can earn 20 extra points for putting in extra effort and adding a better graphics display. You can also earn 30 extra credits if you implement the daily puzzle at www.setgame.com.
Include your name, slip days, and a comment at the top of your file that has the main() method. Describe in detail the format in which you expect the input to be in your header.
/**
* @author name 1: discussion section time:
* CS account user name:
* Section Unique Number:
* slip days used on this assignment: ??/4
* total slip days used: ??/6
*
* @author name 2: discussion section time:
* CS account user name:
* Section Unique Number:
* slip days used on this assignment: ??/4
* total slip days used: ??/6
*
* On our honor, we followed the pair programming rules of splitting
* keyboard time evenly and 80% or more joint development, and we have
* neither read nor copied code, nor have we shown or given our code to
* others.
*
* @version Date
*
*
* Extra Credit attempted (Yes/No):
*
*/
For this lab, you will turn in a zipped folder containing all the source files. You can create the zipped folder by Right-Clicking on the project you created in BlueJ and choosing "Send To" and then "Compressed (Zipped) Folder". Please make sure that all the files you need to turn in are in this folder BEFORE you zip it.
You then turnin this .zip file using the turnin program. If you need help goto turnin program help.
This assignment counts double compared with others. 70% of your score will come from "external correctness" which means you implemented all the features that are required.
30% of your score will come from "internal correctness" which means you used the specified Java constructs correctly, you captured the redundancy and structure correctly, you commented the header and code appropriately, and you followed the basic Java style guidelines.
Good Luck!