Pazaak is a card game from the Star Wars universe. It is similar to BlackJack, with two players pitted against each other trying to reach a total of twenty without going over. Each player has a "side deck" of four cards of their own that they can use to modify their score.
Leaderboard
As of 6/17/2015 @ 16:40 EDT
Edit: Neptor has been disqualified for cheating. Scores will be fixed as soon as possible...
- N.E.P.T.R: ~424,000
- The Cincinnati Kid: ~422,000
- Nestor: ~408,000
- Austin Powers: ~405,000
- Bastila: ~248,000
- Dumb Cautious Player: ~107,000
- Dumb Bold Player: ~87,000
Mock Pazaak Cup Playoffs
Will be updated as soon as possible.
Round One - Nestor vs Bastila & Austin Powers vs The Cincinnati Kid
Round Two - Nestor vs Austin Powers & The Cincinnati Kid vs Bastila
Mechanics
Gameplay is done in turns. Player one is dealt a card from the main (house) deck. The house deck holds forty cards: four copies of one through 10. After being dealt a card, they can choose to end their turn and receive a new card next turn, stand at their current value, or play a card from their side deck and stand at the new value. After player one decides what they want to do, player two repeats the process.
Once both players have gone, the hands are evaluated. If a player bombed out (went over twenty), the other player will win, provided that they did not also bomb out. If a player chose to stand, and the other player has a higher hand value, the other player will win. If both players chose to stand, the player with the higher hand value will win. In the event of a tie, neither player gets the win.
Provided a winning condition is not met, play will repeat. If a player chose to end their turn, they will receive a new card and can make a new choice. If they chose to stand, or if they played a card from their side deck, they will not be dealt a new card and cannot choose a new action.
Play continues like this until one player wins the game. Games are played in best-three-out-of-five sets.
Why "Simple" Pazaak?
In the Star Wars universe, Pazaak involved gambling. While inclusion of such a system would add more of a dynamic to the game, it is a bit complicated for a first-time KoTH competition.
"Real" Pazaak side decks were also provided by the players themselves, and could include many different card options such as negative cards, positive-or-negative cards, flip cards, double cards, and tiebreaker cards. These would also make the game more interesting, but would require a gambling interface in place, and would require far more out of the competitors. In this Simple Pazaak game, each player gets the same side deck: two copies of one through five, from which four are randomly selected.
Depending on the success of this game, I may put forth the effort to develop an advanced version wherein which gambling and custom side decks are possible.
The Players
The players of this game will be bots designed by you. Each bot needs to extend the Player class, import the Mechanics package, and reside in the players package like so:
package Players;
import java.util.Collection;
import Mechanics.*;
public class DemoPlayer extends Player {
public DemoPlayer() {
name = "Your Name Here";
}
public void getResponse(int wins[], boolean isPlayerOne,
Collection<Card> yourHand, Collection<Card> opponentHand,
Collection<Card> yourSideDeck, int opponentSideDeckCount,
Action opponentAction, boolean opponentDidPlay) {
action = null;
cardToPlay = null;
}
}
Each round, the controller will call the getResponse method for your bot, unless your bot previously indicated that it wanted to stand. The getResponse method can set two properties: an action and a card to play. Action can be one of the following:
- END: Ends the turn and draws a new card next turn.
- STAND: Stays at the current hand value. Will not draw a card.
- PLAY: Plays a card from the side deck and then stands.
The card to play is obviously only of importance if you set the action to PLAY. It takes a Card object. If the Card object you pass to it does not exist in your side deck, your bot will STAND instead.
The parameters your bot receives each turn are:
- An array containing the wins of each player. wins[0] is Player 1's, wins1 is Player 2's (int[])
- Whether or not your bot is player one (boolean)
- A collection of the cards that you have been dealt thus far (Collection)
- A collection of the cards your opponent has been dealt thus far (Collection)
- A collection of the cards in your side deck (Collection)
- The number of cards remaining in your opponent's side deck (int)
- The action your opponent last made (Action) [Note: This will either be END or STAND, never PLAY]
- Whether or not your opponent played a card (boolean)
Bot Rules
Your bots may only use the information that is given to them via the getResponse method. They should not attempt to interact with any other class. They may write to a single file to store data between rounds. They may have any custom methods, properties, etc. as desired. They should run in a reasonable amount of time (if the program run is not practically instantaneous, I will notice something is wrong).
If you find some kind of exploit in the code, you will be rewarded for "turning yourself in." If I notice the exploit first, I will fix it, and you will get no reward.
Demos
The controller is not needed to write a bot, as everything is already explained in this post. However, if you wish to test, it can be found here: https://github.com/PhantomJedi759/simplepazaak Two basic bots are included. Neither should hold up well against an "intelligent" opponent, as they only choose between END and STAND. Here is a sample run of what they do:
New Game!
The standings are 0 to 0
Dumb Bold Player's Hand: []
Dumb Bold Player's new Hand: [2]
Dumb Bold Player has chosen to END
Dumb Cautious Player's Hand: []
Dumb Cautious Player's new Hand: [8]
Dumb Cautious Player has chosen to END
Dumb Bold Player's Hand: [2]
Dumb Bold Player's new Hand: [2, 8]
Dumb Bold Player has chosen to END
Dumb Cautious Player's Hand: [8]
Dumb Cautious Player's new Hand: [8, 3]
Dumb Cautious Player has chosen to END
Dumb Bold Player's Hand: [2, 8]
Dumb Bold Player's new Hand: [2, 8, 7]
Dumb Bold Player has chosen to END
Dumb Cautious Player's Hand: [8, 3]
Dumb Cautious Player's new Hand: [8, 3, 6]
Dumb Cautious Player has chosen to STAND
Dumb Bold Player's Hand: [2, 8, 7]
Dumb Bold Player's new Hand: [2, 8, 7, 6]
Dumb Bold Player has chosen to STAND
Dumb Cautious Player's Hand: [8, 3, 6]
Dumb Cautious Player has chosen to STAND
Dumb Bold Player has bombed out! Dumb Cautious Player wins!
Because these bots rely purely on the luck of the draw, their win-loss ratios can vary drastically. It will be interesting to see how skill can combat the luck of the game.
This should be everything you need! Go build some bots!
Clarification to Rules
The main deck is forty cards: 4x1-10 It is reshuffled at the beginning of each hand.
A player's side deck has four cards, selected randomly out of 2x1-5. The side deck persists between hands.
Hands are played in games for the best three-out-of-five. Bots are scored based on the total number of games won, and then by the total number of hands.
Matching is handled so that each player will have to play 100,000 games against every other player.
In the Pazaak Cup, elimination-style rounds will narrow down who the best Pazaak bot really is. Each pairing of bots will play for the best four-out-of-seven sets of 100,000 games. Whoever wins four will move up the ladder to the next opponent, and the losers will stay down to battle for sequential rankings. This style of gameplay is the most fair, as bots cannot "win-farm" certain opponents to compensate for lack of ability against others. The Pazaak Cup will be held on Friday, July 3, provided there are at least eight submitted bots. The winner will receive Correct Answer status and a starting bonus in Advanced Pazaak, which will hopefully be ready close to the same time as the Pazaak Cup is held.