Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec play (card_list : list<card>, held_list : list<card>, move_list : list<move>, goal : int, sum : int, thres : int) : list<move> =
- match goal - sum with
- | 0 -> move_list
- | var1 with var1 > 10 -> match card_list with
- | head :: tail -> play(tail, held_list @ [head], move_list @ [Draw], goal, sum + card_value(head))
- | [] -> move_list @ [Draw]
- | var1 with var1 <= 10 -> match card_list with
- | head :: tail -> match hint(head, held_list) with
- | None -> move_list
- | Some x -> move_list @ [Discard(x)] @ [Draw]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement