Go Fish/OCaml: Difference between revisions

Content added Content deleted
(Created page with '{{collection|Go Fish}}Category:OCaml <lang ocaml>type pip = Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King | Ace let pips = …')
 
No edit summary
Line 199: Line 199:
*)
*)
opponent <- List.sort (fun _ _ -> Random.int 9 - Random.int 9) opponent;
opponent <- List.sort (fun _ _ -> Random.int 9 - Random.int 9) opponent;
if ranks <> []
match ranks with
then fst(List.hd ranks)
| [] -> Jack
else Jack
| (x,_)::_ -> x


method give_cards (_cards : card list) =
method give_cards (_cards : card list) =