Modulares programm
Verfasst: Freitag 29. Dezember 2017, 19:40
Ein bisher noch kleines programm, dem ihr mehr hinzufügen könnt!
Folgt einfach dem beispiel der schon enthaltenen Programme und gebt euren Code dazu!
Der Code:
print("type menu()")
#menu========================================================
def menu():
print("type menu() while no programm is running")
print("to access this menu")
print("")
print("available apps:")
print("")
print("jwrite()")
print("dialouge()")
#============================================================
#===========================================================
#justwrite
#===========================================================
def jwrite():
print("a simple text processor with line indication,")
print(" no save or features, jwriteS() to start")
#-------------------------------------------------------------------------------------
def jwriteS():
print("type //end to exit")
line=10
run="true"
while run=="true":
a=input(line)
line=line+1
if a=="//end":
run="false"
#============================================================
#===========================================================
#write a dialouge
def dialouge():
print("a simple programm to write a dialouge")
print("no save, dialogeS() to start")
#-------------------------------------------------------------------------------------
def dialougeS():
you=input("input your name please ")
partner=input("Who do you want to talk to? ")
s=" "
f=1
print("type //end to exit")
while f==1:
a=input(you + s)
print(" ")
b=input(partner + s)
print(" ")
if a=="//end":
f=2
#===========================================================
Folgt einfach dem beispiel der schon enthaltenen Programme und gebt euren Code dazu!
Der Code:
print("type menu()")
#menu========================================================
def menu():
print("type menu() while no programm is running")
print("to access this menu")
print("")
print("available apps:")
print("")
print("jwrite()")
print("dialouge()")
#============================================================
#===========================================================
#justwrite
#===========================================================
def jwrite():
print("a simple text processor with line indication,")
print(" no save or features, jwriteS() to start")
#-------------------------------------------------------------------------------------
def jwriteS():
print("type //end to exit")
line=10
run="true"
while run=="true":
a=input(line)
line=line+1
if a=="//end":
run="false"
#============================================================
#===========================================================
#write a dialouge
def dialouge():
print("a simple programm to write a dialouge")
print("no save, dialogeS() to start")
#-------------------------------------------------------------------------------------
def dialougeS():
you=input("input your name please ")
partner=input("Who do you want to talk to? ")
s=" "
f=1
print("type //end to exit")
while f==1:
a=input(you + s)
print(" ")
b=input(partner + s)
print(" ")
if a=="//end":
f=2
#===========================================================