Compare commits

...

2 Commits

Author SHA1 Message Date
54d19c2e87
Convert "Wild Tic-Tac-Toe" to typst
All checks were successful
CI / Typst formatting (pull_request) Successful in 9s
CI / Typos (pull_request) Successful in 17s
CI / Build (pull_request) Successful in 10m42s
2025-01-23 20:20:43 -08:00
5be1a80e30
Convert "Big-Tac-Toe" to typst 2025-01-23 20:17:06 -08:00
4 changed files with 151 additions and 253 deletions

View File

@ -1,187 +0,0 @@
\documentclass[
solutions,
hidewarning,
singlenumbering,
nopagenumber
]{../../../lib/tex/ormc_handout}
\usepackage{../../../lib/tex/macros}
% x,y,scale,style
\def\ttt#1#2#3#4{
\draw[#4] (#1, #2+#3) -- (#1+#3+#3+#3, #2+#3);
\draw[#4] (#1, #2+#3+#3) -- (#1+#3+#3+#3, #2+#3+#3);
\draw[#4] (#1+#3, #2) -- (#1+#3, #2+#3+#3+#3);
\draw[#4] (#1+#3+#3, #2) -- (#1+#3+#3, #2+#3+#3+#3);
}
\geometry{
paper = letterpaper,
top = 25mm,
bottom = 30mm,
left = 20mm,
right = 20mm,
headheight = 75mm,
footskip = 15mm
}
% misere ttt
% Numerical Tic Tac Toe is a variation invented by the mathematician Ronald Graham.
% The numbers 1 to 9 are used in this game. The first player plays with the odd numbers,
% the second player plays with the even numbers. All numbers can be used only once.
% The player who puts down 15 points in a line wins (sum of 3 numbers).
% This game can be generalized to a n × n board.
% In Treblecross, both players play with the same symbol.
% The game is played on a 1-by-n board with k equal to 3.
% The player who makes a three in a row of Xs (or black chips) wins the game
\title{Warm-Up: Big-Tac-Toe}
\uptitler{\smallurl{}}
\subtitle{Prepared by Mark on \today.}
\begin{document}
\maketitle
We have large tic-tac-toe grid, each cell of which contains another.
On each turn, one player puts their glyph into a cell of a small grid. When the next player goes,
they must make their move in the small grid in the same position as the previous player's move.
\begin{itemize}
\item The first player to move may pick any small grid to start in.
\item If a player is directed to a grid that is \textit{full}, that player may go anywhere. \par
A sub-grid that is \say{won} but not full may still be played in.
\end{itemize}
\vspace{2mm}
The first player to complete a line of three \say{won} subgrids wins the game.
\vfill\null\hfill
\begin{minipage}{0.48\textwidth}
\begin{center}
\begin{tikzpicture}[scale=0.65]
\ttt{0}{0}{4}{line width=0.5mm}
\ttt{0.5}{0.5}{1}{line width=0.25mm}
\ttt{0.5}{4.5}{1}{line width=0.25mm}
\ttt{0.5}{8.5}{1}{line width=0.25mm}
\ttt{4.5}{0.5}{1}{line width=0.25mm}
\ttt{4.5}{4.5}{1}{line width=0.25mm}
\ttt{4.5}{8.5}{1}{line width=0.25mm}
\ttt{8.5}{0.5}{1}{line width=0.25mm}
\ttt{8.5}{4.5}{1}{line width=0.25mm}
\ttt{8.5}{8.5}{1}{line width=0.25mm}
\end{tikzpicture}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{0.48\textwidth}
\begin{center}
\begin{tikzpicture}[scale=0.65]
\ttt{0}{0}{4}{line width=0.5mm}
\ttt{0.5}{0.5}{1}{line width=0.25mm}
\ttt{0.5}{4.5}{1}{line width=0.25mm}
\ttt{0.5}{8.5}{1}{line width=0.25mm}
\ttt{4.5}{0.5}{1}{line width=0.25mm}
\ttt{4.5}{4.5}{1}{line width=0.25mm}
\ttt{4.5}{8.5}{1}{line width=0.25mm}
\ttt{8.5}{0.5}{1}{line width=0.25mm}
\ttt{8.5}{4.5}{1}{line width=0.25mm}
\ttt{8.5}{8.5}{1}{line width=0.25mm}
\end{tikzpicture}
\end{center}
\end{minipage}
\hfill\null\vfill
\problem{}
Play a few rounds of this game with someone nearby. \par
Can either player force a win?
\vfill
\problem{}
Modify the rules of this game to disallow play in won subgrids. \par
How does your strategy change?
\vfill
\pagebreak
\null\vfill\null\hfill
\begin{minipage}{0.48\textwidth}
\begin{center}
\begin{tikzpicture}[scale=0.65]
\ttt{0}{0}{4}{line width=0.5mm}
\ttt{0.5}{0.5}{1}{line width=0.25mm}
\ttt{0.5}{4.5}{1}{line width=0.25mm}
\ttt{0.5}{8.5}{1}{line width=0.25mm}
\ttt{4.5}{0.5}{1}{line width=0.25mm}
\ttt{4.5}{4.5}{1}{line width=0.25mm}
\ttt{4.5}{8.5}{1}{line width=0.25mm}
\ttt{8.5}{0.5}{1}{line width=0.25mm}
\ttt{8.5}{4.5}{1}{line width=0.25mm}
\ttt{8.5}{8.5}{1}{line width=0.25mm}
\end{tikzpicture}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{0.48\textwidth}
\begin{center}
\begin{tikzpicture}[scale=0.65]
\ttt{0}{0}{4}{line width=0.5mm}
\ttt{0.5}{0.5}{1}{line width=0.25mm}
\ttt{0.5}{4.5}{1}{line width=0.25mm}
\ttt{0.5}{8.5}{1}{line width=0.25mm}
\ttt{4.5}{0.5}{1}{line width=0.25mm}
\ttt{4.5}{4.5}{1}{line width=0.25mm}
\ttt{4.5}{8.5}{1}{line width=0.25mm}
\ttt{8.5}{0.5}{1}{line width=0.25mm}
\ttt{8.5}{4.5}{1}{line width=0.25mm}
\ttt{8.5}{8.5}{1}{line width=0.25mm}
\end{tikzpicture}
\end{center}
\end{minipage}
\hfill\null\vfill
\vfill\null\hfill
\begin{minipage}{0.48\textwidth}
\begin{center}
\begin{tikzpicture}[scale=0.65]
\ttt{0}{0}{4}{line width=0.5mm}
\ttt{0.5}{0.5}{1}{line width=0.25mm}
\ttt{0.5}{4.5}{1}{line width=0.25mm}
\ttt{0.5}{8.5}{1}{line width=0.25mm}
\ttt{4.5}{0.5}{1}{line width=0.25mm}
\ttt{4.5}{4.5}{1}{line width=0.25mm}
\ttt{4.5}{8.5}{1}{line width=0.25mm}
\ttt{8.5}{0.5}{1}{line width=0.25mm}
\ttt{8.5}{4.5}{1}{line width=0.25mm}
\ttt{8.5}{8.5}{1}{line width=0.25mm}
\end{tikzpicture}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{0.48\textwidth}
\begin{center}
\begin{tikzpicture}[scale=0.65]
\ttt{0}{0}{4}{line width=0.5mm}
\ttt{0.5}{0.5}{1}{line width=0.25mm}
\ttt{0.5}{4.5}{1}{line width=0.25mm}
\ttt{0.5}{8.5}{1}{line width=0.25mm}
\ttt{4.5}{0.5}{1}{line width=0.25mm}
\ttt{4.5}{4.5}{1}{line width=0.25mm}
\ttt{4.5}{8.5}{1}{line width=0.25mm}
\ttt{8.5}{0.5}{1}{line width=0.25mm}
\ttt{8.5}{4.5}{1}{line width=0.25mm}
\ttt{8.5}{8.5}{1}{line width=0.25mm}
\end{tikzpicture}
\end{center}
\end{minipage}
\hfill\null\vfill
\end{document}

View File

@ -0,0 +1,97 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
#show: doc => handout(
doc,
quarter: link(
"https://betalupi.com/handouts",
"betalupi.com/handouts",
),
title: [Warm-Up: Big-Tac-Toe],
by: "Mark",
)
#let extra_boards = false;
#let ttt(s, p) = {
// s: scale,
// p: position
let x = p.at(0) * s
let y = p.at(1) * s
cetz.draw.line((-1 * s + x, 3 * s + y), (-1 * s + x, -3 * s + y))
cetz.draw.line((1 * s + x, 3 * s + y), (1 * s + x, -3 * s + y))
cetz.draw.line((3 * s + x, -1 * s + y), (-3 * s + x, -1 * s + y))
cetz.draw.line((3 * s + x, 1 * s + y), (-3 * s + x, 1 * s + y))
}
#let btt(s) = cetz.canvas({
import cetz.draw: *
set-style(stroke: (thickness: 0.5mm * s))
ttt(s, (-7, -7))
ttt(s, (-7, 0))
ttt(s, (-7, 7))
ttt(s, (0, -7))
ttt(s, (0, 0))
ttt(s, (0, 7))
ttt(s, (7, -7))
ttt(s, (7, 0))
ttt(s, (7, 7))
set-style(stroke: (thickness: 2mm * s))
ttt(s * 3.5, (0, 0))
})
#problem()
Consider a large tic-tac-toe grid, each cell of which contains another.
On each turn, one player puts their glyph into a cell of a small grid. When the next player goes,
they must make their move in the small grid in the same position as the previous player's move.
- The first player to move may pick any small grid to start in.
- If a player is directed to a grid that is _full_, that player may go anywhere. \
A sub-grid that is "won" but not full may still be played in.
#v(2mm)
The first player to complete a line of three "won" subgrids wins the game.
#v(2mm)
#problem()
Play a few rounds of this game with someone nearby. \
Can either player force a win?
#table(
stroke: none,
align: center,
columns: (1fr, 1fr),
btt(0.35), btt(0.35),
);
#problem()
Modify the rules of this game to disallow play in won subgrids. \
How does your strategy change? \
#if extra_boards { note([Additional boards are available on the next page.]) }
#v(1fr)
#if extra_boards {
pagebreak()
align(
center,
grid(
stroke: none,
align: center,
columns: (1fr, 1fr),
rows: (1fr, 1fr, 1fr),
btt(0.35), btt(0.35),
btt(0.35), btt(0.35),
btt(0.35), btt(0.35),
),
)
}

