Advertisement
overwater

Untitled

Mar 20th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.73 KB | None | 0 0
  1. let rec play (card_list : list<card>, held_list : list<card>, move_list : list<move>, goal : int, sum : int, thres : int) : list<move> =
  2.         match goal - sum with
  3.         | 0 -> move_list
  4.         | var1 with var1 > 10 -> match card_list with
  5.                            | head :: tail -> play(tail, held_list @ [head], move_list @ [Draw], goal, sum + card_value(head))
  6.                            | [] -> move_list @ [Draw]
  7.         | var1 with var1 <= 10 -> match card_list with
  8.                                   | head :: tail -> match hint(head, held_list) with
  9.                                                     | None -> move_list
  10.                                                     | Some x -> move_list @ [Discard(x)] @ [Draw]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement