Skip to content
Snippets Groups Projects
Verified Commit 41f90a44 authored by Malin Freeborn's avatar Malin Freeborn
Browse files

rewrite \setCycle logic

parent 6c7d3bb9
Branches
No related tags found
No related merge requests found
......@@ -12,20 +12,16 @@
\newcommand\setCycle[2]{%
\setcounter{cycle}{#1}% Month
\ifnum\value{cycle}>6%
\addtocounter{cycle}{-6}%
\fi%
\ifnum\value{cycle}>3%
\addtocounter{cycle}{-3}%
\fi%
\addtocounter{cycle}{-1}%
\multiply\value{cycle} by 30%
\addtocounter{cycle}{#2}% Day
\divide\value{cycle} by 14%
\addtocounter{cycle}{0}%
\ifnum\value{cycle}>5%
\setcounter{cycle}{0}%
\fi%
\whileboolexpr{%
test {\ifnumcomp{\value{cycle}}{>}{5}}%
}{%
\addtocounter{cycle}{-5}%
}%
\setTemperature%
}
......@@ -147,3 +143,5 @@
\gls{night}%
\fi%
}
\setCycle{\month}{\day}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment