summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/wordle/doc/wordle-doc-en.tex
blob: 06352f5ad5f57f0c90bd2370f0b204427c159cf2 (plain)
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
% !TeX TXS-program:compile = txs:///arara
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode}
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')

\documentclass[english,a4paper,11pt]{article}
\usepackage[margin=2cm,includefoot]{geometry}
\def\TPversion{0.1.1}
\def\TPdate{03/09/2023}
\usepackage{amssymb,amsfonts,amsmath}
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{wordle}
\usepackage{awesomebox}
\usepackage{fontawesome5}
\usepackage{footnote}
\makesavenoteenv{tabular}
\usepackage{enumitem}
\usepackage{tabularray}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\lfoot{\sffamily\small [wordle]}
\cfoot{\sffamily\small - \thepage{} -}
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}

%\usepackage{hvlogos}
\usepackage{xspace}
\usepackage{hologo}
\providecommand\tikzlogo{Ti\textit{k}Z}
\providecommand\TeXLive{\TeX{}Live\xspace}
\providecommand\PSTricks{\textsf{PSTricks}\xspace}
\let\pstricks\PSTricks
\let\TikZ\tikzlogo
\newcommand\TableauDocumentation{%
	\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}}
		{\LARGE \LaTeX} & & & & &\\
		& {\LARGE \hologo{pdfLaTeX}} & & & & \\
		& & {\LARGE \hologo{LuaLaTeX}} & & & \\
		& & & {\LARGE \TikZ} & & \\
		& & & & {\LARGE \TeXLive} & \\
		& & & & & {\LARGE \hologo{MiKTeX}} \\
	\end{tblr}
}

\usepackage{hyperref}
\urlstyle{same}
\hypersetup{pdfborder=0 0 0}
\setlength{\parindent}{0pt}
\definecolor{LightGray}{gray}{0.9}

\usepackage{babel}
%\AddThinSpaceBeforeFootnotes
%\FrenchFootnotes

\usepackage{listings}

\usepackage{newverbs}
\newverbcommand{\motcletex}{\color{cyan!75!black}}{}
\newverbcommand{\packagetex}{\color{violet!75!black}}{}

\usepackage[most]{tcolorbox}
\tcbuselibrary{listingsutf8}
\newtcblisting{DemoCode}[1][]{%
	enhanced,width=0.95\linewidth,center,%
	bicolor,size=title,%
	colback=cyan!2!white,%
	colbacklower=cyan!1!white,%
	colframe=cyan!75!black,%
	listing options={%
		breaklines=true,%
		breakatwhitespace=true,%
		style=tcblatex,basicstyle=\small\ttfamily,%
		tabsize=4,%
		commentstyle={\itshape\color{gray}},
		keywordstyle={\color{blue}},%
		classoffset=0,%
		keywords={},%
		alsoletter={-},%
		keywordstyle={\color{blue}},%
		classoffset=1,%
		alsoletter={-},%
		morekeywords={center,justify},%
		keywordstyle={\color{violet}},%
		classoffset=2,%
		alsoletter={-},%
		morekeywords={WordleGrid},%
		keywordstyle={\color{green!50!black}},%
		classoffset=3,%
		morekeywords={Colors,Rounded,Unit,Font,ColorLetters,Letters,Style,Thickness,BorderColor},%
		keywordstyle={\color{orange}}
	},%
	#1
}

\tcbset{vignettes/.style={%
	nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,%
	boxrule=0.75pt,left=7pt,right=1pt,top=0pt,bottom=0.25pt,%
	}
}

\tcbset{vignetteMaJ/.style={%
	fontupper={\vphantom{pf}\footnotesize\ttfamily},
	vignettes,colframe=purple!50!black,coltitle=white,colback=purple!10,%
	overlay={\begin{tcbclipinterior}%
			\fill[fill=purple!75]($(interior.south west)$) rectangle node[rotate=90]{\tiny \sffamily{\textcolor{black}{\scalebox{0.66}[0.66]{\textbf{MàJ}}}}} ($(interior.north west)+(5pt,0pt)$);%
	\end{tcbclipinterior}}
	}
}

