【发布时间】:2017-04-30 16:44:22
【问题描述】:
我有 2 个序列...
type Suit = Spades | Clubs | Hearts | Diamonds
type Rank = Ace | Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King
type Card = { suit: Suit; rank: Rank}
和intValueCard = {rank: Rank; value: int} // translates the union into an actual int
只是想知道如何在实际的 int 中获得卡片的等级......到目前为止我有
let getActualValue (card:Card) =
value |> translatedValue.Rank
但是对于我的生活,我无法弄清楚如何处理序列并且getActualValue 不起作用..
【问题讨论】:
-
你应该看看this