CSC 301H--Introduction to Software Engineering

Assignment

Skat

In this assignment you will go through the steps in the Software Engineering process. This assignment is based on the card game Skat. Skat is the national game of Germany, invented in Altenburg in 1810. It has been called the best three-player card game.

Description

Based on the cards they receive the players bid on the number of points they will win. The player who says they will win the most number of points gets to choose the trump. The other pair of players become a team of two against the declarer.

At the beginning of the game the first dealer is chosen randomly.

After shuffling, the cards are dealt in the following order: three cards to each player, two cards, the skat, to the middle of the table, four cards to each player and finally three more cards to each player. The player to the left of the dealer plays the first card. Dealing continues clockwise until the cards are exhausted. The winner of the hand accumulates points toward winning the game. The cards for the next trick are dealt and played.

The players bid based on the value of the cards they are dealt. The possible bid values are 18, 20, 22, 23, 24, 27, 30, 33, 35, 36, 40, 44, 45, 46, 48, 50, 54, 55, 59, 60, and so on. The next player may pass, not make a bid or bid one of the possible bid values. Once none of the players is willing to raise the current value bid, the player with the highest bid gets to examine or not examine the skat, declare one of the suits as trump. Let's call them the declarer. If the declarer picks up the skat they must discard two cards. The declarer can instead declare Grand where the Jacks are the only trump. Or the declarer could declare a Null, no trump, where the declarer takes no tricks.

The other two players, not declarer, then act as a team of two playing against the declarer. There is no communication between the pair of players, now a team.

If the clubs, spades, hearts, or diamonds are declared trump, the cards are ranked: jack of clubs, jack of spades, jack of hearts, jack of diamonds, followed by ace, ten, king, queen, nine, eight, seven in the trump suit. The jacks are treated as part of the trump suit.

If declared Null, there are no trumps, cards in each suit are ranked: ace, king, queen, jack, ten, nine, eight, seven.

The cards are valued: jack, 2, ace, 11, ten, 10, king, 4, queen, 3, nine, 0, eight, 0, seven, 0.

The objective is that you win hands to accumulate points. The total of card points of all players is 120. If the declarer gets 61 or more they win. If the opponents, player team, get 60 or more points they win.

Game points are different from card points. Card points are accumulated in a hand and are used to calculated game points. Game points are accumulated according to trump chosen and use of the skat cards.

Skat uses a partial deck of 32 cards, A, K, Q, J, 10, 9, 8, 7 from each suit. The cards are shuffled and dealt, 10 cards to each player with two cards left over called the skat.

Additional points can be won in a suit game, when one of the suits is trump. The base values of the different suits are: clubs, 12, spades, 11, hearts, 10 and diamonds, 9. For an extra point the declarer can announce Schneider after bidding and the declarer must make 90 or more points to win. For an extra point the declarer can announce Schwarz after bidding and the declarer must win all tricks. Ouvert combined with Schwarz the declarer plays with cards open and must win all the tricks. There is an extra point if the declarer does not look at the skat.

Scoring the value of a hand is summing the point values of the cards. Here are no card points for a Null game. Over bid hands lead to a negative score. The amount deducted from the declarer is twice the lowest possible hand value that is a multiple of the base value that is as high as the declarer's bid.

For the assignment to keep things simple use standard skat with none of the variations. Some versions include points for matadors, runs, unbroken sequences of top trumps. Some versions allow claiming and conceding by the declarer or opposition. We will not use any variations.

Gerhard Trippen suggested Skat as this year's game. I got much of my Skat knowledge from several sources:
http://en.wikipedia.org/wiki/Skat_%28card_game%29,
http://www.pagat.com/schafk/skat.html,
http://www.bicyclecards.ca/game-rules/skat/152.php?page_id=32.
The Wikipedia description is the one I followed most closely.

Assignment

This assignment will start as individual work. Part way through the term groups will be organized into teams. I will assign team members. As we start the course there are 23 students registered. Pending change in enrolment there will be six teams of three or four members.

Exercise 1 (week 3) Jan 21 Reading Specifications

Find three friends who have never played Skat. Find a deck of playing cards. Using the description, "specification", above play the game. Make notes of where there are problems in the specification, omissions, ambiguity, contradictions. There are other sources of Skat games, for example the German-Canadian Club at 6650 Hurontario plays casual Skat every Wednesday evening and serious Skat every Thursday evening. There are also online games.

Exercise 2 (week 5) Feb 4 Requirements Elicitation

Find an experienced Skat player maybe in your FaceBook account or in residence or the Club listed above and quiz them about the rules of the game. (No strategy at the moment.) Rewrite the specifications as completely and correctly as possible. Do not just transcribe the experienced player's description. Fit the corrections and additions into the current specification.

Exercise 3 (Reading Week) Feb 18 Identify Objects

Identify the objects in the game. Make a case for your choice of objects. Write Java code for the different objects in your tournament. Do unit testing on your objects. (At this point, there is no need to do any more than unit testing.)

Exercise 4 (week 7) Feb 25 Team Building and Communication

(At this point teams will be assigned to parts of the project.) Each member of the team makes a pitch that his/her code is used in the teams submission. Define an interface between the game and the players. Refactor as necessary.

Exercise 5 (week 9) Mar 11 Complete Coding and Testing

Write a driver program that runs a tournament, tests and accumulates data regarding performance. Make sure that your player works with the game or your game works with the players. Integration and system testing.

Exercise 6a (week 11) Mar 25 Preparation for the Competition

We will run your code against other implementations. Go back to the Skat player from Exercise 2 and ask for tips on winning strategies, order to play the cards in your hand, whether to pick up the skat, which cards to discard after picking up the skat. Add to the accumulation of data, any other interesting statistics.

Execise 6b (Week 12) Apr 1 Tournament

You will run your code against other implementations. There will be prizes.

Journal

Keep an electronic journal of the process you followed. At each step document the reasons for decisions made, the alternatives considered, the obstacles met.