Difference between revisions of "User:Pseudosphere"
From The Wiki Camp 2
Jump to navigationJump to searchPseudosphere (talk | contribs) m |
Pseudosphere (talk | contribs) m |
||
Line 185: | Line 185: | ||
.win-taskbarclose { | .win-taskbarclose { | ||
border-color: #0000; | border-color: #0000; | ||
+ | } | ||
+ | |||
+ | .mw-footer { | ||
+ | margin-bottom: calc(1em + 40px); | ||
} | } | ||
}} | }} |
Revision as of 06:25, 4 February 2024
Tesseract CSS generation script
from math import tau, cos, sin
#Transform of v-w plane for w=1
# v w
#|A -B*100|
#|nC/100 -nD+n+1|
def S(x):
y = int(x)
if x == y:
return str(y)
r = str(x)
if r.find("e") != -1:
return "0"
return r
#def genTransform(theta, n):
# c = cos(theta)
# s = sin(theta)
# return ("transform:matrix3d(", S(c), ",0,0,", S(n * s * 0.01), ",0,1,0,0,0,0,1,0,", S(s * 100), ",0,0,", S(n - n * c + 1), ");")
def genTransform2(theta, n, A, B, C, D):
c = cos(theta)
s = sin(theta)
return ("transform:matrix3d(", S(c), ",0,0,", S(n * s * 0.01), ",0,", A, ",", C, ",0,0,", B, ",", D, ",0,", S(s * 100), ",0,0,", S(n - n * c + 1), ");")
#for n in range(64):
# k = n / 64
# print(k * 100, "%{", sep="")
# print(*genTransform(k * tau, 0.5), "}", sep="")
def genTransforms(name, offset, A, B, C, D):
print("@keyframes ", name, "{100%,", sep="", end="")
for n in range(256):
k = n / 256
print(S(k * 100), "%{", *genTransform2((k + offset) * tau, 0.5, A, B, C, D), "}", sep="", end="")
print("\n}", end="")
genTransforms("cell-front", 0, "1", "0", "0", "1")
genTransforms("cell-right", 0.25, "0", "1", "-1", "0")
genTransforms("cell-back", 0.5, "-1", "0", "0", "-1")
genTransforms("cell-left", 0.75, "0", "-1", "1", "0")
Brainfuck Rot13 Demo
----------[
[++++++++++<<,.----------] get str
>>[>>]<< go to start
[
---------------------------------------------------- to position plus 13
>++++++++++++++++++++++++++< d = 26
[>->+<[>]>[<+>-]<<[<]>-] modulo
>[-] clear junk
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.[-] print character & clear cell
<<<< next char
]
++++++++++.---------- newline
----------]