Line 1:
Line 1:
−
{{Mono Dark}}{{:User:Pseudosphere/Torus}}{{#css:
+
{{Mono Dark}}{{:User:Pseudosphere/Torus}}[[File:Spintest.svg]]{{#css:
.mw-collapsible:not(.mw-made-collapsible) {
.mw-collapsible:not(.mw-made-collapsible) {
display: none;
display: none;
Line 214:
Line 214:
<!--Can't use textarea :(-->
<!--Can't use textarea :(-->
<div class="win-textinput"><nowiki>The '''nerpa''' ''(Pusa sibirica)'', '''нерпа''' in [[Cyrillic]], '''νερπα''' in the Greek [[alphabet]], or '''Baikal seal''', is a rotten [[pinniped]] found only in [[Lake Baikal]], though rogue satellite populations exist in thresholds such as [[Toba Aquarium]]. It is the smallest and only purely freshwater species of [[seal]] in the world (other freshwater seal populations exist, but they are either subspecies or only partly freshwater).
<div class="win-textinput"><nowiki>The '''nerpa''' ''(Pusa sibirica)'', '''нерпа''' in [[Cyrillic]], '''νερπα''' in the Greek [[alphabet]], or '''Baikal seal''', is a rotten [[pinniped]] found only in [[Lake Baikal]], though rogue satellite populations exist in thresholds such as [[Toba Aquarium]]. It is the smallest and only purely freshwater species of [[seal]] in the world (other freshwater seal populations exist, but they are either subspecies or only partly freshwater).
−
Nerpas are considered one of the [[Ugly|ugliest]] damn things ever. Their bulging [[Eye|eyes]], their wrinkled faces, their stink of [[gasoline]]. They just sit around doing nothing except taking up space. For these reasons, many are looking forward to the [[total seal extinction]] event. However, [[Niko|one nerpa]] has managed to lead [[Tobaland|an entire country]] as their king, causing many countries to plan an attack on them, or even better, begin the total seal extinction event earlier than expected, with hopes to liberate all peoples of The Wiki Camp 2.
+
Nerpas are considered one of the [[Ugly|ugliest]] damn things ever. Their bulging [[Eye|eyes]], their wrinkled faces, their stink of [[gasoline]]. They just sit around doing nothing except taking up space. For these reasons, many are looking forward to the [[total seal extinction]] event.
−
−
The stink of nerpas is the 92nd of the [[92 Wonders of the Natural World]].
== Trivia ==
== Trivia ==
Line 227:
Line 225:
</div>
</div>
</div>
</div>
−
==Pages I made which are actually good==
+
==Pages I made which are actually good, or took some time/effort to make==
* [[Rotating CSS Tesseract]]
* [[Rotating CSS Tesseract]]
* Other shapes
* Other shapes
Line 250:
Line 248:
** [[Nim (Easy Mode)]]
** [[Nim (Easy Mode)]]
*** [[Nim (Easy Mode) (Easy Mode)]]
*** [[Nim (Easy Mode) (Easy Mode)]]
+
*** [[Nim (Easy Mode) (Cheat Mode)]]
+
** [[Nim (Pedantic Mode)]]
+
*** [[Nim (Pedantic Mode) (Easy Mode)]]
+
* [[Balanced ternary]]
+
* [[Φιnary]]
* [[Calculator 2.0]]
* [[Calculator 2.0]]
* [[Notakto]]
* [[Notakto]]
Line 255:
Line 258:
* [[:/]]
* [[:/]]
* [[:/home]]
* [[:/home]]
−
+
* [[ℝ²]]
+
* [[℘]] (the <math>\pi^2\csc\left(\pi x\right)^2 - \frac{\pi^2}{3}</math> formula took a lot of math to derive; it's the ℘ for Λ=ℤ)
+
* [[Game of Life]]
+
* [[Amiga]]
+
* [[Infinite matter generator]]
+
* [[Windows 98]]
+
* [[Windows 7]]
+
* [[Voting]]
+
* [[Title Screen]]
+
* [[O (group)]]
+
* [[Squircle]]
+
* [[Connect Four]]
+
* [[XHTML]]
+
* [[Clock 2.0]]
+
* [[Windows 3.1]]
+
* [[Webdriver Torso]]
+
* [[Rule 150]]
+
* [[5a/Timer]] (I made just the timer part)
+
* [[3-sphere]]
+
* [[What beats rock?]]
+
* [[Rotating SVG Cube]]
+
* [[Okinchest]]
+
* [[Okinchess]]
+
* [[Rule 110]]
+
* [[DVD in a triangle]]
+
* [[Exterior]]
+
* [[Text Mode]]
+
==Templates==
+
* [[Template:Tesseract CSS]]
+
* [[Template:Tesseract]]
+
* [[Template:Mono Dark]]
+
* [[Template:Windows 3.1]]
+
* [[Template:Select]]
+
* [[Template:CDD]]
+
* [[Template:Discord reply]]
+
* [[Template:Discord quote]]
+
* [[Template:Discord thread]]
+
* [[Template:Discord codeblock]]
+
* [[Template:Discord edited]]
+
* [[Template:Discord pfp]]
+
* [[Template:Drag CSS]]
+
* [[Template:Dimensional]]
+
* [[Template:Chrome sheen]]
+
* [[Template:Random page title]]
+
* [[Template:Random page link]]
+
* [[Template:Discord divider]]
+
* [[Template:Content only]]
+
* [[Template:Cubemap]]
+
* [[Template:Windows 98]]
+
* [[Template:Windows 7]]
+
* [[Template:VR Cubemap]]
+
* <span style="font-family: Rubik, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px;">[[Template:Fandom]]</span>
+
* [[Template:MCText]]
+
* [[Template:WBR]]
+
* [[Template:Text Cuboid]]
+
* [[Template:Disputedly imaginary number]]
+
* [[Template:Transclude guard]]
+
* [[Template:Bit]]
+
* [[Template:Unique number]]
+
* [[Template:Text Mode]]
+
* [[Template:Philosophical argument]]
+
* [[Template:House of Leaves]]
==Scripts I made for pages==
==Scripts I made for pages==
===Licensing===
===Licensing===
Line 265:
Line 329:
<b>THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL I BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</b>
<b>THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL I BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</b>
+
===Bad Coding Practices Warning===
+
Unfortunately, I usually don't comment my code. I might fix this at some point...
===[[Rotating CSS Tesseract|Tesseract]] CSS generator===
===[[Rotating CSS Tesseract|Tesseract]] CSS generator===
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Line 601:
Line 667:
print(elementContainer)
print(elementContainer)
</syntaxhighlight>
</syntaxhighlight>
+
===radio.c===
+
<syntaxhighlight lang="c">
+
#include <assert.h>
+
#include <stdio.h>
+
#include <stdlib.h>
+
#include <string.h>
+
+
#include <unistd.h>
+
+
#ifdef WHITESPACE
+
#define LIVECONST_DEFAULT "background-color: red !important;"
+
#define DEAD_DEFAULT "background-color: #300;"
+
#define LIVE_DEFAULT "background-color: red;"
+
#define STR_LIVE "\n.%s%s {\n\t%s\n}"
+
#define SEP fputs(", ", stdout)
+
#define STR_100 ", 100%"
+
#define STR_A "\n.%s%s {\n\tanimation: %s step-end infinite %s%s;\n}\n@keyframes %s%s {\n\t"
+
#else
+
#define LIVECONST_DEFAULT "background-color:red!important"
+
#define DEAD_DEFAULT "background-color:#300"
+
#define LIVE_DEFAULT "background-color:red"
+
#define STR_LIVE ".%s%s{%s}"
+
#define SEP putchar(',')
+
#define STR_100 ",100%"
+
#define STR_A ".%s%s{animation:%s step-end infinite %s%s}@keyframes %s%s{"
+
#endif
+
+
typedef struct link {
+
struct link* next;
+
unsigned char data[];
+
} link_t;
+
+
static const char base64[] = {
+
'-', '0', '1', '2', '3', '4', '5', '6',
+
'7', '8', '9', 'A', 'B', 'C', 'D', 'E',
+
'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
+
'V', 'W', 'X', 'Y', 'Z', '_', 'a', 'b',
+
'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
+
's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
+
};
+
+
static link_t start;
+
+
static void stdout_err() {
+
fputs("I/O error on stdout\n", stderr);
+
exit(EXIT_FAILURE);
+
}
+
+
int main(int argc, char* argv[]) {
+
const char* liveconst = LIVECONST_DEFAULT;
+
const char* deadprop = DEAD_DEFAULT;
+
const char* liveprop = LIVE_DEFAULT;
+
const char* prefix = "X";
+
const char* time = "1s";
+
unsigned int framesize = 256;
+
for (int c; (c = getopt(argc, argv, "L:c:d:l:o:p:s:t:")) != -1;) switch ((char)c) {
+
case 'L':
+
liveconst = optarg;
+
continue;
+
case 'd':
+
deadprop = optarg;
+
continue;
+
case 'l':
+
liveprop = optarg;
+
continue;
+
case 'o':
+
if (freopen(optarg, "wb", stdout) != NULL) continue;
+
perror("Could not create/open output file");
+
return EXIT_FAILURE;
+
case 'p':
+
prefix = optarg;
+
continue;
+
case 's':
+
framesize = atoi(optarg);
+
if (framesize && framesize <= 65536) continue;
+
fprintf(stderr, "Frame size must be in range [1,65536], but got \"%s\"\n", optarg);
+
return EXIT_FAILURE;
+
case 't':
+
time = optarg;
+
}
+
if (optind < argc && freopen(argv[optind], "r", stdin) == NULL) {
+
perror("Could not open input file");
+
return EXIT_FAILURE;
+
}
+
size_t len = strlen(deadprop);
+
#ifdef WHITESPACE
+
char deadstr[len + 11];
+
deadstr[0] = ' ';
+
deadstr[1] = '{';
+
deadstr[2] = '\n';
+
deadstr[3] = '\t';
+
deadstr[4] = '\t';
+
memcpy(deadstr + 5, deadprop, len);
+
deadstr[len + 5] = '\n';
+
deadstr[len + 6] = '\t';
+
deadstr[len + 7] = '}';
+
deadstr[len + 8] = '\n';
+
deadstr[len + 9] = '\t';
+
deadstr[len + 10] = 0;
+
#else
+
char deadstr[len + 3];
+
deadstr[0] = '{';
+
memcpy(deadstr + 1, deadprop, len);
+
deadstr[len + 1] = '}';
+
deadstr[len + 2] = 0;
+
#endif
+
len = strlen(liveprop);
+
#ifdef WHITESPACE
+
char livestr[len + 10];
+
livestr[0] = ' ';
+
livestr[1] = '{';
+
livestr[2] = '\n';
+
livestr[3] = '\t';
+
livestr[4] = '\t';
+
memcpy(livestr + 5, liveprop, len);
+
livestr[len + 5] = '\n';
+
livestr[len + 6] = '\t';
+
livestr[len + 7] = '}';
+
livestr[len + 8] = '\n';
+
livestr[len + 9] = 0;
+
#else
+
char livestr[len + 3];
+
livestr[0] = '{';
+
memcpy(livestr + 1, liveprop, len);
+
livestr[len + 1] = '}';
+
livestr[len + 2] = 0;
+
#endif
+
link_t* end = &start;
+
unsigned int n = 0;
+
unsigned int k = 0;
+
for (int c; (c = getchar()) != EOF;) {
+
switch ((char)c) {
+
default:
+
continue;
+
case 'X':
+
end->data[k++] = 1;
+
break;
+
case '.':
+
end->data[k++] = 0;
+
}
+
if (k == framesize) {
+
k = 0;
+
if (++n == 65536) {
+
while ((c = getchar()) != EOF) switch ((char)c) {
+
case 'X':
+
case '.':
+
fputs("Too many frames (>65536)\n", stdout);
+
return EXIT_FAILURE;
+
}
+
break;
+
}
+
link_t* l = calloc(1, sizeof(link_t*) + framesize);
+
if (l == NULL) {
+
fputs("Could not allocate memory\n", stderr);
+
return EXIT_FAILURE;
+
}
+
end->next = l;
+
end = l;
+
}
+
}
+
if (ferror(stdin)) {
+
fputs("I/O error on input", stderr);
+
return EXIT_FAILURE;
+
}
+
if (!n || (n == 1 && !k)) {
+
fputs("EOF on input before second frame\n", stderr);
+
return EXIT_FAILURE;
+
}
+
if (k) n++;
+
unsigned int buflen = (n + 1) >> 1;
+
unsigned short dead_buffer[buflen];
+
unsigned short live_buffer[buflen];
+
union {unsigned int block; char bytes[4];} buf;
+
for (unsigned int i = 0; i != framesize; i++) {
+
end = &start;
+
unsigned short depth = 0;
+
unsigned short dead = 0;
+
unsigned short live = 0;
+
unsigned char x;
+
unsigned char prev = 2;
+
do {
+
assert(depth < n);
+
x = end->data[i];
+
if (x != prev) {
+
prev = x;
+
if (x) {
+
assert(live < buflen);
+
live_buffer[live++] = depth;
+
}
+
else {
+
assert(dead < buflen);
+
dead_buffer[dead++] = depth;
+
}
+
}
+
end = end->next;
+
} while (++depth != n);
+
buf.block = 0;
+
assert((i & 0x003f) < 64);
+
buf.bytes[0] = base64[i & 0x003f];
+
if (i & 0xffc0) {
+
assert((i >> 6 & 0x003f) < 64);
+
buf.bytes[1] = base64[i >> 6 & 0x003f];
+
if (i & 0xf000) {
+
assert(i >> 12 < 64);
+
buf.bytes[2] = base64[i >> 12];
+
}
+
}
+
if (!dead) {
+
printf(STR_LIVE, prefix, buf.bytes, liveconst);
+
continue;
+
}
+
if (!live) continue;
+
if (printf(STR_A, prefix, buf.bytes, time, prefix, buf.bytes, prefix, buf.bytes) < 0) stdout_err();
+
depth = 0;
+
goto dead_loop;
+
do {
+
if (SEP < 0) stdout_err();
+
dead_loop:
+
assert(depth < dead);
+
if (printf("%.55f%%", (float)(dead_buffer[depth++] * 100) / n) < 0) stdout_err();
+
} while (depth != dead);
+
if ((x && fputs(STR_100, stdout) < 0) || fputs(deadstr, stdout)) stdout_err();
+
depth = 0;
+
goto live_loop;
+
do {
+
if (SEP < 0) stdout_err();
+
live_loop:
+
assert(depth < live);
+
if (printf("%.55f%%", (float)(live_buffer[depth++] * 100) / n) < 0) stdout_err();
+
} while (depth != live);
+
if ((!x && fputs(STR_100, stdout) < 0) || fputs(livestr, stdout)) stdout_err();
+
if (putchar('}') < 0) stdout_err();
+
}
+
return EXIT_SUCCESS;
+
}
+
</syntaxhighlight>
+
[[Game of Life]]: <code>./radio -L "background-color:#000!important" -d "background-color:#FFF" -l "background-color:#000" -o biglife.css -s 1444 -t 16s {{Tooltip|biglife.txt|A big file full of raw cell states}}</code>
+
===[[Amiga]] Boing Ball facet CSS generation===
+
<syntaxhighlight lang="python">
+
import math
+
+
w = 0.39018064403225655
+
sin = 0.3826834323650898
+
sinx = 0.39018064403225655
+
def height(y):
+
n = (y * 2 + 1) / 16 * math.pi
+
return math.hypot(math.sin(n) * sin, math.cos(n) * sinx)
+
width = lambda y: math.cos(y / 8 * math.pi) * w
+
+
def getCSS(y):
+
wid = width(y)
+
n = width(y + 1) / wid
+
print("clip-path: polygon(", (1 - n) / 2 * 100, "% 0, ", (1 + n) / 2 * 100, "% 0, 100% 100%, 0 100%);\nheight: ", height(y) * 50, "%;\ntransform: rotateX(", y / 16, "turn) ", "translateZ(96px) rotateX(0.03125turn) translateY(-50%);\nwidth: ", wid * 50, "%;", sep="")
+
</syntaxhighlight>
+
===[[O (group)]] generator===
+
<syntaxhighlight lang="python">
+
import mwcollapse
+
+
d = {
+
"R": (0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1),
+
"L": (0, 0, -1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1),
+
"U": (1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1),
+
"D": (1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1)
+
}
+
n = 0
+
+
def transition(state, transition):
+
s = d[transition]
+
return tuple(sum(s[row + k * 4] * state[k + col * 4] for k in range(4)) for col, row in (divmod(n, 4) for n in range(16)))
+
def stategen(state):
+
global n
+
s = tuple(i == n for i in range(24))
+
print("#mw-customcollapsible-O-", n, ":not(.mw-collapsed) ~ * .cube {\n\ttransform: matrix3d", str(state), ";\n}", sep="")
+
n += 1
+
return s
+
elements = mwcollapse.ElementContainer(
+
*(mwcollapse.Collapsible("div", i) for i in range(24)),
+
'<table style="margin: auto"><tr><td colspan="3">',
+
mwcollapse.Trigger("span", "U", "⮝"),
+
"</td></tr><tr><td>",
+
mwcollapse.Trigger("span", "L", "⮜"),
+
"</td><td>{{Cube|[[File:FRONT.BMP.PNG]]|[[File:BACK.BMP.PNG]]|[[File:RIGHT.BMP.PNG]]|[[File:LEFT.BMP.PNG]]|[[File:TOP.BMP.PNG]]|[[File:BOTTOM.BMP.PNG]]|256}}</td><td>",
+
mwcollapse.Trigger("span", "R", "⮞"),
+
'</td></tr><tr><td colspan="3">',
+
mwcollapse.Trigger("span", "D", "⮟"),
+
"</td></tr></table>"
+
)
+
print("\n====== CSS ======\n")
+
elements.compile("O", mwcollapse.genStateMachine(d.keys(), transition, stategen, (1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)))
+
print("\n==== WIKITXT ====\n")
+
print(elements)
+
</syntaxhighlight>
+
===[[Nim (Pedantic Mode) (Easy Mode)]] generator===
+
<syntaxhighlight lang="python">
+
#!/bin/python3
+
import math
+
import random
+
import warnings
+
+
import mwcollapse
+
+
class nimstate:
+
__slots__ = "piles", "prev"
+
def __init__(self, piles, prev):
+
self.piles = tuple(piles)
+
self.prev = prev
+
def __eq__(self, other):
+
return False if other == None else self.piles == other.piles and self.prev == other.prev
+
def __hash__(self):
+
return hash(self.piles) ^ hash(self.prev)
+
+
def parity(iterable):
+
p = 0
+
for n in iterable:
+
p ^= n
+
return p
+
+
nurpos = (2, 4, 3, 6, 4)
+
nurposcount = tuple(range(len(nurpos)))
+
offsets = tuple(sum(nurpos[0:n]) for n in range(len(nurpos)))
+
count = offsets[-1] + nurpos[-1]
+
+
def transition(state, transition):
+
l = list(state.piles)
+
if transition != None:
+
if (state.prev == None or transition == state.prev) and l[transition] != 0:
+
l[transition] -= 1
+
return nimstate(l, transition)
+
elif state.prev != None:
+
m = max(l)
+
if m != 0:
+
moves = []
+
#Try to find a winning move
+
for n in range(1, m + 1):
+
for i in nurposcount:
+
l[i] -= n
+
if l[i] >= 0 and parity(l) == 0:
+
moves.append(nimstate(l, None))
+
l = list(state.piles)
+
if len(moves) != 0:
+
return random.choice(moves)
+
#If that fails, try to find a move resulting in no duplicate piles
+
for n in range(1, m + 1):
+
for i in nurposcount:
+
if l[i] >= n:
+
yes = True
+
l[i] -= n
+
for j in nurposcount:
+
if i != j and l[i] == l[j]:
+
yes = False
+
break
+
if yes:
+
moves.append(nimstate(l, None))
+
l = list(state.piles)
+
if len(moves) != 0:
+
return random.choice(moves)
+
#If that fails, just do whatever
+
n = random.choice([i for i in nurposcount if l[i] != 0])
+
l[n] -= random.randint(1, l[n])
+
return nimstate(l, None)
+
def stategen(state):
+
l = []
+
for i, n in enumerate(state.piles):
+
l.extend(k < n for k in range(nurpos[i]))
+
l.extend((state.prev == None, state.prev != None) if max(state.piles) == 0 else (False, False))
+
return l
+
+
stateMachine = mwcollapse.genStateMachine((*range(len(nurpos)), None), transition, stategen, nimstate(nurpos, None))
+
elementContainer = mwcollapse.ElementContainer(
+
*(mwcollapse.Element("div",
+
'<p class="nurpons">',
+
*(mwcollapse.Collapsible("span", k, "[[File:Nerpawhite.png|64px|link=]]") for k in range(o, o + nurpos[i])),
+
'</p>\n<p class="nimbuttons">',
+
mwcollapse.Trigger("span", i, "Remove one", attributes={"class": "nimbutton"}),
+
'<span class="nobutton">Remove one</span>',
+
"</p>\n", attributes={"class": "pile"}) for i, o in enumerate(offsets)),
+
'<p class="nimbuttons">',
+
mwcollapse.Trigger("span", None, "End turn", attributes={"class": "nimbutton"}),
+
'<span class="nobutton">End turn</span>',
+
"</p>\n",
+
mwcollapse.Collapsible("p", count, "YOU LOSE<br/>[https://camp2.rectangle.zone/index.php?title=Nim_(Pedantic_Mode)_(Easy_Mode) TRY AGAIN]", attributes={"class": "bigtexty"}),
+
mwcollapse.Collapsible("p", count + 1, "YOU [[Nim (Pedantic Mode) (Easy Mode)/Wiki Camp 2 Challenge Crystal|WIN]]", attributes={"class": "bigtexty"}))
+
elementContainer.compile("nim", stateMachine)
+
print(elementContainer)
+
</syntaxhighlight>
+
===[[Okinchess]] generator===
+
<syntaxhighlight lang="python">
+
import sys
+
+
alpha = "abcdefgh"
+
+
l = ["""{{#css:
+
#B table{
+
border-spacing:0;
+
height:512px;
+
width:512px
+
}
+
#B td:nth-child(2n+1),#B tr:nth-child(2n) td:nth-child(2n){
+
background-color:#FFF
+
}
+
#B td:nth-child(2n),#B tr:nth-child(2n) td:nth-child(2n+1){
+
background-color:#000;
+
}#B td{
+
padding:0;
+
vertical-align:top
+
}.D {
+
background-color:#0F07;
+
display:none;
+
height:48px;
+
margin:8px;
+
position:absolute;
+
width:48px
+
}.P{
+
align-items:center;
+
border-radius:50%;
+
display:flex;
+
height:64px;
+
position:absolute;
+
transition:0.5s ease translate;
+
width:64px
+
}.P:nth-child(2n) img{
+
filter:invert()
+
}
+
""".replace("\n", ""), ",".join(f"#mw-customcollapsible-w{x}:not(.mw-collapsed)~#B .w{x},#mw-customcollapsible-b{x}:not(.mw-collapsed)~#B .b{x}" for x in alpha), "{background-color: #0F07}"]
+
+
#Piece moving rules
+
for y in range(1, 9):
+
for i, x in enumerate(alpha):
+
L = []
+
#Rules for when a piece is in range of a destination
+
for k, z in enumerate(alpha):
+
if abs(i - k) < y - 1:
+
#White move up
+
L.append(f"#mw-customcollapsible-w{z}P{x}{y - 1}.mw-collapsed~#B #w{z}D{x}{y}")
+
if i != 0 and abs(i - k - 1) < y - 1:
+
#White capture right
+
L.extend(f"#mw-customcollapsible-w{z}P{alpha[i - 1]}{y - 1}.mw-collapsed~#mw-customcollapsible-b{c}P{x}{y}.mw-collapsed~#B #w{z}D{x}{y}R{c}" for l, c in enumerate(alpha) if abs(i - l) < 9 - y)
+
if i != 7 and abs(i - k + 1) < y - 1:
+
#White capture left
+
L.extend(f"#mw-customcollapsible-w{z}P{alpha[i + 1]}{y - 1}.mw-collapsed~#mw-customcollapsible-b{c}P{x}{y}.mw-collapsed~#B #w{z}D{x}{y}L{c}" for l, c in enumerate(alpha) if abs(i - l) < 9 - y)
+
if abs(i - k) < 8 - y:
+
#Black move down
+
L.append(f"#mw-customcollapsible-b{z}P{x}{y + 1}.mw-collapsed~#B #b{z}D{x}{y}")
+
if i != 0 and abs(i - k - 1) < 8 - y:
+
#Black capture right
+
L.extend(f"#mw-customcollapsible-w{c}P{x}{y}.mw-collapsed~#mw-customcollapsible-b{z}P{alpha[i - 1]}{y + 1}.mw-collapsed~#B #b{z}D{x}{y}R{c}" for l, c in enumerate(alpha) if abs(i - l) < y)
+
if i != 7 and abs(i - k + 1) < 8 - y:
+
#Black capture left
+
L.extend(f"#mw-customcollapsible-w{c}P{x}{y}.mw-collapsed~#mw-customcollapsible-b{z}P{alpha[i + 1]}{y + 1}.mw-collapsed~#B #b{z}D{x}{y}L{c}" for l, c in enumerate(alpha) if abs(i - l) < y)
+
l.append(",".join(L))
+
l.append("{display:block}")
+
#Rules for blocking motion
+
l.append(":is(")
+
l.append(",".join([f"#mw-customcollapsible-w{z}C:not(.mw-collapsed)~#mw-customcollapsible-w{z}P{x}{y}.mw-collapsed" for k, z in enumerate(alpha) if abs(i - k) < y] + [f"#mw-customcollapsible-b{z}C:not(.mw-collapsed)~#mw-customcollapsible-b{z}P{x}{y}.mw-collapsed" for k, z in enumerate(alpha) if abs(i - k) < 9 - y]))
+
l.append(")~#B :is(")
+
L = [f"#w{z}D{x}{y}" for k, z in enumerate(alpha) if abs(i - k) < y - 1] + [f"#b{z}D{x}{y}" for k, z in enumerate(alpha) if abs(i - k) < 8 - y]
+
while "" in L:
+
L.remove("")
+
l.append(",".join(L))
+
l.append("){display:none}")
+
+
#Piece positioning
+
for y in range(1, 9):
+
for i, x in enumerate(alpha):
+
l.append(",".join([f"#mw-customcollapsible-w{z}P{x}{y}.mw-collapsed~#B .w{z}" for k, z in enumerate(alpha) if abs(i - k) < y] + [f"#mw-customcollapsible-b{z}P{x}{y}.mw-collapsed~#B .b{z}" for k, z in enumerate(alpha) if abs(i - k) < 9 - y]))
+
l.append(f" {{translate:{i}00% {8 - y}00%}}")
+
+
print(sum(len(s) for s in l) - 7, file=sys.stderr)
+
+
l.append("}")
+
+
#Piece selection & capture memory
+
l.extend(f"{{{{Multitarget customcollapsible|w{x}|mw-collapsed|display:none !important}}}}{{{{Multitarget customcollapsible|w{x}C||display:none !important}}}}{{{{Multitarget customcollapsible|b{x}|mw-collapsed|display:none !important}}}}{{{{Multitarget customcollapsible|b{x}C||display: none !important}}}}" for x in "abcdefgh")
+
+
#Position memory
+
for y in range(1, 9):
+
for i, x in enumerate(alpha):
+
l.extend(f'<div class="mw-collapsible{" mw-collapsed" if y == 1 and x == z else ""}" id="mw-customcollapsible-w{z}P{x}{y}"></div>' for k, z in enumerate(alpha) if abs(i - k) < y)
+
l.extend(f'<div class="mw-collapsible{" mw-collapsed" if y == 8 and x == z else ""}" id="mw-customcollapsible-b{z}P{x}{y}"></div>' for k, z in enumerate(alpha) if abs(i - k) < 9 - y)
+
+
l.append('<div id="B">')
+
+
#The nerpas
+
l.extend(f'<div class="mw-customcollapsible-w{x}C P w{x} mw-customtoggle-w{x}">[[File:Nerpawhite.png|64x64px|link=]]</div><div class="mw-customcollapsible-b{x}C P b{x} mw-customtoggle-b{x}">[[File:Nerpawhite.png|64x64px|link=]]</div>' for x in alpha)
+
+
l.append("<table>")
+
+
#Moves
+
for y in range(8, 0, -1):
+
l.append("<tr>")
+
for i, x in enumerate(alpha):
+
l.append("<td>")
+
for k, z in enumerate(alpha):
+
d = abs(i - k)
+
if d < y - 1:
+
#White move up
+
l.append(f'<div class="mw-customcollapsible-w{z} mw-customcollapsible-w{z}C D mw-customtoggle-w{z} mw-customtoggle-w{z}P{x}{y - 1} mw-customtoggle-w{z}P{x}{y}" id="w{z}D{x}{y}"></div>')
+
if i != 0 and abs(i - k - 1) < y - 1:
+
#White capture right
+
l.extend(f'<div class="mw-customcollapsible-w{z} mw-customcollapsible-w{z}C mw-customcollapsible-b{c}C D mw-customtoggle-w{z} mw-customtoggle-b{c}C mw-customtoggle-w{z}P{alpha[i - 1]}{y - 1} mw-customtoggle-w{z}P{x}{y}" id="w{z}D{x}{y}R{c}"></div>' for l, c in enumerate(alpha) if abs(i - l) < 9 - y)
+
if i != 7 and abs(i - k + 1) < y - 1:
+
#White capture left
+
l.extend(f'<div class="mw-customcollapsible-w{z} mw-customcollapsible-w{z}C mw-customcollapsible-b{c}C D mw-customtoggle-w{z} mw-customtoggle-b{c}C mw-customtoggle-w{z}P{alpha[i + 1]}{y - 1} mw-customtoggle-w{z}P{x}{y}" id="w{z}D{x}{y}L{c}"></div>' for l, c in enumerate(alpha) if abs(i - l) < 9 - y)
+
if d < 8 - y:
+
#Black move down
+
l.append(f'<div class="mw-customcollapsible-b{z} mw-customcollapsible-b{z}C D mw-customtoggle-b{z} mw-customtoggle-b{z}P{x}{y + 1} mw-customtoggle-b{z}P{x}{y}" id="b{z}D{x}{y}"></div>')
+
if i != 0 and abs(i - k - 1) < 8 - y:
+
#Black capture right
+
l.extend(f'<div class="mw-customcollapsible-b{z} mw-customcollapsible-b{z}C mw-customcollapsible-w{c}C D mw-customtoggle-b{z} mw-customtoggle-w{c}C mw-customtoggle-b{z}P{alpha[i - 1]}{y + 1} mw-customtoggle-b{z}P{x}{y}" id="b{z}D{x}{y}R{c}"></div>' for l, c in enumerate(alpha) if abs(i - l) < y)
+
if i != 7 and abs(i - k + 1) < 8 - y:
+
#Black capture left
+
l.extend(f'<div class="mw-customcollapsible-b{z} mw-customcollapsible-b{z}C mw-customcollapsible-w{c}C D mw-customtoggle-b{z} mw-customtoggle-w{c}C mw-customtoggle-b{z}P{alpha[i + 1]}{y + 1} mw-customtoggle-b{z}P{x}{y}" id="b{z}D{x}{y}L{c}"></div>' for l, c in enumerate(alpha) if abs(i - l) < y)
+
l.append("</td>")
+
l.append("</tr>")
+
+
l.append("</table></div>[[Category:Minigames]][[Category:Collapsible minigames]][[Category:Pages which use over 10 kilobytes of CSS]][[Category:Pages which use over 100 kilobytes of CSS]][[Category:Pages which use over 500 kilobytes of CSS]][[Category:Two-player games]]")
+
+
print(sum(len(s) for s in l), file=sys.stderr)
+
+
print("".join(l))
+
</syntaxhighlight>
+
===[[Rule 110]] generator===
+
<syntaxhighlight lang="python">
+
#!/bin/python3
+
#output is currently at least around 2x larger than it should be, since all triggers are reversible, but mwcollapse can't optimize for that yet
+
import mwcollapse
+
+
rulenum = 110
+
rule = tuple((1 << n & rulenum) != 0 for n in range(8))
+
depth = 8
+
+
def transition(state, transition):
+
return tuple(state[n] != (n == transition) for n in range(8))
+
def stategen(state):
+
result = list(state)
+
for n in range(depth - 1):
+
state = [rule[int(state[k - 1 & 7]) << 2 | int(state[k]) << 1 | int(state[k + 1 & 7])] for k in range(8)]
+
result.extend(state)
+
return (not x for x in result)
+
+
elementContainer = mwcollapse.ElementContainer(
+
f"""{{{{#css:
+
#w-{rulenum} {{
+
border-spacing: 0;
+
margin: auto;
+
}}
+
#w-{rulenum} span {{
+
display: inline-block;
+
height: 100%;
+
width: 100%;
+
}}
+
#w-{rulenum} td {{
+
background: #FFF;
+
display: table-cell !important;
+
height: 64px;
+
outline: 1px solid #CCC;
+
width: 64px;
+
}}
+
#w-{rulenum} .mw-collapsed {{
+
background: #000;
+
}}
+
}}}}
+
Click the top cells!""",
+
mwcollapse.Element("table",
+
mwcollapse.Element("tr",
+
*(mwcollapse.Toggleable("td", n, mwcollapse.Trigger("span", n)) for n in range(8))
+
),
+
*(mwcollapse.Element("tr",
+
*(mwcollapse.Toggleable("td", x + y * 8) for x in range(8))
+
) for y in range(1, depth)),
+
attributes={"id": "w-110"}),
+
"[[Category:Rules]][[Category:Math]][[Category:Cellular automata]][[Category:Pages that don't even remotely resemble a Wikipedia article]]"
+
)
+
elementContainer.compile("w", mwcollapse.genStateMachine(range(8), transition, stategen, tuple(False for n in range(8))))
+
print(elementContainer)
+
</syntaxhighlight>
==Kepler–Poinsot polyhedra==
==Kepler–Poinsot polyhedra==
<ul style="list-style:none" class="polyh-list">
<ul style="list-style:none" class="polyh-list">
Line 610:
Line 1,254:
</ul>
</ul>
==Subpages==
==Subpages==
−
* [[User:Pseudosphere/Test Page]]
+
* [[/Test Page]]
−
* [[User:Pseudosphere/Test Page 2]]
+
* [[/Test Page 2]]
−
* [[User:Pseudosphere/Test Page 3]]
+
* [[/Test Page 3]]
−
* [[User:Pseudosphere/mwcollapse.py]]
+
* [[/mwcollapse.py]]
−
* [[User:Pseudosphere/Torus]]
+
* [[/Torus]]
{{Userbox|id=[[File:Tautology.png|50x50px|link=Tautology]]|id-s=15|info=This user is.|info-fc=#000|info-c=#FFF|info-s=9|info-p=1pt|info-lh=1.05em|border-c=#777|border-s=5}}
{{Userbox|id=[[File:Tautology.png|50x50px|link=Tautology]]|id-s=15|info=This user is.|info-fc=#000|info-c=#FFF|info-s=9|info-p=1pt|info-lh=1.05em|border-c=#777|border-s=5}}
+
<center style="filter: invert(); margin-top: 1968.83px;">[[File:Exceptionalmindmap2.png|link=196883]]</center>
+
<p style="font-family: serif; font-size: 200%;">:Þ</p>