Difference between revisions of "Template:NASAT results by state by year"
Jump to navigation
Jump to search
Kevin Wang (talk | contribs) (Created page with "{{#vardefine:max|0}}{{#loop:i|1|50|{{#vardefine:x|{{All states|{{#expr:{{#var:i}}-1}}}}}}{{#if:{{{ {{#var:x}}| }}}|{{#ifexpr:{{{ {{#var:x}} |0}}} > {{#var:max}}|{{#vardefine:m...") |
Kevin Wang (talk | contribs) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{#vardefine:max|0}}{{#loop:i|1| | + | <!-- |
+ | clear variables | ||
+ | -->{{#loop:k|1|55|{{#vardefine:p{{#var:k}}|}}}}<!-- | ||
+ | -->{{#vardefine:max|0}}<!-- | ||
+ | -->{{#if:{{{raw|}}}<!-- | ||
+ | case 1: handle raw string | ||
+ | --><!---->|{{#vardefine:n|0}}{{#while:<!-- | ||
+ | --><!----><!---->|{{#explode:{{{raw}}}|,|{{#var:n}}}}<!-- | ||
+ | --><!----><!---->|{{#vardefine:line|{{#explode:{{{raw}}}|,|{{#var:n}}}}}}<!-- | ||
+ | --><!----><!---->{{#vardefine:placement|{{#explode:{{#var:line}}|=|1}}}}<!-- | ||
+ | --><!----><!---->{{#ifexpr:{{#var:placement}}>{{#var:max}}|{{#vardefine:max|{{#var:placement}}}}}}<!-- | ||
+ | check if placement already defined | ||
+ | --><!----><!---->{{#if:{{#var:p{{#var:placement}}}}<!-- | ||
+ | --><!----><!----><!---->|{{#vardefine:p{{#var:placement}}|{{#var:p{{#var:placement}}}},{{#explode:{{#var:line}}|=|0}}}}<!-- | ||
+ | --><!----><!----><!---->|{{#vardefine:p{{#var:placement}}|{{#explode:{{#var:line}}|=|0}}}}<!-- | ||
+ | --><!----><!---->}}{{#vardefine:n|{{#expr:{{#var:n}}+1}}}}<!-- | ||
+ | --><!---->}}<!-- | ||
+ | case 2: loop through the arguments using a pre-defined list of states + DC | ||
+ | --><!---->|{{#if:{{#var:uses}}<!-- | ||
+ | --><!----><!---->|{{#vardefine:uses|{{#expr:{{#var:uses}}+1}}}}<!-- | ||
+ | --><!----><!---->|{{#vardefine:uses|1}}<!-- | ||
+ | --><!---->}}<!-- | ||
+ | --><!---->{{#loop:i{{#var:uses}}|1|55<!-- | ||
+ | --><!----><!---->|{{#vardefine:statename|{{All states and DC|{{#expr:{{#var:i{{#var:uses}}}}-1}}}}}}<!-- | ||
+ | --><!----><!---->{{#if:{{{ {{#var:statename}}| }}}<!-- | ||
+ | --><!----><!----><!---->|{{#vardefine:max|{{#expr:{{#var:max}}+1}}}}<!-- | ||
+ | --><!----><!----><!---->{{#if:{{#var:p{{{ {{#var:statename}} }}}}}<!-- | ||
+ | --><!----><!----><!----><!---->|{{#vardefine:p{{{ {{#var:statename}} }}}|{{#var:p{{{ {{#var:statename}} }}}}},{{#var:statename}}}}<!-- | ||
+ | --><!----><!----><!----><!---->|{{#vardefine:p{{{ {{#var:statename}} }}}|{{#var:statename}}}}<!-- | ||
+ | --><!----><!----><!---->}}<!-- | ||
+ | --><!----><!---->}}<!-- | ||
+ | --><!---->}}<!-- | ||
+ | -->}} | ||
+ | <includeonly> | ||
{| class="wikitable" | {| class="wikitable" | ||
! Place | ! Place | ||
Line 8: | Line 41: | ||
{{#ifexpr:{{#var:j}}<=3 | {{#ifexpr:{{#var:j}}<=3 | ||
|{{Placement row|place={{#var:j}}|{{#var:j}}|{{#var:p{{#var:j}}}}}} | |{{Placement row|place={{#var:j}}|{{#var:j}}|{{#var:p{{#var:j}}}}}} | ||
− | |{{!}} {{#var:j}} <nowiki> | + | |{{!}}{{#if:{{#explode:{{#var:p{{#var:j}}}}|,|1}} |
+ | |{{#vardefine:l|0}}{{#while: | ||
+ | |{{#explode:{{#var:p{{#var:j}}}}|,|{{#var:l}}}} | ||
+ | |{{#vardefine:l|{{#expr:{{#var:l}}+1}}}} | ||
+ | }}<!-- | ||
+ | --> ! rowspan={{#var:l}} {{!}} {{#var:j}}<nowiki> | ||
+ | </nowiki> | ||
+ | {{!}} {{#explode:{{#var:p{{#var:j}}}}|,|0}} | ||
+ | {{#loop:m|1|{{#expr:{{#var:l}}-1}}|{{!-}} | ||
+ | {{!}} {{#explode:{{#var:p{{#var:j}}}}|,|{{#var:m}}}} | ||
+ | {{!-}}}} | ||
+ | |{{#var:j}} <nowiki> | ||
</nowiki> | </nowiki> | ||
{{!}} {{#var:p{{#var:j}}}} | {{!}} {{#var:p{{#var:j}}}} | ||
+ | }} | ||
{{!-}} | {{!-}} | ||
}}}}}} | }}}}}} | ||
|}</includeonly><noinclude> | |}</includeonly><noinclude> | ||
+ | This template only considers states + DC. | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
! Input | ! Input | ||
Line 47: | Line 94: | ||
|North Carolina=5 | |North Carolina=5 | ||
|Pennsylvania=6 | |Pennsylvania=6 | ||
+ | }} | ||
+ | |- | ||
+ | |<pre> | ||
+ | {{NASAT results by state by year | ||
+ | |Alabama=12 | ||
+ | |California=2 | ||
+ | |Delaware=6 | ||
+ | |Georgia=4 | ||
+ | |Illinois=1 | ||
+ | |Kentucky=9 | ||
+ | |Maryland=6 | ||
+ | |Missouri=9 | ||
+ | |New York=6 | ||
+ | |Ohio=3 | ||
+ | |Oklahoma=12 | ||
+ | |Pennsylvania=5 | ||
+ | }} | ||
+ | </pre> | ||
+ | |{{NASAT results by state by year | ||
+ | |Alabama=12 | ||
+ | |California=2 | ||
+ | |Delaware=6 | ||
+ | |Georgia=4 | ||
+ | |Illinois=1 | ||
+ | |Kentucky=9 | ||
+ | |Maryland=6 | ||
+ | |Missouri=9 | ||
+ | |New York=6 | ||
+ | |Ohio=3 | ||
+ | |Oklahoma=12 | ||
+ | |Pennsylvania=5 | ||
+ | }} | ||
+ | |- | ||
+ | |<pre> | ||
+ | {{NASAT results by state by year | ||
+ | |Alabama=12, | ||
+ | California=2, | ||
+ | Delaware=6, | ||
+ | Georgia=4, | ||
+ | Illinois=1, | ||
+ | Kentucky=9, | ||
+ | Maryland=6, | ||
+ | Missouri=9, | ||
+ | New York=6, | ||
+ | Ohio=3, | ||
+ | Oklahoma=12, | ||
+ | Pennsylvania=5 | ||
+ | }} | ||
+ | </pre> | ||
+ | |{{NASAT results by state by year | ||
+ | |raw=Alabama=12, | ||
+ | California=2, | ||
+ | Delaware=6, | ||
+ | Georgia=4, | ||
+ | Illinois=1, | ||
+ | Kentucky=9, | ||
+ | Maryland=6, | ||
+ | Missouri=9, | ||
+ | New York=6, | ||
+ | Ohio=3, | ||
+ | Oklahoma=12, | ||
+ | Pennsylvania=5 | ||
}} | }} | ||
|} | |} | ||
+ | <div style="display:flex"> | ||
+ | <div style="width:50%"> | ||
Full state template: | Full state template: | ||
<pre> | <pre> | ||
Line 60: | Line 171: | ||
|Colorado= | |Colorado= | ||
|Connecticut= | |Connecticut= | ||
− | |Delaware= | + | |Delaware= |
+ | |District of Columbia= | ||
|Florida= | |Florida= | ||
|Georgia= | |Georgia= | ||
Line 105: | Line 217: | ||
}} | }} | ||
</pre> | </pre> | ||
+ | </div> | ||
+ | <div style="width:50%"> | ||
+ | Only states that have attended template: | ||
+ | <pre> | ||
+ | {{NASAT results by state by year | ||
+ | |Alabama= | ||
+ | |Arizona= | ||
+ | |California= | ||
+ | |Connecticut= | ||
+ | |Delaware= | ||
+ | |District of Columbia= | ||
+ | |Florida= | ||
+ | |Georgia= | ||
+ | |Illinois= | ||
+ | |Indiana= | ||
+ | |Iowa= | ||
+ | |Kentucky= | ||
+ | |Maryland= | ||
+ | |Massachusetts= | ||
+ | |Michigan= | ||
+ | |Minnesota= | ||
+ | |Missouri= | ||
+ | |Nevada= | ||
+ | |New Hampshire= | ||
+ | |New Jersey= | ||
+ | |New York= | ||
+ | |North Carolina= | ||
+ | |Ohio= | ||
+ | |Oklahoma= | ||
+ | |Pennsylvania= | ||
+ | |South Carolina= | ||
+ | |Tennessee= | ||
+ | |Texas= | ||
+ | |Vermont= | ||
+ | |Virginia= | ||
+ | }} | ||
+ | </pre> | ||
+ | </div> | ||
+ | </div> | ||
</noinclude> | </noinclude> |
Latest revision as of 11:35, 20 June 2022
This template only considers states + DC.
Input | Output | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{NASAT results by state by year |California=9 |Connecticut=10 |Illinois=2 |Iowa=21 |Kentucky=15 |Maryland=4 |Michigan=7 |Minnesota=13 |Missouri=3 |New Jersey=1 |North Carolina=5 |Pennsylvania=6 }} |
| ||||||||||||||||||||||
{{NASAT results by state by year |Alabama=12 |California=2 |Delaware=6 |Georgia=4 |Illinois=1 |Kentucky=9 |Maryland=6 |Missouri=9 |New York=6 |Ohio=3 |Oklahoma=12 |Pennsylvania=5 }} |
| ||||||||||||||||||||||
{{NASAT results by state by year |Alabama=12, California=2, Delaware=6, Georgia=4, Illinois=1, Kentucky=9, Maryland=6, Missouri=9, New York=6, Ohio=3, Oklahoma=12, Pennsylvania=5 }} |
|
Full state template:
{{NASAT results by state by year |Alabama= |Alaska= |Arizona= |Arkansas= |California= |Colorado= |Connecticut= |Delaware= |District of Columbia= |Florida= |Georgia= |Hawaii= |Idaho= |Illinois= |Indiana= |Iowa= |Kansas= |Kentucky= |Louisiana= |Maine= |Maryland= |Massachusetts= |Michigan= |Minnesota= |Mississippi= |Missouri= |Montana= |Nebraska= |Nevada= |New Hampshire= |New Jersey= |New Mexico= |New York= |North Carolina= |North Dakota= |Ohio= |Oklahoma= |Oregon= |Pennsylvania= |Rhode Island= |South Carolina= |South Dakota= |Tennessee= |Texas= |Utah= |Vermont= |Virginia= |Washington= |West Virginia= |Wisconsin= |Wyoming= }}
Only states that have attended template:
{{NASAT results by state by year |Alabama= |Arizona= |California= |Connecticut= |Delaware= |District of Columbia= |Florida= |Georgia= |Illinois= |Indiana= |Iowa= |Kentucky= |Maryland= |Massachusetts= |Michigan= |Minnesota= |Missouri= |Nevada= |New Hampshire= |New Jersey= |New York= |North Carolina= |Ohio= |Oklahoma= |Pennsylvania= |South Carolina= |Tennessee= |Texas= |Vermont= |Virginia= }}