From 6048806e49ae77f6f4c26e4afb25c223d2c4930f Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 23 Jan 2025 20:20:43 -0800 Subject: [PATCH] Convert "Wild Tic-Tac-Toe" to typst --- src/Warm-Ups/Wild Tic-Tac-Toe/main.tex | 66 -------------------------- src/Warm-Ups/Wild Tic-Tac-Toe/main.typ | 54 +++++++++++++++++++++ 2 files changed, 54 insertions(+), 66 deletions(-) delete mode 100755 src/Warm-Ups/Wild Tic-Tac-Toe/main.tex create mode 100644 src/Warm-Ups/Wild Tic-Tac-Toe/main.typ diff --git a/src/Warm-Ups/Wild Tic-Tac-Toe/main.tex b/src/Warm-Ups/Wild Tic-Tac-Toe/main.tex deleted file mode 100755 index b006ae0..0000000 --- a/src/Warm-Ups/Wild Tic-Tac-Toe/main.tex +++ /dev/null @@ -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} \ No newline at end of file diff --git a/src/Warm-Ups/Wild Tic-Tac-Toe/main.typ b/src/Warm-Ups/Wild Tic-Tac-Toe/main.typ new file mode 100644 index 0000000..b7cd016 --- /dev/null +++ b/src/Warm-Ups/Wild Tic-Tac-Toe/main.typ @@ -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)