fmap uncurry
sortBy
compose2
and compose3
helped tremendouslyfmap curry $ traverse $ fmap uncurry $ uncurry
flip13 = flip . (fmap flip) . flip
exists simply to swap the 1st and 3rd arguments of a function#!/bin/env python3
from random import random
from time import sleep
MSGCOUNTDOWN = "%ss untill randomize"
MSGRANDOMIZE = "tunes randomized"
DELTA = 5 # seconds between each random
FIFOPATH = "./fifo.fifo"
TUNES = {
("ground_control_speed", 4.00, 14.00), # Maximum running speed on the ground. (Higher values make the character move faster).
("ground_control_accel", 0.50, 4.00), # Acceleration on the ground. (Higher values make the character speed up faster).
("ground_friction", 0.30, 1.00), # Ground friction. (Higher values make the character stop faster).
("ground_jump_impulse", 8.00, 18.00), # Jump force from the ground. (Higher values make the character jump higher).
("air_jump_impulse", 6.00, 16.00), # Jump force in the air. (Applies to double jumps; higher values allow higher jumps).
("air_control_speed", 2.00, 9.00), # Maximum speed when moving in the air. (Higher values allow faster air movement).
("air_control_accel", 0.50, 3.00), # Acceleration in the air. (Higher values allow quicker changes in air movement).
("air_friction", 0.70, 1.10), # Air friction. (Higher values reduce the character's air speed more quickly).
("gravity", 0.30, 0.80), # Gravity strength. (Lower values make the character float longer; higher values make them fall faster).
}
def write(s):
with open(FIFOPATH, "w") as fifo:
fifo.write(s)
print(s)
sleep(1)
while True:
out = "broadcast %s\n" % MSGRANDOMIZE
for name, min, max in TUNES:
value = min + random() * (max - min)
value = round(value, 2)
out += "tune %s %s\n" % (name, value)
write(out)
if DELTA > 3:
sleep(DELTA - 3)
for i in range(3):
write("broadcast " + MSGCOUNTDOWN % (3 - i))
sleep(1)
else:
sleep(DELTA)
Can you just redo this script to send a certain command over time?while True:
Function template 1
Function template 2
Function template 3
sleep(time)
(edited)#!/bin/env python3
from time import sleep
MSGRANDOMIZE = "Подпишись на наш Telegram @serv! На 500 подписчиков будет крупный розыгрыш на слоунет. Также у нас дешевыйслоунет и слоунет!"
DELTA = 3600 # интервал между сообщениями в секундах
FIFOPATH = "./fifo.fifo"
def write(s):
with open(FIFOPATH, "w") as fifo:
fifo.write(s)
print(s)
sleep(1)
while True:
write(f"broadcast {MSGRANDOMIZE}")
sleep(DELTA)
(edited)#!/bin/env python3
from time import sleep
MSGRANDOMIZE = "Подпишись на наш Telegram @serv! На 500 подписчиков будет крупный розыгрыш на слоунет. Также у нас дешевыйслоунет и слоунет!"
DELTA = 3600 # интервал между сообщениями в секундах
FIFOPATH = "./fifo.fifo"
def write(s):
with open(FIFOPATH, "w") as fifo:
fifo.write(s)
print(s)
sleep(1)
while True:
write(f"broadcast {MSGRANDOMIZE}")
sleep(DELTA)
(edited)mknod <filename> p
mkfifo
existed/root
? I mean that would make sense... write(f"broadcast {MSGRANDOMIZE}")
to fifo.write(f"broadcast {MSGRANDOMIZE}")
write
is a function defined in the script, not a built-inapp : Vect n a -> Vect m a -> Vect (n + m) a
app Nil ys = ys
app (x :: xs) ys = x :: app xs ys
but hot damn my brain is so fried from writing cursed Haskell that it feels like it's refusing to think about types more complicated than int
const char*
already down^[a-zA-Z0-9\s_-]+$
RenderLoading
?RenderLoading
if we don't reset it before initializing the quad container^[a-zA-Z0-9\s_-]+$
\s
would also match other space characters, I guess we only want
and not tabs/newline/zero-width spaces etc."true"
or "false"
"true"
or "false"
"true"
or "false"
lto = false
does not disable LTO, you have to do lto = "off"
instead: https://doc.rust-lang.org/cargo/reference/profiles.htmlwine cmd /c start ${BUILD_DIR}/tests.exe ^> output.txt
build\\tests.exe
instead of build/tests.exe
fck me I guessfixed
crate a bit in rust for some binary layouts. and working with it is really not nice xD