Paskahousu is a classic Finnish card game, lit. shitpants. You are dealt cards in the start, and your objective is to get rid all of those cards. The last player who has cards in their hand is, according to the classic Finnish tradition, called paskahousu.

This is my first proper HTML5 game, and also the first proper game I’ve implemented outside of assignments. I chose to do Paskahousu specifically because there are countless versions of classic poker, blackjack and solitaire - but only very few versions of paskahousu. It was an interesting exercise to implement, all the way from textures and fonts to the actual game logic and AI.

The game is technically relatively simple and split between UI and backend. The user interface interacts with the backend using defined transactions, allowing decoupling which I believe substantially helped with unit testing. After backend testing was done, it was a relatively breezy effort to implement frontend, as I only had to ensure it follows the specified transaction rules - backend had already been tested to follow them!

The AI is also relatively simple, selecting its moves mostly based on calculated probabilities. Be mindful though - the AI can do certain cheating actions which are not blatantly invalid moves, but may result in unexpected occurences like seeing same card pop twice from the deck (hinting that someone has manipulated it). Good thing that there is a fail-safe, causing the AI to fail its cheating every now and then ;)


Screenshot of Paskahousu


There are many variants of the rules, and just about everyone has their own. Below are the rules this game uses, as quoted from my page

Each player is dealt five cards in the beginning. The objective is to get rid of your entire hand. The game is played turn by turn, and the first one to get rid of all their cards wins.

The starting player is the one with the largest amount of 3:s. If this does not render an unambiguous result, then 4:s, 5:s, et cetera.

After each turn, you will draw cards from the deck until you have at least 5 cards.

You can place cards on the pile as follows:

  • Cards must be of same rank or higher, barring exceptions below.
  • Court cards can only be played on eight or higher, unless the deck is empty. Otherwise, normal order must be followed.
  • Twos can be placed on any other rank, but nothing else than twos can be placed on twos.
  • Tens and aces topple the pile, discarding it from the game. Tens can only be placed on numeric cards, and aces on court cards. Toppling cards can be played on an empty pile when the deck is empty, in which case they pass to the next player.
  • Four of the same card topple, except for twos which never topple.

If you are unable to place a card, you must take the entire pile to your hand. You may also do this voluntarily at any point instead of placing a card. If nothing in your hand fits, you may also attempt a last chance, publicly drawing a card from the deck. If this succeeds by the card being appropriate for the pile, your turn immediately ends.


Play it on or download a local copy for tinkering.

© Arttu Ylä-Sahra 2016-2022
Page rendered on 2022-03-25T15:05:50.731+00:00
Privacy statement