\newcommand\Cle[1]{{\small\sffamily\textlangle \textcolor{orange}{#1}\textrangle}}
\newcommand\cmaj[1]{\tcbox[vignetteMaJ]{#1}\xspace}

\begin{document}

\setlength{\aweboxleftmargin}{0.07\linewidth}
\setlength{\aweboxcontentwidth}{0.93\linewidth}
\setlength{\aweboxvskip}{8pt}

\pagestyle{fancy}

\thispagestyle{empty}

\vspace{2cm}

\begin{center}
	\begin{minipage}{0.75\linewidth}
	\begin{tcolorbox}[colframe=yellow,colback=yellow!15]
		\begin{center}
			\begin{tabular}{c}
				{\Huge \texttt{wordle} [en]}\\
				\\
				{\LARGE Grids of Wordle,} \\
				\\
				{\LARGE made with \textsf{Ti\textit{k}Z}.} \\
			\end{tabular}
			
			\bigskip
			
			{\small \texttt{Version \TPversion{} -- \TPdate}}
		\end{center}
	\end{tcolorbox}
\end{minipage}
\end{center}

\begin{center}
	\begin{tabular}{c}
	\texttt{Cédric Pierquet}\\
	{\ttfamily c pierquet -- at -- outlook . fr}\\
	\texttt{\url{https://github.com/cpierquet/wordle}}
\end{tabular}
\end{center}

\vspace{0.25cm}

{$\blacktriangleright$~~Create Wordle grids Wordle/Sutom\footnotemark\footnotetext{\url{https://en.wikipedia.org/wiki/Wordle}}.}

\vspace{0.25cm}

{$\blacktriangleright$~~Specify colors and font\footnotemark\footnotetext{Ideas from  \url{ttps://tex.stackexchange.com/questions/659860/wordle-like-colored-letter-boxes-in-latex}}.

\vspace{0.5cm}

\begin{center}
\begin{WordleGrid}{CRAZE}
	GRAIL TRACK CRAMP CRABS CRAZY CRAZE
\end{WordleGrid}
\end{center}

\begin{center}
\begin{WordleGrid}[Rounded=0,Colors={lightgray,orange,teal},Style=alt,Unit=0.5,Letters=false]{LADLE}
	FLAIL LAPEL LADLE
\end{WordleGrid}
%
\hspace{5mm}
%
\begin{WordleGrid}[Rounded=0,Colors={lightgray,orange,teal},Style=alt,Unit=0.5]{LADLE}
	FLAIL LAPEL LADLE
\end{WordleGrid}
\end{center}

\vspace{0.25cm}

%\hfill{}\textit{Merci à Denis Bitouzé et à Gilles Le Bourhis pour leurs retours et idées !}

\smallskip

\vfill

\hrule

\medskip

\TableauDocumentation

\medskip

\hrule

\vspace*{1cm}

\newpage

\phantomsection
\hypertarget{matoc}{}

\tableofcontents

\vfill

\section{History}

\verb|v0.1.1|~:~~~~Bugfix with english version.

\verb|v0.1.0|~:~~~~Initial version.

\newpage

\section{The wordle package}

\subsection{The game}

\begin{noteblock}
Wordle is a web-based word game created and developed by Welsh software engineer Josh Wardle. Players have six attempts to guess a five-letter word, with feedback given for each guess in the form of colored tiles indicating when letters match or occupy the correct position.

Every day, a five-letter word is chosen which players aim to guess within six tries. After every guess, each letter is marked as either green, yellow or gray: green indicates that letter is correct and in the correct position, yellow means it is in the answer but not in the right position, while gray indicates it is not in the answer at all. Multiple instances of the same letter in a guess, such as the "o"s in "robot", will be colored green or yellow only if the letter also appears multiple times in the answer; otherwise, excess repeating letters will be colored gray.

\smallskip

\hfill{\scriptsize \url{https://en.wikipedia.org/wiki/Wordle}}
\end{noteblock}

\subsection{The package}

\begin{noteblock}
This package can display, in a \textsf{tex} file, a wordle grid (with \TikZ{} and within a \motcletex!minipage!), with ability :

\begin{itemize}
	\item to change dimensions and colors ;
	\item to pick style for misplaced letters ;
	\item to change borders and corners ;
	\item to print or not the letters.
\end{itemize}

It's possible to "play" with other words than five-letter words !
\end{noteblock}

\begin{importantblock}
Most of source code, in \hologo{LaTeX3}, is given by thread from \texttt{tex.stackexchange}, proposed by user \textsf{3141592653589793238}.
\end{importantblock}

\subsection{Loading of the package, used packages}

\begin{importantblock}
The package \packagetex!wordle! loads within the preamble.

There's no option, and \packagetex!xcolor! isn't loaded.
\end{importantblock}

\begin{DemoCode}[listing only]
\documentclass{article}
\usepackage{wordle}

\end{DemoCode}

\begin{noteblock}
\packagetex!wordle! loads the following packages and libraries :

\begin{itemize}
	\item \packagetex!tikz!;
	\item \packagetex!simplekv! ;
	\item \packagetex!xstring!.
\end{itemize}

It’s mostly compatible with \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} or \textsf{xelatex} compilation !
\end{noteblock}

\vfill~

\pagebreak

\section{WordleGrid environment}

\subsection{Environment}

\begin{cautionblock}
The environment to display a Wordle grid is \packagetex!WordleGrid!.

It works with keys, between \texttt{[...]} and needs to know :

\begin{itemize}
	\item the good word ;
	\item the different guesses.
\end{itemize}

The code create the grid and the colors !
\end{cautionblock}

\begin{DemoCode}[listing only]
\begin{WordleGrid}[keys]{good word}
	guess n°1
	guess n°2
	guess n°3
\end{WordleGrid}
\end{DemoCode}

\begin{noteblock}
the grid is created with a \motcletex!minipage!, with automatic width and spacings !
\end{noteblock}

\begin{DemoCode}[]
%default output
\begin{WordleGrid}{REBUS}
	ARISE
	ROUTE
	RULES
	REBUS
\end{WordleGrid}
\end{DemoCode}

\subsection{Keys and options}

\begin{tipblock}
The first argument, mandatory and between \texttt{[...]}, proposes the following \Cle{keys} :

\begin{itemize}
	\item \Cle{Colors} : = colors of the boxes \Cle{back,misplaced,good} ;
	
	\hfill{}default : \Cle{WordleBack,WordleBad,WordleGood},%
	\item \Cle{Rounded} := arc for corners, in mm ; \hfill{}default : \Cle{0.1}
	\item \Cle{Unit} := width of cases, in cm ; \hfill{}default : \Cle{1}
	\item \Cle{Font} := font for letters ; \hfill{}default : \Cle{\textbackslash LARGE\textbackslash bfseries\textbackslash sffamily}
	\item \Cle{ColorLetters} := color for letters ; \hfill{}default : \Cle{white}
	\item \Cle{BorderColor} := color fot the border ; \hfill{}default : \Cle{white}
	\item \Cle{Letters} := boolean to print letters ; \hfill{}default : \Cle{true}
	\item \Cle{Style} := style within \Cle{default / other} to change the style ; \hfill{}default : \Cle{default}
	\item \Cle{Thick} := thickness of the borders, in mm. \hfill{}default : \Cle{0.25}
\end{itemize}
\vspace*{-\baselineskip}\leavevmode
\end{tipblock}

\begin{tipblock}
The second argument, optional and between \texttt{\{...\}} is the correct word.

\smallskip

Different guesses are given within the body of the environment (line by line or space separated).
\end{tipblock}

\subsection{Examples}

\begin{DemoCode}[]
\begin{WordleGrid}{BURGH}
	ABATE
	HERBS
	BURLY
	BURGH
\end{WordleGrid}
%
\hspace{5mm}
%
\begin{WordleGrid}[Style=alt]{BURGH}
	ABATE HERBS BURLY BURGH
\end{WordleGrid}
\end{DemoCode}

\begin{DemoCode}[]
\begin{WordleGrid}
		[Thickness=0.3,BorderColor=black,%
		Colors={lightgray,orange,teal}]{BURGH}
	ABATE
	HERBS
	BURLY
	BURGH
\end{WordleGrid}
%
\hspace{5mm}
%
\begin{WordleGrid}
		[Rounded=0,Thickness=0.3,BorderColor=black,%
		Colors={lightgray,orange,teal}]{BURGH}
	ABATE
	HERBS
	BURLY
	BURGH
\end{WordleGrid}
\end{DemoCode}

\begin{DemoCode}[]
\begin{WordleGrid}[Unit=2,Font=\Huge\ttfamily,ColorLetters=black]{BURGH}
	ABATE
	HERBS
	BURLY
	BURGH
\end{WordleGrid}
\end{DemoCode}

\begin{DemoCode}[]
\begin{WordleGrid}%
		[Unit=0.75,Rounded=0,Colors={cyan,orange,violet},Letters=false]{BURGH}
	ABATE
	HERBS
	BURLY
	BURGH
\end{WordleGrid}
\hspace{5mm}
\begin{WordleGrid}%
		[Unit=0.75,Rounded=0,Colors={cyan,orange,violet},Style=alt]
		{BURGH}
	ABATE
	HERBS
	BURLY
	BURGH
\end{WordleGrid}
\hspace{5mm}
\begin{WordleGrid}%
		[Unit=0.75,Rounded=0,Colors={cyan,orange,violet},Style=alt,Letters=false]
		{BURGH}
	ABATE
	HERBS
	BURLY
	BURGH
\end{WordleGrid}
\end{DemoCode}

\end{document}