From 58568079a6df05f561ea6aceedd7e2a473eb9941 Mon Sep 17 00:00:00 2001 From: Max Charlamb Date: Sun, 8 Dec 2019 18:36:06 -0500 Subject: [PATCH] shortened lines and updated authors --- authors.ml | 2 +- bot.ml | 3 ++- partialdeck.mli | 6 ++++-- round.ml | 12 +++++++----- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/authors.ml b/authors.ml index 9f1f849..a07380d 100644 --- a/authors.ml +++ b/authors.ml @@ -1 +1 @@ -let hours_worked = [10; 8; 8] +let hours_worked = [15;15;15] diff --git a/bot.ml b/bot.ml index b151205..2c8a274 100644 --- a/bot.ml +++ b/bot.ml @@ -93,7 +93,8 @@ module Bot:BotSig = struct and play_med_helper hand pile queen_played queen_table = let pile_suite = (fst (pile |> List.rev |> List.hd)).suite in if PartialDeck.voided pile_suite hand then - play_bad_cards hand pile pile_suite [] {rank=Queen; suite=Spade} bad_cards + play_bad_cards hand pile pile_suite [] + {rank=Queen; suite=Spade} bad_cards else match queen_played, queen_table with | true, false -> play_highest hand pile pile_suite [] diff --git a/partialdeck.mli b/partialdeck.mli index 34bd1b8..33ac6b1 100644 --- a/partialdeck.mli +++ b/partialdeck.mli @@ -59,10 +59,12 @@ module type PartialDeckSig = sig (** [count_points t] is the number of points in partial deck [t]. *) val count_points: t -> int - (** [merge t1 t2] is the partial deck containing all the cards in t1 and t2.*) + (** [merge t1 t2] is the partial deck containing + all the cards in t1 and t2. *) val merge: t -> t -> t - (** [contains_hearts t] is true if [t] contains any hearts. Otherwise false.*) + (** [contains_hearts t] is true if [t] contains any hearts. + Otherwise false. *) val contains_hearts: t -> bool (** [string_of_partialdeck t] is a string representing the deck [t]. *) diff --git a/round.ml b/round.ml index 86f2106..5fc9ecf 100644 --- a/round.ml +++ b/round.ml @@ -138,7 +138,8 @@ module Round:RoundSig = struct ) (-1,false) players |> fst - (** [id_to_name id t] is the name of the player with id=[id] in round [t]. *) + (** [id_to_name id t] is the name of + the player with id=[id] in round [t]. *) let id_to_name id t = (List.nth t.players id).name @@ -268,7 +269,7 @@ module Round:RoundSig = struct let contains_other_cards = (PartialDeck.voided Club user.hand) && (PartialDeck.voided Diamond user.hand) && (PartialDeck.voided Spade user.hand) in - if not t.hearts_broken && card.suite = Heart && not contains_other_cards + if not t.hearts_broken && card.suite = Heart && not contains_other_cards then raise (Default "Hearts are not yet broken! Play another card.") else () @@ -399,8 +400,8 @@ module Round:RoundSig = struct else player) t.players - (** [list_to_deck lst deckacc] is the deck representation of the lst of cards in - [lst]. *) + (** [list_to_deck lst deckacc] is the deck + representation of the lst of cards in [lst]. *) let rec list_to_deck deckacc lst = match lst with | (h, _) :: t -> list_to_deck (PartialDeck.insert h deckacc) t @@ -476,7 +477,8 @@ module Round:RoundSig = struct | (_,0) -> t | (Play,id) -> internal_play t.next_player - (Bot.play (List.nth t.players id).hand t.pile (get_difficulty t) t.qspade_played) t + (Bot.play (List.nth t.players id).hand t.pile (get_difficulty t) + t.qspade_played) t | (Lead,id) -> internal_lead t.next_player (Bot.lead (List.nth t.players id).hand t.pile (get_difficulty t)) t