deckofcards:如何在Haskell中对纸牌甲板进行建模

时间:2021-04-27 14:48:57
【文件属性】:
文件名称:deckofcards:如何在Haskell中对纸牌甲板进行建模
文件大小:14KB
文件格式:ZIP
更新时间:2021-04-27 14:48:57
Haskell :“ [模拟一副纸牌的最佳方法是什么?” 这是一个很好的问题。 为了简单起见,让我们进行一些简化: 1. Aces high 2. No jokers 3. Single deck 一副纸牌有几个重要的属性: 1. Each card is a combination of a rank and suit 2. There are 13 ranks and 4 suits 3. Each card appears only once in the deck 4. There are 52 cards in the deck 5. All combinations of rank and suit are valid 显然,“最佳”模型将强制执行这些属性。 显然,某些属性可以从其他属性派生。 例如,为了使2、3和4都为真,则5必须为真。 为了强制执行这些属性,我们需要确保它们在类型
【文件预览】:
deckofcards-master
----DeckOfCards.hs(10KB)
----README.md(19KB)
----DeckOfCards.lhs(18KB)

网友评论