Created
January 16, 2022 18:23
-
-
Save wrongbyte/1b205b17d2b3b335ac99cf824cd31fd8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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