-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgame.sty
106 lines (98 loc) · 2.73 KB
/
game.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
%%
%% game --- style file for game-based proofs
%%
%% Author: Alex J. Malozemoff < amaloz@cs.umd.edu >
%%
\def\filename{crypto/game}
\def\fileversion{v0.1}
\def\filedate{2015/02/25}
\def\fileauthor{Alex J. Malozemoff}
\NeedsTeXFormat{LaTeX2e}
\AtEndOfPackage{\ProvidesPackage{\filename}
[\filedate\space\fileversion\space(\fileauthor)]}
\typeout{Package `\filename', \fileversion, <\filedate>}
\renewcommand{\gets}{:=}
\newcommand{\getsr}{{\:{\leftarrow{\hspace*{-3pt}\raisebox{.75pt}{$\scriptscriptstyle\$$}}}\:}}
\newcommand{\then}{;\;}
\newcommand{\andthen}{\colon\;}
\newcommand{\kwfont}{\textbf}
\newcommand{\constfont}[1]{{\textsf{#1}}}
\newcommand{\AND}{\mbox{\kwfont{and}}\xspace}
\newcommand{\NOT}{\mbox{\kwfont{not}}\xspace}
\newcommand{\AS}{\mbox{\kwfont{as}}\xspace}
\newcommand{\DO}{\mbox{\kwfont{do}}\xspace}
\newcommand{\IF}{\mbox{\kwfont{if}}\xspace}
\newcommand{\FI}{\mbox{\kwfont{fi}}\xspace}
\newcommand{\ELSE}{\mbox{\kwfont{else}}\xspace}
\newcommand{\ELSEIF}{\mbox{\kwfont{elseif}}\xspace}
\newcommand{\FOR}{\mbox{\kwfont{for}}\xspace}
\newcommand{\GAME}{\mbox{\kwfont{Game}}\xspace}
\newcommand{\INITIALIZE}{\mbox{\kwfont{Initialize}}\xspace}
\newcommand{\OD}{\mbox{\kwfont{od}}\xspace}
\newcommand{\OR}{\mbox{\kwfont{or}}\xspace}
\newcommand{\ORACLE}{\mbox{\kwfont{oracle}}\xspace}
\newcommand{\PARSE}{\mbox{\kwfont{parse}}\xspace}
\newcommand{\PROCEDURE}{\mbox{\kwfont{proc}}\xspace}
\newcommand{\PRIVATE}{\mbox{\kwfont{private}}\xspace}
\newcommand{\RETURN}{\mbox{\kwfont{return}}\xspace}
\newcommand{\SELECT}{\mbox{\kwfont{select}}\xspace}
\newcommand{\THEN}{\mbox{\kwfont{then}}\xspace}
\newcommand{\WHERE}{\mbox{\kwfont{where}}\xspace}
\newcommand{\TO}{\mbox{\kwfont{to}}\xspace}
\newcommand{\comment}[1]{~\mbox{\;\;\,/\hspace{-0.1ex}/\;\small\textrm{#1}}}
\newcommand{\concat}{\:\|\:}
\newcommand{\commentt}[1]{~\mbox{/\hspace{-0.1ex}/\;~\small\textrm{#1}}}
\newenvironment{code}[2]{
\small
\begin{center}
\fbox{\parbox{#1\textwidth}{%
\vspace{-13pt}
\begin{tabular}{l}
\hspace{-7pt}
\parbox[t]{\textwidth}{%
#2
}
\end{tabular}
\vspace{-3ex}
}
}
}{%
\end{center}
\vspace{-3ex}
}
\newenvironment{codetwo}[3]{%
\small
\begin{center}
\begin{tabular}{l}
\fbox{\parbox[t]{#1\textwidth}{%
#2
}}
\\
\fbox{\parbox[t]{#1\textwidth}{%
#3
}}
}{%
\end{tabular}
\vspace{-3ex}
\end{center}
}
\newenvironment{codethree}[4]{%
\small
\begin{center}
\begin{tabular}{l}
\fbox{\parbox[t]{#1\textwidth}{%
#2
}}
\\
\fbox{\parbox[t]{#1\textwidth}{%
#3
}}
\\
\fbox{\parbox[t]{#1\textwidth}{%
#4
}}
}{%
\end{tabular}
\vspace{-3ex}
\end{center}
}