This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
while True: | |
a = input("Enter the first number and press RETURN >> ") | |
try: | |
num1 = int(a) | |
except: | |
continue | |
break | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
# erfinde mehr Wörter! | |
freunde = ["Simon", "Paolo", "Paul", "Hannes", "Cooli", "Elias", "Bieny"] | |
orte = ["im Kino", "am Spielplatz", "im Uboot", "im Pilz", "im Studio", "am Arbeitsplatz"] | |
# verben: wer macht was mit wem | |
verben = ["küsst", "schlägt", "beißt", "bewundert", "beschimpft", "besabbert"] | |
adjektive = ["ehrenhaft", "großartig", "brutal", "schlampig", "aufgeregt", "nervös", "unausgeschlafen"] | |
# probiere range(1,5) | |
for x in range(6): | |
wer = random.choice(freunde) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3 | |
import random | |
import easygui | |
m = easygui.choicebox("Die Türen", choices=["Einstellungen","spielen","Ende"]) | |
if m == "Ende": | |
easygui.msgbox("Tschüss!") | |
sys.exit() | |
#if m == "spielen": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
# legend: #=rock .=floor f=food $=gold | |
DUNGEON = ''' | |
############################################### | |
#.....fff.#..............#f#.$#.....#.......#$# | |
#....S....#..............###....###.#.....#.#.# | |
#....S.S..f.....$...f.........##$......f..#...# | |
############################################### | |
''' # add more lines to the dungeon! | |
PLAYER = '@' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Breakout Game</title> | |
<style> | |
* { padding: 0; margin: 0; } | |
canvas { background: #eee; display: block; margin: 0 auto; } | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Flappy Rectangle</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
<style> | |
canvas { | |
border:1px solid #d3d3d3; | |
background-color: #f1f1f1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
author: Simon HEPPNER | |
email: simon.pablo.heppner@gmail.com | |
license: gpl, see http://www.gnu.org/licenses/gpl-3.0.de.html | |
idea: template to show how to move and rotate pygames Sprites | |
this example is tested using python 3.4 and pygame | |
needs: file 'babytux.png' in subfolder 'data' | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import easygui as e | |
import math | |
import random as r | |
import turtle as t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
siege_angreifer = 0 | |
siege_verteidiger = 0 | |
siege_uebernehmer = 0 | |
for runde in range(100): | |
angriff = random.randint(1,6) | |
verteidigung = random.randint(1,6) | |
uebernehmer = random.randint(2,12) | |
print('runde:', runde, 'angriff:',angriff,'verteidigung:',verteidigung, 'übernehmer:', uebernehmer) | |
if uebernehmer > verteidigung and uebernehmer> angriff: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3 | |
import random | |
import easygui | |
m = easygui.choicebox("Die Türen", choices=["Einstellungen","spielen","Ende"]) | |
if m == "Ende": | |
easygui.msgbox("Tschüss!") | |
sys.exit() | |
#if m == "spielen": |