~bfiedler/website

d1acbc7eb23fec390aa2cfe9047574d32385ac68 — Ben Fiedler 5 months ago 84d1a5d
Last minute adjustments, release blog post in early time zone
1 files changed, 4 insertions(+), 4 deletions(-)

M content/blog/composition-in-trick-taking-card-games.md
M content/blog/composition-in-trick-taking-card-games.md => content/blog/composition-in-trick-taking-card-games.md +4 -4
@@ 1,6 1,6 @@
---
title: "Composition in Trick-Taking Card Games"
date: 2020-12-03T00:00:00+01:00
date: 2020-12-03T00:00:00-06:00
draft: true
tags: haskell
---


@@ 10,7 10,7 @@ tags: haskell
> Haskell content!

A [trick-taking game](https://en.wikipedia.org/wiki/Trick-taking_game) is a
genre of (primarily card) games. Play revolves around rounds, in which each
genre of (primarily) card games. Play revolves around rounds, in which each
player plays exactly one card. The player who played the highest card wins the
round, or *trick*.



@@ 145,8 145,8 @@ rankCompare :: Rank -> Rank -> Ordering
rankCompare = compare

heartsCompare :: Suit -> Card -> Card -> Ordering
heartsCompare lead c1 c2 = suitCompare (getSuit c1) (getSuit c2)
                           <> rankCompare (getRank c1) (getRank c2)
heartsCompare lead c1 c2 = suitCompare lead (getSuit c1) (getSuit c2)
                        <> rankCompare      (getRank c1) (getRank c2)
```

We have separated comparison of suit and rank and combine the results using