Guest User

Untitled

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