Difference between revisions of "User:Pseudosphere"
From The Wiki Camp 2
Jump to navigationJump to searchPseudosphere (talk | contribs) m |
Pseudosphere (talk | contribs) |
||
Line 294: | Line 294: | ||
* [[User:Pseudosphere/Test Page 2]] | * [[User:Pseudosphere/Test Page 2]] | ||
* [[User:Pseudosphere/Test Page 3]] | * [[User:Pseudosphere/Test Page 3]] | ||
+ | {{Userbox|id=[[File:Tautology.png|50x50px]]|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}} | ||
[[Category:Dark mode pages]] | [[Category:Dark mode pages]] |
Revision as of 00:50, 9 March 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
----------]