Commit c0100ed0 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Merge branch '178-purge-the-useless-code' into 'develop'

Resolve "Purge the useless code"

Closes #178

See merge request !184
parents 83bd66de 2d31cf61
Pipeline #206694 passed with stages
in 43 minutes and 6 seconds
...@@ -50,14 +50,11 @@ ...@@ -50,14 +50,11 @@
/doc/petit-sec.c /doc/petit-sec.c
/doc/players-and-cards /doc/players-and-cards
/doc/players-and-cards.c /doc/players-and-cards.c
/doc/tarot-cnn-features.man
/doc/tarot-cnn.man
/doc/tarot-deal.man /doc/tarot-deal.man
/doc/tarot-features.man /doc/tarot-features.man
/doc/tarot-figures /doc/tarot-figures
/doc/tarot-mcts.man /doc/tarot-mcts.man
/doc/tarot-perceptron-bootstrap.man /doc/tarot-perceptron-bootstrap.man
/doc/tarot-stacking.man
/doc/tarot-status.man /doc/tarot-status.man
/doc/tarot-tune /doc/tarot-tune
/doc/tarot.info /doc/tarot.info
...@@ -84,9 +81,6 @@ ...@@ -84,9 +81,6 @@
/ltmain.sh /ltmain.sh
/m4 /m4
/missing /missing
/model/linear-*.h
/model/stacking.h
/model/tree-*.h
/nsi/setup.nsi /nsi/setup.nsi
/nsi/tarot.ico /nsi/tarot.ico
/po/*.gmo /po/*.gmo
...@@ -112,8 +106,6 @@ ...@@ -112,8 +106,6 @@
/snippet /snippet
/src/gettext.h /src/gettext.h
/src/libtarot/cards/check-cards /src/libtarot/cards/check-cards
/src/libtarot/features/features-header-encoded.txt
/src/libtarot/features/features-header.txt
/src/libtarot/gobject/tarot-enums-stamp /src/libtarot/gobject/tarot-enums-stamp
/src/libtarot/gobject/tarot-gobject.c /src/libtarot/gobject/tarot-gobject.c
/src/libtarot/gobject/tarot-gobject.h /src/libtarot/gobject/tarot-gobject.h
...@@ -150,14 +142,11 @@ ...@@ -150,14 +142,11 @@
/src/tarot-app/resources.c /src/tarot-app/resources.c
/src/tarot-app/server.c /src/tarot-app/server.c
/src/tarot-app/tarot /src/tarot-app/tarot
/src/tarot-app/tarot-cnn
/src/tarot-app/tarot-cnn-features
/src/tarot-app/tarot-deal /src/tarot-app/tarot-deal
/src/tarot-app/tarot-en /src/tarot-app/tarot-en
/src/tarot-app/tarot-features /src/tarot-app/tarot-features
/src/tarot-app/tarot-mcts /src/tarot-app/tarot-mcts
/src/tarot-app/tarot-parser-stamp /src/tarot-app/tarot-parser-stamp
/src/tarot-app/tarot-stacking
/src/tarot-app/tarot-status /src/tarot-app/tarot-status
/src/tarot-app/tarot-vala-stamp /src/tarot-app/tarot-vala-stamp
/src/tarot-app/tarot_app.h /src/tarot-app/tarot_app.h
......
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2017, 2018, 2019 Vivien Kraus # Copyright (C) 2017, 2018, 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -49,10 +49,6 @@ deb: ...@@ -49,10 +49,6 @@ deb:
- public - public
expire_in: 1 week expire_in: 1 week
generate:
stage: check
script: "./ci/generate.sh"
pages: pages:
stage: manual stage: manual
script: "./ci/pages.sh" script: "./ci/pages.sh"
......
...@@ -43,7 +43,6 @@ include screenshots/Makefile.am ...@@ -43,7 +43,6 @@ include screenshots/Makefile.am
include nsi/Makefile.am include nsi/Makefile.am
include debian/Makefile.am include debian/Makefile.am
include flatpak/Makefile.am include flatpak/Makefile.am
include model/Makefile.am
include git-check.am include git-check.am
include copyright/Makefile.am include copyright/Makefile.am
include guix/Makefile.am include guix/Makefile.am
...@@ -58,9 +57,9 @@ AM_CPPFLAGS += \ ...@@ -58,9 +57,9 @@ AM_CPPFLAGS += \
-DLIBTAROT_VERSION_INFO="\"$(LIBTOOL_CURRENT):$(LIBTOOL_REVISION):$(LIBTOOL_AGE)\"" -DLIBTAROT_VERSION_INFO="\"$(LIBTOOL_CURRENT):$(LIBTOOL_REVISION):$(LIBTOOL_AGE)\""
AM_YFLAGS = -d AM_YFLAGS = -d
AM_CFLAGS += \ AM_CFLAGS += \
$(NETTLE_CFLAGS) $(XML_CFLAGS) $(OPENMP_CFLAGS) $(NETTLE_CFLAGS) $(OPENMP_CFLAGS)
AM_LDADD += \ AM_LDADD += \
$(NETTLE_LIBS) $(XML_LIBS) $(GUILE_LIBS) $(OPENMP_LIBS) \ $(NETTLE_LIBS) $(GUILE_LIBS) $(OPENMP_LIBS) \
$(LIBTHREAD) \ $(LIBTHREAD) \
$(LIB_SETLOCALE) \ $(LIB_SETLOCALE) \
$(LIB_SETLOCALE_NULL) \ $(LIB_SETLOCALE_NULL) \
......
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2018, 2019 Vivien Kraus # Copyright (C) 2018, 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -18,6 +18,4 @@ EXTRA_DIST += \ ...@@ -18,6 +18,4 @@ EXTRA_DIST += \
%reldir%/pages.sh \ %reldir%/pages.sh \
%reldir%/check.sh \ %reldir%/check.sh \
%reldir%/mingw.sh \ %reldir%/mingw.sh \
%reldir%/generate.sh \
%reldir%/generate-seed.sh \
%reldir%/deb.sh %reldir%/deb.sh
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -20,8 +20,6 @@ apt-get install -y \ ...@@ -20,8 +20,6 @@ apt-get install -y \
build-essential \ build-essential \
guile-2.2-dev \ guile-2.2-dev \
libglib2.0-dev \ libglib2.0-dev \
libxml2 \
libxml2-dev \
nettle-dev \ nettle-dev \
pkg-config \ pkg-config \
valgrind valgrind
......
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -22,8 +22,6 @@ apt-get install -y \ ...@@ -22,8 +22,6 @@ apt-get install -y \
libglib2.0-dev \ libglib2.0-dev \
libgtk-3-0 \ libgtk-3-0 \
libgtk-3-dev \ libgtk-3-dev \
libxml2 \
libxml2-dev \
nettle-dev \ nettle-dev \
pkg-config \ pkg-config \
valgrind \ valgrind \
......
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -47,8 +47,6 @@ apt-get install -y \ ...@@ -47,8 +47,6 @@ apt-get install -y \
libglib2.0-dev \ libglib2.0-dev \
libgtk-3-dev \ libgtk-3-dev \
libtool \ libtool \
libxml2 \
libxml2-dev \
libxml2-utils \ libxml2-utils \
make \ make \
nettle-dev \ nettle-dev \
......
#!/bin/sh
# tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus
# 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, version 3 of the License.
#
# 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/>.
seed="$1"
version=$(cat ../dist/version)
for n_players in 3 4 5
do
>&2 echo "Generating $seed for version $version, $n_players players"
(tarot-deal -n $n_players -s $seed | tarot-mcts --generate -s $seed > $seed-${n_players}p.tarot-t \
&& mv $seed-${n_players}p.tarot-t dataset/generated/mcts/$seed-${n_players}p.tarot \
&& echo "no" > /tmp/all-mcts-${n_players}p-failed) \
|| >&2 echo "It failed."
(tarot-deal -n $n_players -s $seed | tarot-stacking --generate > $seed-${n_players}p.tarot-t \
&& mv $seed-${n_players}p.tarot-t dataset/generated/stacking/$version-$seed-${n_players}p.tarot \
&& echo "no" > /tmp/all-stacking-${n_players}p-failed) \
|| >&2 echo "It failed."
if [ "x$n_players" = "x5" ]
then
>&2 echo "Generating $seed for verision $version, 5 players with call"
(tarot-deal -n 5 -c -s $seed | tarot-mcts --generate -s $seed > $seed-5pc.tarot-t \
&& mv $seed-5pc.tarot-t dataset/generated/mcts/$seed-5pc.tarot \
&& echo "no" > /tmp/all-mcts-5pc-failed) \
|| >&2 echo "It failed."
(tarot-deal -n 5 -c -s $seed | tarot-stacking --generate > $seed-5pc.tarot-t \
&& mv $seed-5pc.tarot-t dataset/generated/stacking/$version-$seed-5pc.tarot \
&& echo "no" > /tmp/all-stacking-5pc-failed) \
|| >&2 echo "It failed."
fi
done
#!/bin/sh
# tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus
# 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, version 3 of the License.
#
# 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/>.
apt-get update
apt-get upgrade -y
apt-get install -y \
build-essential \
curl \
git \
guile-2.2-dev \
libcairo2-dev \
libgirepository1.0-dev \
libglib2.0-dev \
libgtk-3-dev \
libxml2 \
libxml2-dev \
nettle-dev \
parallel \
pkg-config \
valgrind
VERSION=$(cat dist/version)
cp dist/tarot-$VERSION.tar.gz . || exit 1
tar xf tarot-$VERSION.tar.gz || exit 1
mkdir build || exit 1
cd build/
../tarot-$VERSION/configure \
--enable-silent-rules=yes \
--enable-valgrind=yes \
|| (cat config.log; exit 1)
make -j 16 || exit 1
make install || exit 1
export PATH="/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
mkdir /root/.ssh || exit 1
echo "$SSH_KEY" > /root/.ssh/id_rsa || exit 1
echo "$SSH_KEY_PUB" > /root/.ssh/id_rsa.pub || exit 1
echo "$SSH_KNOWN_HOSTS" > /root/.ssh/known_hosts || exit 1
chmod go-rwx /root/.ssh/id_rsa || exit 1
git config --global user.email "vivien@planete-kraus.eu" || exit 1
git config --global user.name "Gitlab CI for the tarot package" || exit 1
git clone git@framagit.org:play-tarot/datasets.git dataset/ || exit 1
rm -rf dataset/generated/mcts
mkdir -p dataset/generated/mcts || exit 1
mkdir -p dataset/generated/stacking || exit 1
seq 1 10 | parallel ../tarot-$VERSION/ci/generate-seed.sh {}
for check in /tmp/all-*-*-failed
do
if test "x$(cat $check)" != "xno"
then
echo "Could not generate anything for test '$check'."
exit 1
fi
done
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -26,7 +26,6 @@ dnf install -y \ ...@@ -26,7 +26,6 @@ dnf install -y \
\ \
mingw64-gcc \ mingw64-gcc \
mingw64-nettle \ mingw64-nettle \
mingw64-libxml2 \
mingw64-glib2 \ mingw64-glib2 \
mingw64-cairo \ mingw64-cairo \
mingw64-gtk3 \ mingw64-gtk3 \
......
#!/bin/sh #!/bin/sh
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -20,8 +20,6 @@ apt-get install -y \ ...@@ -20,8 +20,6 @@ apt-get install -y \
build-essential \ build-essential \
jq \ jq \
libglib2.0-dev \ libglib2.0-dev \
libxml2 \
libxml2-dev \
nettle-dev \ nettle-dev \
pkg-config \ pkg-config \
texinfo \ texinfo \
......
...@@ -124,7 +124,6 @@ AS_IF([test "x$enable_program" != "xno"], [ ...@@ -124,7 +124,6 @@ AS_IF([test "x$enable_program" != "xno"], [
]) ])
]) ])
AX_LIB_NETTLE([yes]) AX_LIB_NETTLE([yes])
PKG_CHECK_MODULES([XML], [libxml-2.0])
AC_ARG_WITH([gobject], AS_HELP_STRING([--without-gobject], [Do not build the GObject bindings])) AC_ARG_WITH([gobject], AS_HELP_STRING([--without-gobject], [Do not build the GObject bindings]))
WITH_GOBJECT="no" WITH_GOBJECT="no"
AS_IF([test "x$with_gobject" != "xno"], [ AS_IF([test "x$with_gobject" != "xno"], [
......
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -17,7 +17,6 @@ check_PROGRAMS += \ ...@@ -17,7 +17,6 @@ check_PROGRAMS += \
%reldir%/basic-initialization \ %reldir%/basic-initialization \
%reldir%/players-and-cards \ %reldir%/players-and-cards \
%reldir%/events \ %reldir%/events \
%reldir%/xml \
%reldir%/petit-sec \ %reldir%/petit-sec \
%reldir%/duplicate-a-posteriori \ %reldir%/duplicate-a-posteriori \
%reldir%/dumb-ai %reldir%/dumb-ai
...@@ -25,7 +24,6 @@ check_PROGRAMS += \ ...@@ -25,7 +24,6 @@ check_PROGRAMS += \
%canon_reldir%_basic_initialization_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_basic_initialization_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_players_and_cards_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_players_and_cards_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_events_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_events_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_xml_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_petit_sec_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_petit_sec_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_duplicate_a_posteriori_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_duplicate_a_posteriori_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
%canon_reldir%_dumb_ai_LDADD = src/libtarot/libtarot.la $(AM_LDADD) %canon_reldir%_dumb_ai_LDADD = src/libtarot/libtarot.la $(AM_LDADD)
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2019 Vivien Kraus # Copyright (C) 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -15,23 +15,9 @@ ...@@ -15,23 +15,9 @@
dist_man6_MANS += \ dist_man6_MANS += \
%reldir%/tarot.man \ %reldir%/tarot.man \
%reldir%/tarot-status.man \
%reldir%/tarot-deal.man \
%reldir%/tarot-mcts.man \
%reldir%/tarot-stacking.man \
%reldir%/tarot-features.man \
%reldir%/tarot-cnn-features.man \
%reldir%/tarot-cnn.man \
%reldir%/tarot-perceptron-bootstrap.man %reldir%/tarot-perceptron-bootstrap.man
MAINTAINERCLEANFILES += \ MAINTAINERCLEANFILES += \
$(srcdir)/%reldir%/tarot.man \ $(srcdir)/%reldir%/tarot.man \
$(srcdir)/%reldir%/tarot-status.man \
$(srcdir)/%reldir%/tarot-deal.man \
$(srcdir)/%reldir%/tarot-mcts.man \
$(srcdir)/%reldir%/tarot-stacking.man \
$(srcdir)/%reldir%/tarot-features.man \
$(srcdir)/%reldir%/tarot-cnn-features.man \
$(srcdir)/%reldir%/tarot-cnn.man \
$(srcdir)/%reldir%/tarot-perceptron-bootstrap.man $(srcdir)/%reldir%/tarot-perceptron-bootstrap.man
help2man_verbose = $(help2man_verbose_@AM_V@) help2man_verbose = $(help2man_verbose_@AM_V@)
...@@ -42,34 +28,6 @@ $(srcdir)/%reldir%/tarot.man: src/tarot-app/main.vala ...@@ -42,34 +28,6 @@ $(srcdir)/%reldir%/tarot.man: src/tarot-app/main.vala
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot $(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot
$(help2man_verbose) ./pre-inst-env help2man tarot > $(srcdir)/%reldir%/tarot.man $(help2man_verbose) ./pre-inst-env help2man tarot > $(srcdir)/%reldir%/tarot.man
$(srcdir)/%reldir%/tarot-status.man: src/tarot-app/tarot_status.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-status
$(help2man_verbose) ./pre-inst-env help2man tarot-status > $@
$(srcdir)/%reldir%/tarot-deal.man: src/tarot-app/tarot_deal.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-deal
$(help2man_verbose) ./pre-inst-env help2man tarot-deal > $@
$(srcdir)/%reldir%/tarot-mcts.man: src/tarot-app/tarot_mcts.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-mcts
$(help2man_verbose) ./pre-inst-env help2man tarot-mcts > $@
$(srcdir)/%reldir%/tarot-stacking.man: src/tarot-app/tarot_stacking.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-stacking
$(help2man_verbose) ./pre-inst-env help2man tarot-stacking > $@
$(srcdir)/%reldir%/tarot-features.man: src/tarot-app/tarot_features.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-features
$(help2man_verbose) ./pre-inst-env help2man tarot-features > $@
$(srcdir)/%reldir%/tarot-cnn-features.man: src/tarot-app/tarot_cnn_features.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-cnn-features
$(help2man_verbose) ./pre-inst-env help2man tarot-cnn-features > $@
$(srcdir)/%reldir%/tarot-cnn.man: src/tarot-app/tarot_cnn.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-cnn
$(help2man_verbose) ./pre-inst-env help2man tarot-cnn > $@
$(srcdir)/%reldir%/tarot-perceptron-bootstrap.man: src/tarot-app/tarot_perceptron_bootstrap.c $(srcdir)/%reldir%/tarot-perceptron-bootstrap.man: src/tarot-app/tarot_perceptron_bootstrap.c
$(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-perceptron-bootstrap $(MAKE) $(AM_MAKEFLAGS) src/tarot-app/tarot-perceptron-bootstrap
$(help2man_verbose) ./pre-inst-env help2man tarot-perceptron-bootstrap > $@ $(help2man_verbose) ./pre-inst-env help2man tarot-perceptron-bootstrap > $@
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2017, 2018, 2019 Vivien Kraus # Copyright (C) 2017, 2018, 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -18,7 +18,6 @@ TANGLED = \ ...@@ -18,7 +18,6 @@ TANGLED = \
$(srcdir)/%reldir%/players-and-cards.c \ $(srcdir)/%reldir%/players-and-cards.c \
$(srcdir)/%reldir%/events.c \ $(srcdir)/%reldir%/events.c \
$(srcdir)/%reldir%/petit-sec.c \ $(srcdir)/%reldir%/petit-sec.c \
$(srcdir)/%reldir%/xml.c \
$(srcdir)/%reldir%/duplicate-a-posteriori.c \ $(srcdir)/%reldir%/duplicate-a-posteriori.c \
$(srcdir)/%reldir%/dumb-ai.c \ $(srcdir)/%reldir%/dumb-ai.c \
$(srcdir)/%reldir%/tarot.rng $(srcdir)/%reldir%/tarot.rng
......
# tarot implements the rules of the tarot game # tarot implements the rules of the tarot game
# Copyright (C) 2017, 2018, 2019 Vivien Kraus # Copyright (C) 2017, 2018, 2019, 2020 Vivien Kraus
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -694,37 +694,6 @@ option. ...@@ -694,37 +694,6 @@ option.
LANG=C tarot --help LANG=C tarot --help
#+END_SRC #+END_SRC
** Additional command-line programs
The tarot distribution provides a few other command-line programs:
- =tarot-status= reads a game from the standard input and prints some
informations about the game. There are three kinds of information,
based on the command-line argument:
- if it is =next=, then print the player ID of the next player, or
fails if the game does not have a player to play,
- if it is =at-end=, then it does not print anything but succeeds if
the game is finished, and fails otherwise,
- if it is =score=, then it prints the score for each player, one
row for each player. It fails if the game is not finished,
- if it is =errors=, then it prints the amount of errors that the
players made;
- =tarot-deal= prints a game which has been dealt for all players,
based on the following options:
- =--n-players=: set the number of players,
- =--call-allowed= / =--no-call-allowed=: the game allows a call or
not,
- =--seed=STRING=: set the random seed for the pseudo-random number
generator;
- =tarot-mcts=: reads a game from the standard input, play the next
move as the MCTS, and print the modified game;
- =tarot-stacking=: reads a game from the standard input, play the
next move as the stacking algorithm, and print the modified game;
- =tarot-features=: reads a game from the standard input, and compute
high-level features that can be used for machine learning as an ARFF
file, with a header and a data section. It has an =--encoded=
option to output the features as numerical data (so that it works
better with a regression). The header is distributed with this
package, but the programs will refuse to run if the header is not
compatible with the tarot version.
* Programming with libtarot * Programming with libtarot
Libtarot is the library that you can use in your own program. In Libtarot is the library that you can use in your own program. In
order to use it, you may use the =pkg-config= configuration file that order to use it, you may use the =pkg-config= configuration file that
...@@ -1238,7 +1207,6 @@ Release /object/ that has been allocated with the corresponding ...@@ -1238,7 +1207,6 @@ Release /object/ that has been allocated with the corresponding
#+begin_deftypefun #+begin_deftypefun
An enumeration of errror codes for the game API. It has: An enumeration of errror codes for the game API. It has:
- =TAROT_GAME_OK= = 0, if the operation succeeded; - =TAROT_GAME_OK= = 0, if the operation succeeded;
- =TAROT_GAME_INVXML=, when loading from a document that is not an XML document;
- =TAROT_GAME_INVEV=, when adding an invalid or unexpected event; - =TAROT_GAME_INVEV=, when adding an invalid or unexpected event;
- =TAROT_GAME_NA=, when querying game properties that are not set; - =TAROT_GAME_NA=, when querying game properties that are not set;
- =TAROT_GAME_TOOLATE=, when we set a duplicaté option after it would - =TAROT_GAME_TOOLATE=, when we set a duplicaté option after it would
...@@ -1421,37 +1389,7 @@ functions. ...@@ -1421,37 +1389,7 @@ functions.
Return the data associated to the current position of /iterator/, and Return the data associated to the current position of /iterator/, and
advance /iterator/ to the next position. advance /iterator/ to the next position.
#+end_deftypefun #+end_deftypefun
** XML representation of games
#+attr_texinfo: :options {size_t} tarot_game_construct (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment})
#+begin_deftypefun
#+texinfo: @deftypefunx {size_t} tarot_game_iterator_construct (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, const TarotGame *@var{game})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_setup (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, size_t @var{n_players}, int @var{with_call})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_deal (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, TarotPlayer @var{myself}, size_t @var{n_cards}, const TarotCard *@var{cards})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_deal_all (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, size_t @var{n_owners}, const TarotPlayer *@var{owners})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_deal_all_random (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, size_t @var{n_players}, size_t @var{seed_size}, const void *@var{seed})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_bid (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, TarotBid @var{bid})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_decl (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, int @var{slam})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_call (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, TarotCard @var{call})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_dog (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, size_t @var{n_cards}, const TarotCard *@var{cards})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_discard (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, size_t @var{n_cards}, const TarotCard *@var{cards})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_handful (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, size_t @var{n_cards}, const TarotCard *@var{cards})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_card (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, TarotCard @var{card})
#+texinfo: @deftypefunx {size_t} tarot_game_event_construct_copy (size_t @var{maxmem}, char *@var{mem}, size_t *@var{alignment}, const TarotGameEvent *@var{event})
#+texinfo: @deftypefunx {size_t} tarot_counter_construct (size_t @var{maxmem}, char *@var{memout}, size_t *@var{alignment})
If you want to control how memory is allocated, because you have a
very good specific memory allocator you want to use, then you will not
be satisfied by the =tarot_*_alloc= / =tarot_*_dup= family of
functions. This function constructs in place a new object in /mem/
(only used if /maxmem/ is sufficiently large), and return the actual
number of bytes that are needed to hold the game state. The return
value is never 0.
If /maxmem/ is sufficiently large, then /mem/ should be aligned to the
value set in /alignment/ from the previous call. In most cases you