View File

@ -1,66 +0,0 @@
\documentclass[
solutions,
hidewarning,
singlenumbering,
nopagenumber
]{../../../lib/tex/ormc_handout}
\usepackage{../../../lib/tex/macros}
% x,y,scale,style
\def\ttt#1#2#3#4{
\draw[#4] (#1, #2+#3) -- (#1+#3+#3+#3, #2+#3);
\draw[#4] (#1, #2+#3+#3) -- (#1+#3+#3+#3, #2+#3+#3);
\draw[#4] (#1+#3, #2) -- (#1+#3, #2+#3+#3+#3);
\draw[#4] (#1+#3+#3, #2) -- (#1+#3+#3, #2+#3+#3+#3);
}
\title{Warm-Up: Wild Tic-Tac-Toe}
\uptitler{\smallurl{}}
\subtitle{Prepared by Mark on \today.}
\begin{document}
\maketitle
\problem{}
In wild tic-tac-toe, players may place either an X or O on each move. The player that first completes a
row of any three symbols wins. Show that the first player always has a winning strategy.
\vfill
\begin{center}
\begin{tikzpicture}[scale=0.60]
\ttt{0}{0}{2}{line width=0.3mm}
\ttt{7}{0}{2}{line width=0.3mm}
\ttt{14}{0}{2}{line width=0.3mm}
\ttt{0}{7}{2}{line width=0.3mm}
\ttt{7}{7}{2}{line width=0.3mm}
\ttt{14}{7}{2}{line width=0.3mm}
\end{tikzpicture}
\end{center}
\vfill
\problem{}
Now, say the first player to complete a row loses. Who has a winning strategy now?
\vfill
\begin{center}
\begin{tikzpicture}[scale=0.60]
\ttt{0}{0}{2}{line width=0.3mm}
\ttt{7}{0}{2}{line width=0.3mm}
\ttt{14}{0}{2}{line width=0.3mm}
\ttt{0}{7}{2}{line width=0.3mm}
\ttt{7}{7}{2}{line width=0.3mm}
\ttt{14}{7}{2}{line width=0.3mm}
\end{tikzpicture}
\end{center}
\vfill
\pagebreak
\end{document}

View File

@ -0,0 +1,54 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
#show: doc => handout(
doc,
quarter: link(
"https://betalupi.com/handouts",
"betalupi.com/handouts",
),
title: [Warm-Up: Wild Tic-Tac-Toe],
by: "Mark",
)
#let ttt = align(
center,
cetz.canvas({
import cetz.draw: *
let s = 0.7 // scale
set-style(stroke: (thickness: 0.5mm * s))
line((-1 * s, 3 * s), (-1 * s, -3 * s))
line((1 * s, 3 * s), (1 * s, -3 * s))
line((3 * s, -1 * s), (-3 * s, -1 * s))
line((3 * s, 1 * s), (-3 * s, 1 * s))
}),
)
#problem()
In wild tic-tac-toe, players may place either an X or O on each move. The player that first completes a
row of any three symbols wins. Show that the first player always has a winning strategy.
#v(4mm)
#table(
stroke: none,
align: center,
columns: (1fr, 1fr, 1fr),
ttt, ttt, ttt,
);
#v(1fr)
#problem()
Now, say the first player to complete a row loses. Who has a winning strategy now?
#v(4mm)
#table(
stroke: none,
align: center,
columns: (1fr, 1fr, 1fr),
ttt, ttt, ttt,
);
#v(1fr)