Advertisement
Shahar_Goldenberg

Tamagochi

Oct 27th, 2022
1,014
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.29 KB | None | 0 0
  1. import random
  2.  
  3. class Tamagochi:
  4.     featerus = [ 0,    100,        0,      100,      0]
  5.             # age, healthbar, exhausted, hunger, bored
  6.     animalType = ["cat", "dog", "bunny", "frog", "dragon"]
  7.     food = []
  8.  
  9.     def __init__(self):
  10.         pets = {"mittzy" : [animalType[0], featrus[2, 100, 0, 5, 20]]}
  11.  
  12.     def eatingTime(featrus):
  13.         if(featerus[3] > 80):
  14.             print("{} לא רעב, נסה מאוחר יותר".format(pets.keys))
  15.  
  16.         else:
  17.             print("הזמן לאכול!, תבחר מה תרצה להאכיל את {}".format(pets.keys))
  18.             print(food)
  19.             choice = int(input())
  20.             n1 = random.randint(0, 10)
  21.             n2 = random.randint(0, 10)
  22.             print("{} צריך לאכול {} אבל, הוא אכל רק {}. כמה נשאר לו לאכול?".format(pets.keys, n1, n2))
  23.             answer = int(input())
  24.             if (n1-n2 == answer):
  25.                 print("כל הכבוד!!!! {} אכל את כל האוכל, הוא כבר לא רעב".format(pets.keys))
  26.                 featerus[3] = 100
  27.             else:
  28.                 print("אופס! התשובה היתה {}, {} עדיין רעב".format(n1-n2,pets.keys))
  29.                 featerus[3] += 10
  30.  
  31.     def playingTime(featrus):
  32.  
  33.     def sleepingTime(featrus):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement