Skip to content

Commit 15b844f

Browse files
committed
move \newcount out of definitions
Close #15
1 parent d39e755 commit 15b844f

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

karnaugh-map.dtx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -703,13 +703,13 @@
703703
% ^^A #### CODE ####
704704
% ^^A ##########################################################################
705705
% ^^A ##########################################################################
706+
\newcount\@karnaughmap@local@max@\relax
706707
\DeclareDocumentCommand{\autoterms}{O{-}} {%
707708
% bail if outside environment karnaugh-map
708709
\@karnaughmap@func@bailoutsideenvironment@{}
709710
%
710711
\begingroup
711712
% calculate max cell number {[START]
712-
\newcount\@karnaughmap@local@max@\relax
713713
\@karnaughmap@local@max@=\@karnaughmap@var@mapsizex@\relax
714714
\multiply\@karnaughmap@local@max@ by \@karnaughmap@var@mapsizey@\relax
715715
\multiply\@karnaughmap@local@max@ by \@karnaughmap@var@mapsizez@\relax
@@ -799,6 +799,7 @@
799799
% ^^A #### CODE ####
800800
% ^^A ##########################################################################
801801
% ^^A ##########################################################################
802+
\newcount\@karnaughmap@local@cellcount@\relax
802803
\DeclareDocumentCommand{\manualterms}{m} {%
803804
% bail if outside environment karnaugh-map
804805
\@karnaughmap@func@bailoutsideenvironment@{}
@@ -811,7 +812,6 @@
811812
}
812813
% update \@karnaughmap@var@usedcells@ (previous cells + all cells up to \@karnaughmap@local@cellcount@ are used now) {[START]
813814
\newcommand{\@karnaughmap@local@tmpusedcells@}{}
814-
\newcount\@karnaughmap@local@cellcount@\relax
815815
% count number of cells in #1 {[START]
816816
\StrCount{#1}{,}[\@karnaughmap@local@tmpusedcells@]
817817
\@karnaughmap@local@cellcount@=\@karnaughmap@local@tmpusedcells@\relax
@@ -1040,6 +1040,8 @@
10401040
% ^^A #### CODE ####
10411041
% ^^A ##########################################################################
10421042
% ^^A ##########################################################################
1043+
\newcount\@karnaughmap@local@northwest@\relax
1044+
\newcount\@karnaughmap@local@southeast@\relax
10431045
\DeclareDocumentCommand{\implicant}{m m O{0}} {%
10441046
% bail if outside environment karnaugh-map
10451047
\@karnaughmap@func@bailoutsideenvironment@{}
@@ -1053,8 +1055,6 @@
10531055
% make sure we don't try to draw on non existing sub maps
10541056
\ifnum\map<\@karnaughmap@var@mapsizez@
10551057
% calculate cell number for the specified sub maps {[START]
1056-
\newcount\@karnaughmap@local@northwest@\relax
1057-
\newcount\@karnaughmap@local@southeast@\relax
10581058
\@karnaughmap@local@northwest@=\map\relax
10591059
\@karnaughmap@local@southeast@=\map\relax
10601060
\multiply\@karnaughmap@local@northwest@ by 16\relax
@@ -1139,6 +1139,10 @@
11391139
% ^^A #### CODE ####
11401140
% ^^A ##########################################################################
11411141
% ^^A ##########################################################################
1142+
\newcount\@karnaughmap@local@testcaseone@\relax
1143+
\newcount\@karnaughmap@local@testcasetwo@\relax
1144+
\newcount\@karnaughmap@local@coordinateonecounter@\relax
1145+
\newcount\@karnaughmap@local@coordinatetwocounter@\relax
11421146
\DeclareDocumentCommand{\implicantedge}{m m m m O{0}} {%
11431147
% bail if outside environment karnaugh-map
11441148
\@karnaughmap@func@bailoutsideenvironment@{}
@@ -1156,8 +1160,6 @@
11561160
\newcommand{\@karnaughmap@local@fillcontent@}{}
11571161
% [END]}
11581162
% determinate if this is an horizontal or vertical implicant {[START]
1159-
\newcount\@karnaughmap@local@testcaseone@\relax
1160-
\newcount\@karnaughmap@local@testcasetwo@\relax
11611163
\@karnaughmap@local@testcaseone@=#1\relax
11621164
\@karnaughmap@local@testcasetwo@=#1\relax
11631165
\advance\@karnaughmap@local@testcaseone@ by -#2\relax
@@ -1196,8 +1198,6 @@
11961198
\fi
11971199
% [END]}
11981200
% calculate cell numbers for the specified sub map {[START]
1199-
\newcount\@karnaughmap@local@coordinateonecounter@\relax
1200-
\newcount\@karnaughmap@local@coordinatetwocounter@\relax
12011201
\@karnaughmap@local@coordinateonecounter@=\map\relax
12021202
\@karnaughmap@local@coordinatetwocounter@=\map\relax
12031203
\multiply\@karnaughmap@local@coordinateonecounter@ by 16\relax
@@ -1323,6 +1323,7 @@
13231323
% ^^A #### CODE ####
13241324
% ^^A ##########################################################################
13251325
% ^^A ##########################################################################
1326+
\newcount\@karnaughmap@local@coordinate@\relax
13261327
\DeclareDocumentCommand{\implicantcorner}{O{0}} {%
13271328
% bail if outside environment karnaugh-map
13281329
\@karnaughmap@func@bailoutsideenvironment@{}
@@ -1338,7 +1339,6 @@
13381339
% loop through the four corners
13391340
\foreach \corner in {0,2,8,10} {%
13401341
% calculate corner's properties {[START]
1341-
\newcount\@karnaughmap@local@coordinate@\relax
13421342
\@karnaughmap@local@coordinate@=\map\relax
13431343
\multiply\@karnaughmap@local@coordinate@ by 16\relax
13441344
\advance\@karnaughmap@local@coordinate@ by \corner\relax

0 commit comments

Comments
 (0)