Skip to content
Snippets Groups Projects
seasons.sty 1.92 KiB
Newer Older
  • Learn to ignore specific revisions
  • \newcounter{temperature}
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \newcounter{cycle}
    
    \setcounter{cycle}{\month}
      \roundUp{cycle}
    
    \newcounter{fenestraYear}
    \setcounter{fenestraYear}{3}
    \setcounter{fenestraYear}{\year}
    \multiply\value{fenestraYear}by 4
    
    
    \newcommand\cycleDesc{}
    
    \newcommand\setCycle[2]{%
      \setcounter{cycle}{#1}% Month
      \addtocounter{cycle}{-1}%
      \multiply\value{cycle} by 30%
      \addtocounter{cycle}{#2}% Day
      \divide\value{cycle} by 14%
      \addtocounter{cycle}{0}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \whileboolexpr{%
        test {\ifnumcomp{\value{cycle}}{>}{5}}%
        }{%
          \addtocounter{cycle}{-5}%
        }%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
      \setTemperature%
    
    }
    
    %%% State a Cycle's name.
    
    \newcommand\showCycle[1][\value{cycle}]{%
      \ifcase#1%
        \glsentrytext{cOne}%
        \renewcommand\cycleDesc{\glsentrydesc{cOne}}%
      \or%
        \glsentrytext{cTwo}%
        \renewcommand\cycleDesc{\glsentrydesc{cTwo}}%
      \or%
        \glsentrytext{cThree}%
        \renewcommand\cycleDesc{\glsentrydesc{cThree}}%
      \or%
        \glsentrytext{cFour}%
        \renewcommand\cycleDesc{\glsentrydesc{cFour}}%
      \or%
        \glsentrytext{cFive}%
        \renewcommand\cycleDesc{\glsentrydesc{cFive}}%
      \else
        \glsentrytext{cSix}%
        \renewcommand\cycleDesc{\glsentrydesc{cSix}}%
      \fi%
    }
    
    
    \newcommand\setTemperature{
    
      \ifcase\value{cycle}%
    
        \setcounter{temperature}{1}%
      \or%
        \setcounter{temperature}{0}%
      \or%
        \setcounter{temperature}{1}%
      \or%
        \setcounter{temperature}{2}%
      \or%
    
        \setcounter{temperature}{3}%
      \else
    
        \setcounter{temperature}{2}%
    
      \fi%
    }
    
    \newcommand\showTemperature{%
      \ifcase\value{temperature}%
        cold%
    
        hot%
      \else%
        scorching%
    
    \newcommand\showInterval[1]{%
      \ifcase#1%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \gls{morning}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \gls{afternoon}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \gls{evening}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
        \gls{night}%
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \newcommand\trackMonth[1][track]{%
      \ifcase\value{#1}\or%
        January\or February\or March\or April\or May\or June\or%
        July\or August\or September\or October\or November\else December\fi%
    }
    
    
    Malin Freeborn's avatar
    Malin Freeborn committed
    \setCycle{\month}{\day}