Tag: fsharp

Blog

History repeats [Desiderius #14]

Two weeks ago I talked about the playing logic and the improvements kot_2010 made, but there is a bit more info I want to share. Let’s talk a little bit more about how I designed the playing history. History is a list of lists, where each inner list is a trick. Visually: //An empty game: [ […]

Blog

Moving the BPN logic from C# to F# [Desiderius part #13]

Like I wrote about a few weeks back, all the refactorings made me reflect on some names. It started out simple, as I said three weeks back, Desi.Player I had in F# (so the type, not the class) should be called something like “direction” as it represents just where the players are. I think this is […]

Blog

Feedback on Desiderius [Desiderius part 11b]

I got me some feedback! Who knew, after 11 posts, people starting reading my posts and tweeting me feedback and ideas. @Felienne in F# can you do ` List.sortBy (helper.getRank) hand` instead of `List.sortBy (fun x-> helper.getRank(x)) hand`? — Daan van Berkel (@daan_van_berkel) March 6, 2016 Turns out, you can! That makes my code a bit […]

Blog

Playing in F# [Desiderius part 11]

Last week I reluctantly shared the ugle initial C# version of my simple playing AI “nextCard”. Today, let’s look at the nicer version. One of the first things I did in F# was make getSuit and getRank helpers: let getSuit (c: Desi.Card) : Desi.Suit = match c with | Desi.Card (s,r) -> s let getRank (c: […]

Back To Top