Commit 1147280d authored by Vivien Kraus's avatar Vivien Kraus
Browse files

More tests

parent 41876125
Pipeline #68231 passed with stage
in 1 minute and 8 seconds
......@@ -19,4 +19,4 @@
gamesdir = $(pkgdatadir)/games
include %reldir%/fail/Makefile.am
# include %reldir%/pass/Makefile.am
include %reldir%/pass/Makefile.am
# Makefile.am
#
# Copyright (C) 2018 Vivien Kraus <vivien@planete-kraus.eu>
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
# <http://www.gnu.org/licenses/>.
dist_games_DATA = \
%reldir%/artificial_combo_all.tarot \
%reldir%/artificial_combo_penultimate.tarot \
%reldir%/artificial_combo.tarot \
%reldir%/artificial_combo_without_pab.tarot
# dist_games_DATA += \
# %reldir%/bids_2.tarot \
# %reldir%/bids_3.tarot \
# %reldir%/call_any.tarot \
# %reldir%/call_in_dog.tarot \
# %reldir%/call_knight.tarot \
# %reldir%/call_omniscient.tarot \
# %reldir%/call_queen.tarot \
# %reldir%/call.tarot \
# %reldir%/call_with_push.tarot \
# %reldir%/discard_other.tarot \
# %reldir%/discard_other_trumps.tarot \
# %reldir%/discard.tarot \
# %reldir%/discard_trumps.tarot \
# %reldir%/dog_forcing_trumps.tarot \
# %reldir%/dog.tarot \
# %reldir%/empty.tarot \
# %reldir%/handful_3.tarot \
# %reldir%/handful_4.tarot \
# %reldir%/handful.tarot \
# %reldir%/handful_with_discard.tarot \
# %reldir%/has_to_trump.tarot \
# %reldir%/hint_bid_at_least_strk.tarot \
# %reldir%/multi_deal.tarot \
# %reldir%/p5_bids.tarot \
# %reldir%/p5_deal.tarot \
# %reldir%/pass.tarot \
# %reldir%/shogix_all.tarot \
# %reldir%/shogix_full_p5.tarot \
# %reldir%/shogix_full.tarot \
# %reldir%/shogix_full_without_slam.tarot \
# %reldir%/shogix_p5.tarot \
# %reldir%/slam_and_discard.tarot \
# %reldir%/slam_and_dog.tarot \
# %reldir%/slam_and_game.tarot \
# %reldir%/slam.tarot \
# %reldir%/slam_without_call.tarot
TESTS += $(dist_games_DATA)
EXTRA_DIST += \
%reldir%/artificial_combo_all.tarot.expected \
%reldir%/artificial_combo_penultimate.tarot.expected \
%reldir%/artificial_combo.tarot.expected \
%reldir%/artificial_combo_without_pab.tarot.expected
# EXTRA_DIST += \
# %reldir%/bids_2.tarot.expected \
# %reldir%/bids_3.tarot.expected \
# %reldir%/call_any.tarot.expected \
# %reldir%/call_in_dog.tarot.expected \
# %reldir%/call_knight.tarot.expected \
# %reldir%/call_omniscient.tarot.expected \
# %reldir%/call_queen.tarot.expected \
# %reldir%/call.tarot.expected \
# %reldir%/call_with_push.tarot.expected \
# %reldir%/discard_other.tarot.expected \
# %reldir%/discard_other_trumps.tarot.expected \
# %reldir%/discard.tarot.expected \
# %reldir%/discard_trumps.tarot.expected \
# %reldir%/dog_forcing_trumps.tarot.expected \
# %reldir%/dog.tarot.expected \
# %reldir%/empty.tarot.expected \
# %reldir%/handful_3.tarot.expected \
# %reldir%/handful_4.tarot.expected \
# %reldir%/handful.tarot.expected \
# %reldir%/handful_with_discard.tarot.expected \
# %reldir%/has_to_trump.tarot.expected \
# %reldir%/hint_bid_at_least_strk.tarot.expected \
# %reldir%/multi_deal.tarot.expected \
# %reldir%/p5_bids.tarot.expected \
# %reldir%/p5_deal.tarot.expected \
# %reldir%/pass.tarot.expected \
# %reldir%/shogix_all.tarot.expected \
# %reldir%/shogix_full_p5.tarot.expected \
# %reldir%/shogix_full.tarot.expected \
# %reldir%/shogix_full_without_slam.tarot.expected \
# %reldir%/shogix_p5.tarot.expected \
# %reldir%/slam_and_discard.tarot.expected \
# %reldir%/slam_and_dog.tarot.expected \
# %reldir%/slam_and_game.tarot.expected \
# %reldir%/slam.tarot.expected \
# %reldir%/slam_without_call.tarot.expected
setup -n 5 -w
deal --to P5 19T 18T 17T 16T 15T 14T 13T 12T 11T EXC KH QH CH JH 10H
bid take
bid pass
bid pass
bid pass
bid pass
decl pass
decl pass
decl pass
decl pass
decl slam
call KC
dog 6H 7H 8H
discard
handful EXC 11T 12T 13T 14T 15T 16T 17T 18T 19T
play 19T
handful 1T 2T 3T 4T 5T 6T 7T 8T 9T 10T
play 10T
play 20T
play 21T
play 6C
play AC
play 7C
play 11T
play 9T
play 10C
play KH
play 4H
play 10D
play 2C
play 9H
play QH
play 5H
play JC
play 3C
play 8C
play CH
play 6H
play JD
play 4C
play 9C
play JH
play 7H
play JS
play 5C
play 6D
play 10H
play 8H
play CC
play AD
play 7D
play 18T
play 8T
play CD
play 2D
play 8D
play 17T
play 7T
play CS
play 3D
play 9D
play 16T
play 6T
play QC
play 4D
play 5S
play 15T
play 5T
play QD
play 5D
play 6S
play 14T
play 4T
play QS
play AS
play 7S
play 13T
play 3T
play KD
play 2S
play 8S
play 12T
play 2T
play KS
play 3S
play 9S
play EXC
play 1T
play KC
play 4S
play 10S
status
\ No newline at end of file
tarot Copyright (C) 2018 Vivien Kraus
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `license' for details.
A game for 5 players, with call.
Score of P1: -1100.
Score of P2: -550.
Score of P3: 550.
Score of P4: 550.
Score of P5: 550.
setup -n 5 -w
deal P1 P1 P1 P1 P1 P6 P6 P6 P4 P5 P5 P5 P5 P5 P3 P3 P3 P3 P3 P4 P4 P4 P4 P2 P2 P2 P2 P2 P3 P3 P3 P3 P3 P4 P4 P4 P4 P2 P2 P2 P2 P2 P3 P3 P3 P3 P4 P4 P4 P4 P4 P4 P2 P2 P2 P2 P1 P1 P1 P1 P1 P1 P1 P1 P1 P1 P5 P5 P5 P5 P5 P5 P5 P5 P5 P2 P3 P5
bid take
bid pass
bid pass
bid pass
bid pass
decl pass
decl pass
decl pass
decl pass
decl slam
call KC
dog 6H 7H 8H
discard AH 2H 3H
handful EXC 11T 12T 13T 14T 15T 16T 17T 18T 19T
play 19T
handful 1T 2T 3T 4T 5T 6T 7T 8T 9T 10T
play 10T
play 20T
play 21T
play 6C
play AC
play 7C
play 11T
play 9T
play 10C
play KH
play 4H
play 10D
play 2C
play 9H
play QH
play 5H
play JC
play 3C
play 8C
play CH
play 6H
play JD
play 4C
play 9C
play JH
play 7H
play JS
play 5C
play 6D
play 10H
play 8H
play CC
play AD
play 7D
play 18T
play 8T
play CD
play 2D
play 8D
play 17T
play 7T
play CS
play 3D
play 9D
play 16T
play 6T
play QC
play 4D
play 5S
play 15T
play 5T
play QD
play 5D
play 6S
play 14T
play 4T
play QS
play AS
play 7S
play 13T
play 3T
play KD
play 2S
play 8S
play 12T
play 2T
play KS
play 3S
play 9S
play EXC
play 1T
play KC
play 4S
play 10S
status
\ No newline at end of file
tarot Copyright (C) 2018 Vivien Kraus
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `license' for details.
A game for 5 players, with call.
Score of P1: -1100.
Score of P2: -550.
Score of P3: 550.
Score of P4: 550.
Score of P5: 550.
setup -n 5 -w
deal --to P5 19T 18T 17T 16T 15T 14T 13T 12T 11T 1T EXC KH QH CH JH
bid take
bid pass
bid pass
bid pass
bid pass
decl pass
decl pass
decl pass
decl pass
decl slam
call KC
dog 7H 8H 9H
discard
handful 1T 11T 12T 13T 14T 15T 16T 17T 18T 19T
play 19T
play 10T
play 20T
play 21T
play 6C
play AC
play 7C
play 11T
play 9T
play 10C
play KH
play 4H
play 10D
play 2C
play 10H
play QH
play 5H
play JC
play 3C
play 8C
play CH
play 6H
play JD
play 4C
play 9C
play JH
play 7H
play JS
play 5C
play 6D
play 18T
play 8T
play CC
play AD
play 7D
play 17T
play 7T
play CD
play 2D
play 8D
play 16T
play 6T
play CS
play 3D
play 9D
play 15T
play 5T
play QC
play 4D
play 5S
play 14T
play 4T
play QD
play 5D
play 6S
play 13T
play 3T
play QS
play AS
play 7S
play 12T
play 2T
play KD
play 2S
play 8S
play 1T
play 8H
play KS
play 3S
play 9S
play EXC
play 9H
play KC
play 4S
play 10S
status
tarot Copyright (C) 2018 Vivien Kraus
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `license' for details.
A game for 5 players, with call.
Score of P1: -1040.
Score of P2: -520.
Score of P3: 520.
Score of P4: 520.
Score of P5: 520.
setup -n 5 -w
deal --to P5 19T 18T 17T 16T 15T 14T 13T 12T 11T EXC KH QH CH JH 10H
bid take
bid pass
bid pass
bid pass
bid pass
decl pass
decl pass
decl pass
decl pass
decl slam
call KC
dog 6H 7H 8H
discard
handful EXC 11T 12T 13T 14T 15T 16T 17T 18T 19T
play 19T
handful 1T 2T 3T 4T 5T 6T 7T 8T 9T 10T
play 10T
play 20T
play 21T
play 6C
play AC
play 7C
play 11T
play 9T
play 10C
play KH
play 4H
play 10D
play 2C
play 9H
play QH
play 5H
play JC
play 3C
play 8C
play CH
play 6H
play JD
play 4C
play 9C
play JH
play 7H
play JS
play 5C
play 6D
play 10H
play 8H
play CC
play AD
play 7D
play 18T
play 8T
play CD
play 2D
play 8D
play 17T
play 7T
play CS
play 3D
play 9D
play 16T
play 6T
play QC
play 4D
play 5S
play 15T
play 5T
play QD
play 5D
play 6S
play 14T
play 4T
play QS
play AS
play 7S
play 13T
play 3T
play KD
play 2S
play 8S
play 12T
play 1T
play KS
play 3S
play 9S
play EXC
play 2T
play KC
play 4S
play 10S
status
\ No newline at end of file
tarot Copyright (C) 2018 Vivien Kraus
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `license' for details.
A game for 5 players, with call.
Score of P1: -1080.
Score of P2: -540.
Score of P3: 540.
Score of P4: 540.
Score of P5: 540.
......@@ -132,6 +132,7 @@ tarot_decls_add (TarotDecls * decls, int next)
}
if (next)
{
decls_set_slammer (decls, decls_get_n_decls (decls));
decls_set_n_decls (decls, decls->n_players);
}
else
......
......@@ -314,6 +314,12 @@ tarot_doscard_infer (TarotDoscard * doscard, const TarotTricks * tricks)
{
return 1;
}
if (doscard_get_discard_done (doscard)
&& (tarot_hand_size (&(doscard->discard)) ==
tarot_doscard_size (doscard)))
{
return 0;
}
if (doscard_get_discard_done (doscard)
&& (tarot_hand_size (&(doscard->discard)) <
tarot_doscard_size (doscard)))
......@@ -334,7 +340,7 @@ tarot_doscard_infer (TarotDoscard * doscard, const TarotTricks * tricks)
}
for (i_trick = 0; i_trick < n_tricks; ++i_trick)
{
TarotTrick *trick = (TarotTrick *) & (tricks->tricks[i]);
TarotTrick *trick = (TarotTrick *) & (tricks->tricks[i_trick]);
assert (doscard->n_players == tarot_trick_n_cards (trick));
for (i_card = 0; i_card < doscard->n_players; ++i_card)
{
......@@ -360,6 +366,7 @@ tarot_doscard_infer (TarotDoscard * doscard, const TarotTricks * tricks)
(void) error;
assert (error == 0);
}
return 0;
}