- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
from gremllm import Gremllm
# Be sure to tell your gremllm what sort of thing it is
counter = Gremllm('counter')
counter.value = 5
counter.increment()
print(counter.value) # 6?
print(counter.to_roman_numerals()) # VI?
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
from gremllm import Gremllm
# Be sure to tell your gremllm what sort of thing it is
counter = Gremllm('counter')
counter.value = 5
counter.increment()
print(counter.value) # 6?
print(counter.to_roman_numerals()) # VI?
https://github.com/awwaiid/gremllm
Нет, вы не поняли. На каждый метод он запускает "ИИ", который додумывает что нужно сделать.
0
def animate_fight (self, игрок):
if self.gamedata.animate_fight == True:
if self.gamedata.fight_animation_progress < 3:
self.gamedata.screen.blit(self.fight1, (self.x - (self.width // 2), self.y - (self.width //2) ))
elif 3 <= self.gamedata.fight_animation_progress < 6:
self.gamedata.screen.blit(self.fight2, (self.x - (self.width // 2), self.y - (self.width //2) ))
elif 6 <= self.gamedata.fight_animation_progress < 9:
self.gamedata.screen.blit(self.fight3, (self.x - (self.width // 2), self.y - (self.width //2) ))
self.gamedata.screen.blit(self.fight1, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
elif 9 <= self.gamedata.fight_animation_progress < 12:
self.gamedata.screen.blit(self.fight4, (self.x - (self.width // 2), self.y - (self.width //2) ))
self.gamedata.screen.blit(self.fight2, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
elif 12 <= self.gamedata.fight_animation_progress < 15:
self.gamedata.screen.blit(self.fight5, (self.x - (self.width // 2), self.y - (self.width //2) ))
self.gamedata.screen.blit(self.fight3, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
elif 15 <= self.gamedata.fight_animation_progress < 18:
self.gamedata.screen.blit(self.fight6, (self.x - (self.width // 2), self.y - (self.width //2) ))
self.gamedata.screen.blit(self.fight4, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
elif 18 <= self.gamedata.fight_animation_progress < 21:
self.gamedata.screen.blit(self.fight5, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
elif 21 <= self.gamedata.fight_animation_progress < 24:
self.gamedata.screen.blit(self.fight6, (игрок.x - (self.width // 2), игрок.y - (self.width // 2) ))
elif 24 <=self.gamedata.fight_animation_progress:
self.gamedata.animating = False
self.gamedata.fight_animation_progress = 0
self.gamedata.animate_fight = False
if 24 > self.gamedata.fight_animation_progress:
self.gamedata.fight_animation_progress += 1
Зачем делить на 3, если можно написать кучу говна?
0
before = []
def bef():
global before
return before
def setB(b):
global before
before = b
def foo():
revert(bef())
0
def pause(c): #replace, assist
if c > 100: waitLong(c)
elif c== 1: wait1s()
elif c== 2: wait2s()
elif c== 3: wait3s()
elif c== 5: wait5s()
elif c== 8: wait8s()
elif c== 10: wait10s()
else:
logger.debug(f"custom timeout, need recheck({c})")
p(c) #ping raspberry instead of direct sleep
def p(c):
time.sleep(c)
def wait1s():
p(1)
def wait2s():
wait1s()
wait1s()
def wait3s():
logger.debug("one, two, three")
p(3)
def wait5s():
logger.debug("5, 4, 3, 2, 1..")
p(5)
def wait8s():
wait5s()
wait3s()
def wait10s():
wait5s()
wait5s()
def waitLong(c):
logger.debug(f"Attention, wait time is too long({c}), need to replace with waiting for some event or ping")
p(c)
def cc():
global client
client.connect()
return(client)
0
import photoshop
photoshop.CreateProgram()
0
def neg(x): return int(bin(x)[2:].rjust(8, '0').replace('1','x').replace('0','1').replace('x','0'), 2)
Операция "NEG"
0
c.execute(f"UPDATE users SET cash = {c.execute(f'SELECT cash FROM users WHERE id = {inter.author.id}') - row[1]} WHERE id = {inter.author.id}")
Новый уровень в говногенерации SQL-запросов...
0
if "=" in cell_content:
command["relation"] = "eq"
elif "≠" in cell_content or "!=" in cell_content:
command["relation"] = "ne"
elif "<" in cell_content or "<" in cell_content:
command["relation"] = "lt"
elif "≤" in cell_content:
command["relation"] = "le"
elif ">" in cell_content or ">" in cell_content:
command["relation"] = "gt"
elif "≥" in cell_content:
command["relation"] = "ge"
Не, ну а как еще-то
0
def razmer(arr):
b = len (arr) - 1
return (array_prov(arr,b))
def array_prov (arr,b):
if b == 0:
return arr[b]
else:
return (arr[b]+array_prov (arr, b-1))
a = [10,12,14,15,18]
print (razmer (a))
0
def print_message(num_of_times) {
for i in range(num_of_times) {
print("Bython is awesome!");
}
}
if __name__ == "__main__" {
print_message(10);
}
Python with braces. Because Python is awesome, but whitespace is awful.
https://pypi.org/project/Bython/