From 1a3167179be2322208ef8ca709a3a45cbde1413c Mon Sep 17 00:00:00 2001 From: Malin Freeborn <malinfreeborn@posteo.net> Date: Sat, 26 Oct 2024 03:44:01 +0200 Subject: [PATCH] ensure market randomness --- layout.sty | 21 ++++++++++++--------- market.sty | 3 ++- test.tex | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/layout.sty b/layout.sty index a64eeac..456145d 100644 --- a/layout.sty +++ b/layout.sty @@ -1034,12 +1034,6 @@ bookmarks=true]% \stepcounter{r2}% \stepcounter{r3}% \stepcounter{r4}% - \stepcounter{r2t3}% - \stepcounter{r3t4}% - \stepcounter{r4t5}% - \stepcounter{r4t6}% - \stepcounter{r0t1}% - \stepcounter{rn1t0} \setcounter{rn4tn1}{\value{r4b}}% \addtocounter{rn4tn1}{-5}% \setcounter{rn3t3}{\value{r3b}}% @@ -1051,11 +1045,20 @@ bookmarks=true]% \stepcounter{r2b}% \stepcounter{r3b}% \stepcounter{r2t4} + \stepcounter{r4t5}% \else% \multiply\value{rn3t3} by -1% \addtocounter{rn3t3}{0}% - \stepcounter{rn1t2} + \stepcounter{r3c}% + \stepcounter{r4t6}% + \stepcounter{r0t1}% + \stepcounter{rn1t0} + \fi% + \ifodd\value{r3b}% \stepcounter{r2c}% + \stepcounter{r3t4}% + \else% + \stepcounter{r2t3}% \stepcounter{r3c}% \stepcounter{r4b}% \fi% @@ -1064,11 +1067,11 @@ bookmarks=true]% \foreach\c in {r3,r3b,r3c}% {\ifnum\value{\c}>3\setcounter{\c}{1}\fi}% \foreach\c in {r4,r4b}% - {\ifnum\value{\c}>4\setcounter{\c}{1}\fi}% + {\ifnum\value{\c}>4\setcounter{\c}{1}\stepcounter{rn1t2}\fi}% \ifnum\value{r0t1}>1\setcounter{r0t1}{0}\fi% \ifnum\value{rn1t0}>0\setcounter{rn1t0}{-1}\fi% + \ifnum\value{r2t3}>3\setcounter{r2t3}{2}\stepcounter{rn1t2}\fi% \ifnum\value{rn1t2}>2\setcounter{rn1t2}{-1}\fi% - \ifnum\value{r2t3}>3\setcounter{r2t3}{2}\fi% \ifnum\value{r2t4}>4\setcounter{r2t4}{2}\fi% \ifnum\value{r3t4}>4\setcounter{r3t4}{3}\fi% \ifnum\value{r4t5}>5\setcounter{r4t5}{4}\fi% diff --git a/market.sty b/market.sty index 7f9b84b..224927a 100644 --- a/market.sty +++ b/market.sty @@ -8,7 +8,8 @@ \else% \addtocounter{track}{\value{rn3t3}}% \ifnum\value{track}<14% - \addtocounter{track}{\value{r4b}}% + \addtocounter{track}{\value{r3b}}% + \addtocounter{track}{\value{rn1t2}}% \else% \ifnum\value{track}<34% \addtocounter{track}{\value{r4t6}}% diff --git a/test.tex b/test.tex index 7efadb9..aa0e463 100644 --- a/test.tex +++ b/test.tex @@ -89,6 +89,42 @@ Words are needed after each subsection to avoid the boxes making problems. \end{multicols} +\newcommand\showCounters{ + \arabic{r2} & + \arabic{r2b} & + \arabic{r2c} & + \arabic{r3} & + \arabic{r3b} & + \arabic{r3c} & + \arabic{r4} & + \arabic{r4b} & + \arabic{r0t1} & + \arabic{rn1t0} & + \arabic{rn1t2} & + \arabic{rn3t3} & + \arabic{r2t3} & + \arabic{r2t4} & + \arabic{r3t4} & + \arabic{r4t5} & + \arabic{r4t6} + \randomize + \\ +} + +\begin{tabular}{cccccccccccccccccc} + \textbf{r2} & \textbf{r2b} & \textbf{r2c} & \textbf{r3} & \textbf{r3b} & \textbf{r3c} & \textbf{r4} & \textbf{r4b} & \textbf{r0t1} & \textbf{rn1t0} & \textbf{rn1t2} & \textbf{rn3t3} & \textbf{r2t3} & \textbf{r2t4} & \textbf{r3t4} & \textbf{r4t5} & \textbf{r4t6} \\\hline + \showCounters + \showCounters + \showCounters + \showCounters + \showCounters + \showCounters + \showCounters + \showCounters + \showCounters + \showCounters +\end{tabular} + \mainmatter \chapter{Side Quests} -- GitLab