GT 145
Decapat
- Katılım
- 29 Temmuz 2021
- Mesajlar
- 725
- Çözümler
- 1
Arkadaşlar hatanın neden olduğunu biliyorum fakat bir türlü düzeltemedim kafayı yemek üzereyim kod şu:
Düzeltirseniz sevinirim.
Python:
#pylint:disable=W0601
#pylint:disable=W0622
#pylint:disable=W0621
#pylint:disable=W0603
from random import randint
from time import sleep
from sys import exit
from os import name,system
from colorama import Fore,init,Back
from threading import Thread
init()
places=["parti salonu","ön koridor","mutfak","kostüm odası","sol koridor","sağ koridor","ofis"]
#main_stage=["Freddy","Bonnie","Chica"]
night=1
power=100
def cls():
system('cls' if name == 'nt' else 'clear')
cls()
def clock():
global t
t=1
while True:
sleep(60)
t+=1
class tool:
def __init__(self,name):
self.name=name
self.status=randint(5,7)
def zarar_ver(self):
self.status-=1
def now_status(self):
if self.status < 2:
return False
else:
return True
def tamir_et(self):
print("{}{} tamir ediliyor..{}".format(Fore.YELLOW,self.name,Fore.RESET))
sleep(randint(2,5))
self.status=randint(5,7)
vent=tool("havalandırma sistemi")
ses_sistemi=tool("ses sistemi")
kamera=tool("kamera sistemi")
class character:
def __init__(self,name):
self.name=name
self.room=places.index("parti salonu")
self.room=int(self.room)
def ilerle(self):
if randint(0,10000) == 1983:
print("""
SAFE ROOM
*****************
*** /BAD END/ ***
*****************
""")
exit()
else:
if self.room+1 >= len(places):
pass
else:
self.room += 1
def call(self,room):
if places[places.index(room)+1] == places[self.room] or places[places.index(room)-1] == places[self.room]:
self.room=places[places.index(room)]
def clear_line(n=1):
LİNE_UP = '\033[1A'
LİNE_CLEAR = '\x1b[2K'
for _ in range(n):
print(LİNE_UP,end=LİNE_CLEAR)
def main():
global menu_busy
menu_busy=True
while True:
if places[sp.room]=="ofis":
cls()
print("""\n
****************************
****** İT'S ME ******
****************************
""")
exit()
if randint(0,int(25/night))==1:
sp.ilerle()
sleep(0.3)
if menu_busy:
cls()
if power<35:
text="""
Saat {}
Power : {}{}{}{}{}
C: Cameras
P: Tools panel
""".format(t,Back.LIGHTRED_EX,Fore.BLACK,power,Fore.RESET,Back.RESET)
elif power>35 and power<70:
text="""
Saat {}
Power : {}{}{}{}{}
C: Cameras
P: Tools panel
""".format(t,Back.LIGHTYELLOW_EX,Fore.BLACK,power,Fore.RESET,Back.RESET)
else:
text="""
Saat {}
Power : {}{}{}{}{}
C: Cameras
P: Tools panel
""".format(t,Back.LIGHTGREEN_EX,Fore.BLACK,power,Fore.RESET,Back.RESET)
print(text)
clear_line(13)
sp=character("Springtrap")
clocker=Thread(target=clock)
clocker.start()
main_thread=Thread(target=main)
main_thread.start()
while True:
req=input()
if req.lower() == "c":
menu_busy=None
print(f"{Fore.GREEN}\n\tSpringtrap {Fore.RESET}-->{Fore.YELLOW}",places[sp.room],"{}".format(Fore.RESET))
kamera.zarar_ver()
places_counter=0
for p in places:
places_counter += 1
if places_counter != 2:
print(f"{places.index(p)} {p}",end="\t| ")
elif places_counter == 2:
print(f"{places.index(p)} {p}")
places_counter=0
places_counter=None
req=int(input("\n{}-->{} ".format(Fore.MAGENTA,Fore.RESET)))
try:
sp.call(places[req])
ses_sistemi.zarar_ver()
except IndexError:
print("{}Bilinmeyen oda!{}".format(Fore.LIGHTRED_EX,Fore.RESET))
ses_sistemi.zarar_ver()
menu_busy=True
elif req.lower()=="p":
menu_busy=None
if ses_sistemi.now_status():
print(f"Ses sistemi{Fore.GREEN} iyi.")
else:
print(f"{Fore.RESET}Ses sistemi{Fore.RED} arızalı!")
if vent.now_status():
print(f"{Fore.RESET}Havalandırma sistemi {Fore.GREEN}iyi.")
else:
print(f"{Fore.RESET}Havalandırma {Fore.RED}arızalı!")
if kamera.now_status():
print(f"{Fore.RESET}Kamera sistemi {Fore.GREEN}iyi.")
else:
print(f"{Fore.RESET}Kamera sistemi {Fore.RED}arızalı!")
req=input("{}-->{} ".format(Fore.MAGENTA,Fore.RESET))
if req.lower()=='k':
kamera.tamir_et()
elif req.lower()=='s':
ses_sistemi.tamir_et()
elif req.lower()=='h' or req.lower()=='v':
vent.tamir_et()
menu_busy=True
File "<string>", line 156
places_counter=None
^
IndentationError: unindent does not match any outer indentation level
Düzeltirseniz sevinirim.
Son düzenleme: