Skip to content

Instantly share code, notes, and snippets.

@wrongbyte
Created January 16, 2022 18:23
Show Gist options
  • Save wrongbyte/1b205b17d2b3b335ac99cf824cd31fd8 to your computer and use it in GitHub Desktop.
Save wrongbyte/1b205b17d2b3b335ac99cf824cd31fd8 to your computer and use it in GitHub Desktop.
let cards = [0..5]
let hand = []
let drawCard (tuple: int list * int list) =
let deck = fst tuple // lembre-se que fst é da forma fst()
let draw = snd tuple
let firstCard = deck.Head
printfn "%i" firstCard
let hand =
draw
|> List.append [firstCard]
(deck.Tail, hand)
let d, h = (cards, hand) |> drawCard |> drawCard
printfn "Deck: %A Hand: %A" d h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment