Guest User

Untitled

a guest
May 13th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.45 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. import random
  3. shit = [ "дерьмо", "говно", "сладкий хлеб", "говнище", "какашка", "какаха", "дерьмецо", "говнецо", "гавно", "фекалии" ]
  4. eat  = [ "жрать", "хавать", "глотать", "проглотить", "съесть", "поесть", "пожрать", "сожрать", "есть", "кушать", "скушать", "покушать" ]
  5. mouth = [ "рот", "рта", "ротешник", "ротец", "ротик", "пасть", "хавальник", "хлебало", "ротан", "ротовую полость", "ротовой полости", "спермоприёмник" ]
  6. put = [ "положить", "засунуть", "запихнуть", "вставить", "вложить", "вбросить" ]
  7. take  = [ "схватить", "взять", "подобрать", "поднять" ]
  8. inside = [ "в", "вовнутрь", "внутрь" ]
  9. ignored_words = [ "в", "внутрь" ]
  10.  
  11. def strip_ignored(str) :
  12.     arr = str.split(' ')
  13.     res = []
  14.     for x in arr:
  15.         if not x in ignored_words:
  16.             res.append(x)
  17.     return ' '.join(res)
  18.  
  19. def compare(alias_groups, str) :
  20.     # одиночные команды
  21.     if len(alias_groups) == 1:
  22.         for w1 in alias_groups[0]:
  23.             if w1 == str:
  24.                 return True
  25.         wstr = str.split(' ')
  26.         for x in range(0, len(wstr)):
  27.             if len(wstr[x]) > 4:
  28.                 wstr[x] = wstr[x][:-1]
  29.         str = ' '.join(wstr)
  30.         for w1 in alias_groups[0]:
  31.             w1tmp = w1
  32.             if len(w1tmp) > 4:
  33.                 w1tmp = w1tmp[:-1]
  34.             if w1tmp == str:
  35.                 return True
  36.     # двойные команды
  37.     if len(alias_groups) == 2:
  38.         for w1 in alias_groups[0]:
  39.             for w2 in alias_groups[1]:
  40.                 if w1 + " " + w2 == str:
  41.                     return True
  42.         wstr = str.split(' ')
  43.         for x in range(0, len(wstr)):
  44.             if len(wstr[x]) > 4:
  45.                 wstr[x] = wstr[x][:-1]
  46.         str = ' '.join(wstr)
  47.         for w1 in alias_groups[0]:
  48.             for w2 in alias_groups[1]:
  49.                 w1tmp = w1
  50.                 w2tmp = w2
  51.                 if len(w1tmp) > 4:
  52.                     w1tmp = w1tmp[:-1]
  53.                 if len(w2tmp) > 4:
  54.                     w2tmp = w2tmp[:-1]
  55.                 if w1tmp + " " + w2tmp == str:
  56.                     return True
  57.     # тройные команды
  58.     if len(alias_groups) == 3:
  59.         for w1 in alias_groups[0]:
  60.             for w2 in alias_groups[1]:
  61.                 for w3 in alias_groups[2]:
  62.                     if w1 + " " + w2 + " " + w3 == str:
  63.                         return True
  64.         wstr = str.split(' ')
  65.         for x in range(0, len(wstr)):
  66.             if len(wstr[x]) > 4:
  67.                 wstr[x] = wstr[x][:-1]
  68.         str = ' '.join(wstr)
  69.         for w1 in alias_groups[0]:
  70.             for w2 in alias_groups[1]:
  71.                 for w3 in alias_groups[2]:
  72.                     w1tmp = w1
  73.                     w2tmp = w2
  74.                     w3tmp = w3
  75.                     if len(w1tmp) > 4:
  76.                         w1tmp = w1tmp[:-1]
  77.                     if len(w2tmp) > 4:
  78.                         w2tmp = w2tmp[:-1]
  79.                     if len(w3tmp) > 4:
  80.                         w3tmp = w3tmp[:-1]
  81.                     if w1tmp + " " + w2tmp + " " + w3tmp == str:
  82.                         return True
  83.     # четверные команды
  84.     if len(alias_groups) == 4:
  85.         for w1 in alias_groups[0]:
  86.             for w2 in alias_groups[1]:
  87.                 for w3 in alias_groups[2]:
  88.                     for w4 in alias_groups[3]:
  89.                         if w1 + " " + w2 + " " + w3 + " " + w4 == str:
  90.                             return True
  91.         wstr = str.split(' ')
  92.         for x in range(0, len(wstr)):
  93.             if len(wstr[x]) > 4:
  94.                 wstr[x] = wstr[x][:-1]
  95.         str = ' '.join(wstr)
  96.         for w1 in alias_groups[0]:
  97.             for w2 in alias_groups[1]:
  98.                 for w3 in alias_groups[2]:
  99.                     for w4 in alias_groups[3]:
  100.                         w1tmp = w1
  101.                         w2tmp = w2
  102.                         w3tmp = w3
  103.                         w4tmp = w4
  104.                         if len(w1tmp) > 4:
  105.                             w1tmp = w1tmp[:-1]
  106.                         if len(w2tmp) > 4:
  107.                             w2tmp = w2tmp[:-1]
  108.                         if len(w3tmp) > 4:
  109.                             w3tmp = w3tmp[:-1]
  110.                         if len(w4tmp) > 4:
  111.                             w4tmp = w4tmp[:-1]
  112.                         if w1tmp + " " + w2tmp + " " + w3tmp + " " + w4tmp == str:
  113.                             return True
  114.     return False
  115.  
  116. def multi_compare(arrs, str):
  117.     for arr in arrs:
  118.         if compare(arr, str):
  119.             return True
  120.     str = strip_ignored(str)
  121.     for arr in arrs:
  122.         if compare(arr, str):
  123.             return True
  124.     return False
  125.  
  126. print "Поешь говна. А чтобы выйти Ctrl+C нажми."
  127. shit_eating = [ "Говнеца ты покушал", "Скушал фекалий ты", "Ты дерьма поел, лол)))" ]
  128. while True:
  129.     user_input = raw_input('>')
  130.  
  131.     if multi_compare([
  132.             [eat, shit],
  133.             [shit, eat],
  134.             [put, shit, inside, mouth],
  135.             [take, mouth, shit],
  136.             [take, mouth, shit],
  137.             [put, shit, mouth],
  138.             [put, mouth, shit]
  139.         ], user_input):
  140.         print shit_eating[random.randrange(0, len(shit_eating))]
  141.     else:
  142.         print "Команда не распознана."
Advertisement
Add Comment
Please, Sign In to add comment