@jutge.org/toolkit 4.2.23 → 4.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/problems/games/the-walking-dead.pbm/README.md +12 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/Makefile +6 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/api.tex +246 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/defs.tex +2 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/main.tex +63 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/programming.tex +452 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/rules.tex +222 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/screenshot.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/tips.tex +81 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/twd.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc/viewer.tex +41 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/Makefile +6 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/api.tex +246 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/defs.tex +2 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/main.tex +63 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/programming.tex +176 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/rules.tex +194 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/screenshot.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/tips.tex +85 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/twd.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Doc-eng/viewer.tex +36 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.Linux64 +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.Linux64.Debug +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.MacOS +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.MacOS.ARM +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.MacOS.ARM.Debug +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/AIDummy.o.MacOS.Debug +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.Linux64 +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.Linux64.Debug +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.MacOS +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.MacOS.ARM +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.MacOS.ARM.Debug +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Obj/Board.o.MacOS.Debug +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/AIDemo.cc +89 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/AIDummy.cc +202 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/AINull.cc +37 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Action.cc +34 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Action.hh +107 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Board.cc +1149 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Board.hh +287 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Defs.hh +2 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Game.cc +55 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Game.hh +23 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Info.cc +174 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Info.hh +129 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Main.cc +83 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Makefile +56 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Player.cc +66 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Player.hh +63 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/README.txt +9 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Random.cc +3 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Random.hh +100 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Registry.cc +28 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Registry.hh +42 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/SecGame.cc +368 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/SecGame.hh +90 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/SecMain.cc +99 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Settings.cc +67 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Settings.hh +175 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/State.cc +3 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/State.hh +188 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Structs.cc +3 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Structs.hh +377 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Utils.cc +3 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/Utils.hh +77 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/default-fixed.cnf +120 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Runner/default.cnf +17 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/css/ui-lightness/jquery-ui-1.8.18.custom.css +310 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/help.html +18 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_close.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_end.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_help.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_pause.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_play.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_refresh.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/but_start.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/img/logo.png +0 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/js/jquery-1.7.1.min.js +4 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/js/jquery-ui-1.8.18.custom.min.js +49 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/sample.out +52807 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/viewer.html +118 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/viewer.js +846 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/Viewer/viewer.sh +28 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/handler.yml +6 -0
- package/assets/problems/games/the-walking-dead.pbm/ca/problem.ca.yml +3 -0
- package/assets/prompts/creators/create-solution.tpl.txt +15 -8
- package/assets/prompts/proglangs/cc.md +6 -2
- package/assets/prompts/proglangs/py.md +10 -6
- package/dist/index.js +370 -366
- package/docs/getting-started-guide.md +1 -1
- package/docs/install-linux.md +1 -1
- package/docs/install-macos.md +1 -1
- package/docs/install-windows.md +1 -1
- package/package.json +12 -12
- package/toolkit/ask.ts +0 -2
- package/toolkit/doctor.ts +1 -1
- package/toolkit/make.ts +2 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# The Walking Dead
|
|
2
|
+
|
|
3
|
+
## Features
|
|
4
|
+
|
|
5
|
+
- Zombie apocalypse game
|
|
6
|
+
- Turn-based gameplay
|
|
7
|
+
- Multiple languages (English and Catalan)
|
|
8
|
+
- Hides some files from the user to make the problem more challenging
|
|
9
|
+
|
|
10
|
+
## Abstract
|
|
11
|
+
|
|
12
|
+
This problem is an example of a game problem on Jutge.org.
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
\documentclass[catalan]{article}
|
|
2
|
+
\pagestyle{plain}
|
|
3
|
+
|
|
4
|
+
\usepackage{float}
|
|
5
|
+
\usepackage[utf8]{inputenc}
|
|
6
|
+
\usepackage{graphicx}
|
|
7
|
+
\usepackage{mdwlist}
|
|
8
|
+
\usepackage{textcomp}
|
|
9
|
+
\usepackage{mathpazo}
|
|
10
|
+
\usepackage{listings}
|
|
11
|
+
\usepackage{parskip}
|
|
12
|
+
\usepackage{color}
|
|
13
|
+
\usepackage{xspace}
|
|
14
|
+
\usepackage{url}
|
|
15
|
+
|
|
16
|
+
\makeatletter
|
|
17
|
+
\usepackage[catalan]{babel}
|
|
18
|
+
\makeatother
|
|
19
|
+
|
|
20
|
+
\newcommand{\warning}[1]{{\color{red} #1}}
|
|
21
|
+
|
|
22
|
+
\input{defs}
|
|
23
|
+
|
|
24
|
+
%%% LISTINGS
|
|
25
|
+
|
|
26
|
+
\lstset{language=C++}
|
|
27
|
+
\lstset{columns=flexible}
|
|
28
|
+
%\lstset{basewidth={1em,1em}}
|
|
29
|
+
\lstset{keepspaces=true}
|
|
30
|
+
\lstset{morekeywords={include,cin,cout,cerr,endl,null,string}}
|
|
31
|
+
\lstset{deletekeywords={for}}
|
|
32
|
+
\lstset{belowskip=0mm}
|
|
33
|
+
\lstset{stringstyle={}}
|
|
34
|
+
\lstset{commentstyle={}}
|
|
35
|
+
\lstset{numberstyle=\tiny\sffamily}
|
|
36
|
+
\lstset{numbersep=-5pt}
|
|
37
|
+
\lstset{keywordstyle=\bfseries}
|
|
38
|
+
\lstset{identifierstyle=\itshape}
|
|
39
|
+
\lstset{showstringspaces=false}
|
|
40
|
+
\lstset{upquote=true}
|
|
41
|
+
\lstset{texcl=true}
|
|
42
|
+
\lstset{mathescape=true}
|
|
43
|
+
\lstset{literate={->}{$\rightarrow$}1 {<=}{$\le$}1 {>=}{$\ge$}1 {!=}{$\neq$}1 {<<}{$<\!\!\!<$}2 {>>}{$>\!\!\!>$}2}
|
|
44
|
+
\lstset{xleftmargin=0.3cm}
|
|
45
|
+
\lstMakeShortInline@
|
|
46
|
+
|
|
47
|
+
\begin{document}
|
|
48
|
+
|
|
49
|
+
\begin{center}
|
|
50
|
+
{\bf \Large{Summarized API for playing The Walking Dead}}
|
|
51
|
+
\end{center}
|
|
52
|
+
|
|
53
|
+
\bigskip
|
|
54
|
+
This short document briefly presents the main types, classes and methods that you
|
|
55
|
+
may need to program your player.
|
|
56
|
+
|
|
57
|
+
{\bf Positions and directions.}
|
|
58
|
+
\begin{lstlisting}
|
|
59
|
+
// Enum to encode directions. Alive units cannot move diagonally
|
|
60
|
+
enum Dir {
|
|
61
|
+
Down, DR, Right, RU, Up, UL, Left, LD
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// Simple struct to handle positions.
|
|
65
|
+
struct Pos {
|
|
66
|
+
int i, j;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
Pos (int i, int j);
|
|
70
|
+
// Example: Pos p(3, 6);
|
|
71
|
+
|
|
72
|
+
ostream& operator<< (ostream& os, const Pos& p);
|
|
73
|
+
// Example: cerr $<\!\!<$ p $<\!\!<$ endl;
|
|
74
|
+
|
|
75
|
+
bool operator== (const Pos& a, const Pos& b);
|
|
76
|
+
// Example: if (p == Pos(3, 2)) ...
|
|
77
|
+
|
|
78
|
+
bool operator $!\!=$ (const Pos& a, const Pos& b);
|
|
79
|
+
// Example: if (p != Pos(3, 2)) ...
|
|
80
|
+
|
|
81
|
+
/ Compares using lexicographical order (first by i, then by j).
|
|
82
|
+
// If needed, you can sort vectors of positions or build sets of positions.
|
|
83
|
+
bool operator< (const Pos& a, const Pos& b);
|
|
84
|
+
// Example: if (p $<$ Pos(3, 2)) ...
|
|
85
|
+
|
|
86
|
+
Pos& operator+= (Dir d);
|
|
87
|
+
// Example: p += Right;
|
|
88
|
+
|
|
89
|
+
Pos operator+ (Dir d );
|
|
90
|
+
// Example: Pos p2 = p + Left;
|
|
91
|
+
|
|
92
|
+
Pos& operator+= (Pos p);
|
|
93
|
+
// Example: p += Pos(3, 2);
|
|
94
|
+
|
|
95
|
+
Pos operator+ (Pos p );
|
|
96
|
+
// Example: p2 = p + Pos(3, 2);
|
|
97
|
+
|
|
98
|
+
// Returns whether (i, j) is a position inside the board.
|
|
99
|
+
bool pos$\_$ok (int i , int j );
|
|
100
|
+
// Example: if (pos ok(i + 1, j - 1)) ...
|
|
101
|
+
|
|
102
|
+
// Returns whether p is a position inside the board.
|
|
103
|
+
bool pos$\_$ok (Pos p );
|
|
104
|
+
// Example: if (pos ok(p1 + Down)) ...
|
|
105
|
+
\end{lstlisting}
|
|
106
|
+
|
|
107
|
+
\medskip
|
|
108
|
+
{\bf State of the game.}
|
|
109
|
+
\begin{lstlisting}
|
|
110
|
+
// Returns whether pl is a valid player identifier.
|
|
111
|
+
bool player$\_$ok (int pl) const;
|
|
112
|
+
|
|
113
|
+
// Identifier of your player, between 0 and 3.
|
|
114
|
+
int me ();
|
|
115
|
+
|
|
116
|
+
// Defines kinds of cells.
|
|
117
|
+
enum CellType {
|
|
118
|
+
Street,
|
|
119
|
+
Waste
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// Describes a cell on the board, and its contents.
|
|
123
|
+
struct Cell {
|
|
124
|
+
CellType type; // The kind of cell (street or waste).
|
|
125
|
+
int owner; // The player that owns it, otherwise -1.
|
|
126
|
+
int id; // The id of a unit if present, or -1 otherwise.
|
|
127
|
+
bool food; // Whether it contains food
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// Defines the type of the unit.
|
|
131
|
+
enum UnitType {
|
|
132
|
+
Alive,
|
|
133
|
+
Dead,
|
|
134
|
+
Zombie
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// Describes an unit on the board and its properties.
|
|
138
|
+
struct Unit {
|
|
139
|
+
UnitType type; // The type of unit.
|
|
140
|
+
int id; // The unique id of this unit during the game.
|
|
141
|
+
int player; // The player that owns this unit
|
|
142
|
+
// (-1 if is a zombie)
|
|
143
|
+
Pos pos; // The position on the board.
|
|
144
|
+
int rounds$\_$for$\_$zombie; // Rounds before it becomes a zombie
|
|
145
|
+
// (-1 if is not being converted to zombie)
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// Returns the current round.
|
|
149
|
+
int round () const;
|
|
150
|
+
|
|
151
|
+
// Returns a copy of the cell at (i, j).
|
|
152
|
+
Cell cell (int i, int j) const;
|
|
153
|
+
// Example: Cell c3 = cell(3, 6);
|
|
154
|
+
|
|
155
|
+
// Returns a copy of the cell at p.
|
|
156
|
+
Cell cell (Pos p) const;
|
|
157
|
+
// Example: Cell c2 = cell(p);
|
|
158
|
+
|
|
159
|
+
// Returns a copy of the unit with identifier id.
|
|
160
|
+
Unit unit (int id) const;
|
|
161
|
+
// Example: Unit u2 = unit(23);
|
|
162
|
+
|
|
163
|
+
// Returns the ids of the alive units of a player
|
|
164
|
+
vector$<$int$>$ alive$\_$units (int pl) const;
|
|
165
|
+
// Example: vector$<$int$>$ au = alive$\_$units(3);
|
|
166
|
+
|
|
167
|
+
// Returns the ids of the dead units of a player
|
|
168
|
+
vector$<$int$>$ dead$\_$units (int pl) const;
|
|
169
|
+
// Example: vector$<$int$>$ du = dead$\_$units(0)
|
|
170
|
+
|
|
171
|
+
// Returns the ids of the zombies
|
|
172
|
+
vector$<$int$>$ zombies () const;
|
|
173
|
+
// Example: vector$<$int$>$ z = zombies();
|
|
174
|
+
|
|
175
|
+
// Returns the current strength of a player ( strength$\_$points/alive$\_$units )
|
|
176
|
+
int strength (int pl) const;
|
|
177
|
+
|
|
178
|
+
// Returns the current score of a player.
|
|
179
|
+
int score (int pl) const;
|
|
180
|
+
\end{lstlisting}
|
|
181
|
+
|
|
182
|
+
\bigskip
|
|
183
|
+
{\bf Command actions.}
|
|
184
|
+
\begin{lstlisting}
|
|
185
|
+
// Commands unit with identifier id to move following direction dir.
|
|
186
|
+
void move (int id, Dir dir);
|
|
187
|
+
// Example: move(23,Down);
|
|
188
|
+
\end{lstlisting}
|
|
189
|
+
|
|
190
|
+
\bigskip
|
|
191
|
+
{\bf Initial settings.}
|
|
192
|
+
\begin{lstlisting}
|
|
193
|
+
// Returns the number of players in the game.
|
|
194
|
+
int num$\_$players () const;
|
|
195
|
+
|
|
196
|
+
// Returns the number of rounds a match lasts.
|
|
197
|
+
int num$\_$rounds () const;
|
|
198
|
+
|
|
199
|
+
// Returns the number of rows of the board.
|
|
200
|
+
int board$\_$rows () const;
|
|
201
|
+
|
|
202
|
+
// Returns the number of columns of the board.
|
|
203
|
+
int board$\_$cols () const;
|
|
204
|
+
|
|
205
|
+
// Returns the initial number of units per clan
|
|
206
|
+
int num$\_$ini$\_$units$\_$per$\_$clan () const;
|
|
207
|
+
|
|
208
|
+
// Returns the initial number of zombies on the board
|
|
209
|
+
int num$\_$ini$\_$zombies () const;
|
|
210
|
+
|
|
211
|
+
// Returns the initial number of food items on the board
|
|
212
|
+
int num$\_$ini$\_$food () const;
|
|
213
|
+
|
|
214
|
+
// Returns the initial strength of each clan
|
|
215
|
+
int clan$\_$ini$\_$strength () const;
|
|
216
|
+
|
|
217
|
+
// Returns the points obtained after killing a person
|
|
218
|
+
int points$\_$for$\_$killing$\_$person () const;
|
|
219
|
+
|
|
220
|
+
// Returns the points obtained after killing a zombie
|
|
221
|
+
int points$\_$for$\_$killing$\_$zombie () const;
|
|
222
|
+
|
|
223
|
+
// Returns the points obtained for each owned cell at the end of a round
|
|
224
|
+
int points$\_$per$\_$owned$\_$cell () const;
|
|
225
|
+
|
|
226
|
+
// Returns the units of strenght obtained by eating an item of food
|
|
227
|
+
int food$\_$strength () const;
|
|
228
|
+
|
|
229
|
+
// Returns the number of rounds before a bitten/dead person
|
|
230
|
+
// becomes a zombie
|
|
231
|
+
int rounds$\_$before$\_$becoming$\_$zombie () const;
|
|
232
|
+
\end{lstlisting}
|
|
233
|
+
|
|
234
|
+
\bigskip
|
|
235
|
+
{\bf Random.}
|
|
236
|
+
\begin{lstlisting}
|
|
237
|
+
// Returns a random integer in [l..u]. u - l + 1 must be between 1 and $10^6$ .
|
|
238
|
+
int random (int l , int u );
|
|
239
|
+
// Example: if (random(0, 4) $<$ 2) whatever();
|
|
240
|
+
// This code executes whatever() with probability 2/5.
|
|
241
|
+
|
|
242
|
+
// Returns a random permutation of [0..n-1]. n must be between 0 and $10^6$.
|
|
243
|
+
vector$<$int$>$ random permutation (int n);
|
|
244
|
+
\end{lstlisting}
|
|
245
|
+
|
|
246
|
+
\end{document}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
\documentclass[catalan]{article}
|
|
2
|
+
\pagestyle{plain}
|
|
3
|
+
|
|
4
|
+
\usepackage{float}
|
|
5
|
+
\usepackage[utf8]{inputenc}
|
|
6
|
+
\usepackage{graphicx}
|
|
7
|
+
\usepackage{mdwlist}
|
|
8
|
+
\usepackage{textcomp}
|
|
9
|
+
\usepackage{mathpazo}
|
|
10
|
+
\usepackage{listings}
|
|
11
|
+
\usepackage{parskip}
|
|
12
|
+
\usepackage{color}
|
|
13
|
+
\usepackage{xspace}
|
|
14
|
+
\usepackage{url}
|
|
15
|
+
|
|
16
|
+
\makeatletter
|
|
17
|
+
\usepackage[catalan]{babel}
|
|
18
|
+
\makeatother
|
|
19
|
+
|
|
20
|
+
\newcommand{\warning}[1]{{\color{red} #1}}
|
|
21
|
+
|
|
22
|
+
\input{defs}
|
|
23
|
+
|
|
24
|
+
%%% LISTINGS
|
|
25
|
+
|
|
26
|
+
\lstset{language=C++}
|
|
27
|
+
\lstset{columns=flexible}
|
|
28
|
+
%\lstset{basewidth={1em,1em}}
|
|
29
|
+
\lstset{keepspaces=true}
|
|
30
|
+
\lstset{morekeywords={include,cin,cout,cerr,endl,null,string}}
|
|
31
|
+
\lstset{belowskip=0mm}
|
|
32
|
+
\lstset{stringstyle={}}
|
|
33
|
+
\lstset{commentstyle={}}
|
|
34
|
+
\lstset{numberstyle=\tiny\sffamily}
|
|
35
|
+
\lstset{numbersep=-5pt}
|
|
36
|
+
\lstset{keywordstyle=\bfseries}
|
|
37
|
+
\lstset{identifierstyle=\itshape}
|
|
38
|
+
\lstset{showstringspaces=false}
|
|
39
|
+
\lstset{upquote=true}
|
|
40
|
+
\lstset{texcl=true}
|
|
41
|
+
\lstset{mathescape=true}
|
|
42
|
+
\lstset{literate={->}{$\rightarrow$}1 {<=}{$\le$}1 {>=}{$\ge$}1 {!=}{$\neq$}1 {<<}{$<\!\!\!<$}2 {>>}{$>\!\!\!>$}2}
|
|
43
|
+
\lstset{xleftmargin=0.8cm}
|
|
44
|
+
\lstMakeShortInline@
|
|
45
|
+
|
|
46
|
+
\begin{document}
|
|
47
|
+
|
|
48
|
+
\title{\textbf{\large \gameName}}
|
|
49
|
+
\author{\gameAuthor}
|
|
50
|
+
\maketitle
|
|
51
|
+
|
|
52
|
+
\bigskip
|
|
53
|
+
\begin{center}
|
|
54
|
+
\includegraphics[width=13cm]{twd.png}
|
|
55
|
+
\end{center}
|
|
56
|
+
|
|
57
|
+
\newpage
|
|
58
|
+
\input{rules}
|
|
59
|
+
\input{viewer}
|
|
60
|
+
\input{programming}
|
|
61
|
+
\input{tips}
|
|
62
|
+
|
|
63
|
+
\end{document}
|