-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathset-game.tex
144 lines (133 loc) · 4.41 KB
/
set-game.tex
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
% \documentclass[border=5mm]{standalone}
\documentclass[letterpaper]{article}
\usepackage[margin=.35in]{geometry}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{pgffor}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,patterns}
\usepackage{nopageno}
\begin{document}
\newcommand{\patlen}{.04in}
\pgfdeclarepatternformonly{stripes}
{\pgfpointorigin}{\pgfpoint{\patlen}{\patlen}}
{\pgfpoint{\patlen}{\patlen}}
{
\pgfpathmoveto{\pgfpoint{0}{0}}
\pgfpathlineto{\pgfpoint{0}{\patlen}}
\pgfpathlineto{\pgfpoint{.2*\patlen}{\patlen}}
\pgfpathlineto{\pgfpoint{.2*\patlen}{0}}
\pgfpathclose%
\pgfusepath{fill}
}
\makeatletter
\pgfdeclareshape{squiggle}{
\inheritsavedanchors[from=rectangle]
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{south west}
\inheritanchor[from=rectangle]{north east}
\backgroundpath{
\southwest
\pgfmathsetlengthmacro\my@xa{0.7*\pgf@x}
\pgfmathsetlengthmacro\my@ya{\pgf@y}
\northeast
\pgfmathsetlengthmacro\my@xb{0.7*\pgf@x}
\pgfmathsetlengthmacro\my@yb{\pgf@y}
% northwest
\pgfmathsetlengthmacro\my@xc{\my@xa}
\pgfmathsetlengthmacro\my@yc{0.7*\my@yb}
% first half of the path
\pgfpathmoveto{
\pgfpoint{\my@xa}{\my@ya}}
\pgfpathcurveto{
\pgfpoint{1.8*\my@xa}{1.7*\my@ya}}{
\pgfpoint{1.2*\my@xc}{0.74*\my@yc}}{
\pgfpoint{\my@xc}{\my@yc}}
\pgfpathcurveto{
\pgfpoint{\my@xc/3}{2.2*\my@yc}}{
\pgfpoint{\my@xb/3}{0.4*\my@yc}}{
\pgfpoint{\my@xb}{\my@yb}}
% southeast
\pgfmathsetlengthmacro\my@xc{\my@xb}
\pgfmathsetlengthmacro\my@yc{0.7*\my@ya}
% second half of the path
\pgfpathcurveto{
\pgfpoint{1.8*\my@xb}{1.7*\my@yb}}{
\pgfpoint{1.2*\my@xc}{0.74*\my@yc}}{
\pgfpoint{\my@xc}{\my@yc}}
\pgfpathcurveto{
\pgfpoint{\my@xc/3}{2.2*\my@yc}}{
\pgfpoint{\my@xa/3}{0.4*\my@yc}}{
\pgfpoint{\my@xa}{\my@ya}}
\pgfpathclose
}
}
\makeatother
\definecolor{SetRed}{RGB}{255,0,115}
\definecolor{SetGreen}{RGB}{45,203,60}
\definecolor{SetPurple}{RGB}{99,95,199}
\tikzstyle{card}=[draw,thick,rounded corners=.1in,
minimum width=1.75in,minimum height=2.5in]
% Shapes
\tikzstyle{symb}=[draw,line width=2pt,
minimum width=.9in,minimum height=.4in]
\tikzstyle{oval}=[symb,rectangle,rounded corners=.2in]
\tikzstyle{diam}=[symb,diamond,rounded corners=.01in]
\tikzstyle{squiggle}=[symb,shape=squiggle,rounded corners=0]
% Colours and fillings
\tikzstyle{rw}=[draw=SetRed,fill=White]
\tikzstyle{gw}=[draw=SetGreen,fill=White]
\tikzstyle{pw}=[draw=SetPurple,fill=White]
\tikzstyle{rf}=[draw=SetRed,fill=SetRed]
\tikzstyle{gf}=[draw=SetGreen,fill=SetGreen]
\tikzstyle{pf}=[draw=SetPurple,fill=SetPurple]
\tikzstyle{rs}=[draw=SetRed,pattern=stripes,pattern color=SetRed]
\tikzstyle{gs}=[draw=SetGreen,pattern=stripes,pattern color=SetGreen]
\tikzstyle{ps}=[draw=SetPurple,pattern=stripes,pattern color=SetPurple]
% \hspace{-1.7in}
% \begin{tikzpicture}
% \node[card] at (0,0) {\tikz{
% \node[diam,gw] at (0,0) {};}};
% \node[card] at (2in,0) {\tikz{
% \foreach \i in {1,2} {
% \node[squiggle,ps] at (0,\i*.6in) {};}}};
% \node[card] at (4in,0) {\tikz{
% \foreach \i in {1,2,3} {
% \node[oval,rf] at (0,\i*.6in) {};}}};
% \end{tikzpicture}
\noindent\foreach \shape in {oval,diam,squiggle} {
\begin{tikzpicture}
\foreach \num in {1,2,3} {
\foreach \colour [count=\ci] in {rw,gw,pw} {
\node[card] at (\num*2in,\ci*2.75in) {\tikz{
\foreach \i in {1,...,\num} {
\node[\shape,\colour] at (0,\i*.6in) {};}}};
}
\node[card] at (8in,\num*2.75in) {\tikz{
\foreach \i in {1,...,\num} {
\node[\shape,rf] at (0,\i*.6in) {};}}};
\node[card,rotate=90] at (\num*2.65in-.3in,.25in) {\tikz{
\foreach \i in {1,...,\num} {
\node[\shape,gf] at (0,\i*.6in) {};}}};
}
\end{tikzpicture}
\newline
\begin{tikzpicture}
\foreach \num in {1,2,3} {
\foreach \colour [count=\ci] in {rs,gs,ps} {
\node[card] at (\num*2in,\ci*2.75in) {\tikz{
\foreach \i in {1,...,\num} {
\node[\shape,\colour] at (0,\i*.6in) {};}}};
}
\node[card] at (8in,\num*2.75in) {\tikz{
\foreach \i in {1,...,\num} {
\node[\shape,pf] at (0,\i*.6in) {};}}};
}
\end{tikzpicture}
\newline
}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: