User:Audacity/Userboxes/WSPQ
From Wikipedia, the free encyclopedia
According to the World's Smallest Political Quiz, this user is* a Political Centrist
(Personal Freedom: 50; Economic Freedom: 50). |
[edit] Use
{{User:Audacity/Userboxes/WSPQ|personal freedom #|economic freedom #}}
The template takes two arguments, based upon the results that are given by taking the World's Smallest Political Quiz:
- Your personal freedom index (0 to 100)
- Your economic freedom index (0 to 100)
It automatically calculates what to identify you as.
[edit] Note
The actual World's Smallest Political Quiz counts results on the borders between two of the four outer categories as "conservative/liberal statists" or "conservative/liberal libertarians". Due to programming difficulties, this userbox counts such reults as either conservative or liberal.
[edit] Code with explanation
{{#ifeq:<!-- This is going to see whether two variables are true. They define the boundaries of the centrist square. If both are true, it will output Centrist. -->{{#ifexpr:(({{{1|50}}}-{{{2|50}}})*(1-2*({{{1|50}}}-{{{2|50}}}<0))<= 30)|true|false}}<!--Is the absolute value of the difference less than 30? This is the left and right boundaries of the square. -->{{#ifexpr:((100-{{{1|50}}}-{{{2|50}}})*(1-2*(100-{{{1|50}}}-{{{2|50}}}<0))<= 30)|true|false}}<!--Is the absolute value of the difference of the sum and 100 less than 30? This is the top and bottom boundaries of the square. -->|truetrue|Centrist|<!-- If they're not a centrist, sort them into the other 4 categories. -->{{#switch:<!-- This is evaluating whether personal and economic freedom variables are less than or higher than 50, and sorting into 4 categories based on the result. -->{{#ifexpr:({{{1|50}}}>=50)|highp|lowp}}{{#ifexpr:({{{2|50}}}>=50)|highe|lowe}}<!-- Here's the evalutation of the variables. -->|highphighe=Libertarian|highplowe=Liberal|lowphighe=Conservative|lowplowe=Statist<!-- Here's the sorting. -->}}}}