Compare commits
10 Commits
8e09d01f97
...
fe0b399ded
Author | SHA1 | Date | |
---|---|---|---|
fe0b399ded | |||
73d091d53d | |||
c4695fe6fb | |||
5719bb8641 | |||
218a4e7b0a | |||
d2d21b9e05 | |||
b6b68a2fcb | |||
035e3e9df2 | |||
12ccfb0a36 | |||
831fadb7f2 |
6
.idea/cube.iml
generated
6
.idea/cube.iml
generated
@ -1,10 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.10" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (cube)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
|
||||
</project>
|
2
.idea/vcs.xml
generated
2
.idea/vcs.xml
generated
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
46
main.py
Normal file → Executable file
46
main.py
Normal file → Executable file
@ -1,21 +1,37 @@
|
||||
#!/usr/bin/python3
|
||||
import random
|
||||
cube = 'Würfel-Generator\nZum Würfeln die 1 Drücken.'
|
||||
print(cube.center(54))
|
||||
def cube():
|
||||
from os import system
|
||||
|
||||
cube_ = 'Würfel-Generator\n'
|
||||
system('clear')
|
||||
|
||||
|
||||
def main():
|
||||
while True:
|
||||
try:
|
||||
entry = int(input('1 drücken zum Würfeln.\n'))
|
||||
#entry = int(entry)
|
||||
return entry
|
||||
break
|
||||
|
||||
print('\x1b[H\x1b[1;14H ', cube_)
|
||||
entry = int(input('\x1b[H\x1b[B\x1b[B1 drücken zum Würfeln.\n2 drücken zum beenden.\n'))
|
||||
print('\n')
|
||||
if entry == 1:
|
||||
system('clear')
|
||||
print('\x1b[8;12HDu hast eine \x1b[1;33m%d\x1b[1;0m gewürfelt' % random.randint(1, 6))
|
||||
elif entry == 0 or entry > 2:
|
||||
print('\n')
|
||||
system('clear')
|
||||
print('\n\n\n\n')
|
||||
print('Ups! Da wurde nicht 1 oder 2 gedrückt.\nBitte nochmal versuchen.')
|
||||
elif entry == 2:
|
||||
print('\n')
|
||||
system('clear')
|
||||
print('Danke für\'s würfeln.\nBis Bald!\n')
|
||||
input('Enter zum schließen.\n')
|
||||
exit()
|
||||
except ValueError:
|
||||
print('Ups! Keine Zahl eingegeben. Bitte nochmal versuchen.\n')
|
||||
print('\n')
|
||||
system('clear')
|
||||
print('\n\n\n\n')
|
||||
print('Ups! Da wurde nicht 1 oder 2 gedrückt.\nBitte nochmal versuchen.\n')
|
||||
|
||||
cube()
|
||||
while cube() == 1:
|
||||
print(random.randint(1, 6))
|
||||
#print('1 drücken um erneut zu würfeln')
|
||||
else:
|
||||
print('alles andere')
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user