Змея / Говнокод #29153 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 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?

https://github.com/awwaiid/gremllm

Нет, вы не поняли. На каждый метод он запускает "ИИ", который додумывает что нужно сделать.

OCETuHCKuu_nemyx OCETuHCKuu_nemyx, (Updated )

Комментарии (9, +9)

Змея / Говнокод #29149 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
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, если можно написать кучу говна?

1004w 1004w, (Updated )

Комментарии (2, +2)

Змея / Говнокод #29134 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
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)

NikitaTsyb NikitaTsyb, (Updated )

Комментарии (7, +7)

Змея / Говнокод #28934 Ссылка на оригинал

0

  1. 1
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-запросов...

Vindicar Vindicar, (Updated )

Комментарии (9, +9)

Змея / Говнокод #28929 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
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"

Не, ну а как еще-то

youjin1985 youjin1985, (Updated )

Комментарии (2, +2)