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 | |
# dice - simulate dungeon & dragons dice to generate random values | |
def dice(dicestring): | |
""" | |
1d6 -> random integer between 1 and 6 | |
2d6 -> random integer between 2 and 12 | |
1d20+5 -> random integer between 6 and 26 | |
""" |
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 PySimpleGUI as sg | |
import random | |
from PIL import Image | |
from io import BytesIO | |
import pathlib | |
class Game: | |
tile_size = 80 | |
#image_size = 72*2 # ? # replaced by .size attribute of each monster |
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
#rogue2.py | |
import PySimpleGUI as sg | |
import random | |
herox = 20 | |
heroy = 10 | |
level_1 = """ | |
######################################## | |
#......................................# | |
#......................................# |
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 | |
words = [ | |
"teacher", | |
"classroom", | |
"window", | |
"door", | |
"tree", | |
"light", | |
"table", |
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 | |
import time | |
import PySimpleGUI as sg | |
import datetime | |
#https://github.com/dwyl/english-words/tree/master | |
with open("german.txt") as myfile: | |
wörter = [wort.strip() for wort in myfile.readlines()] | |
#print(wörter) |
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 | |
import PySimpleGUI as sg | |
import matplotlib.pyplot as plt | |
import matplotlib | |
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg | |
def draw_figure(canvas, figure): | |
figure_canvas_agg = FigureCanvasTkAgg( | |
figure, canvas) | |
figure_canvas_agg.draw() |
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 | |
import time | |
zahl1 = random.randint(1,15) | |
zahl2 = random.randint(1,15) | |
startzeit = time.time() | |
while True: | |
print(f"Wieviel ist {zahl1*zahl2} / {zahl2} ?") | |
antwort = input(">>>") |
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 | |
import time | |
text_schlüssel = """ | |
""" | |
text_türe = """ | |
""" |
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
# duell.py | |
import random | |
# 2 kämpfer kämpfen gegeneinander | |
monsternamen = ["Dragomir", "Haudrauf", "King Kong", | |
"Godzilla", "Mister Bean"] | |
waffen = ["Schwert", "Speer", "Axt", "Keule", "Schlagring"] | |
rüstungen = ["Helm", "Schild", "Stiefel", "Lederjacke", |
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 | |
import time | |
import PySimpleGUI as sg | |
with open("german.txt") as myfile: | |
wörter = [wort.strip() for wort in myfile.readlines()] | |
#print(wörter) | |
layout = [ | |
[sg.Text("mein Wort:"), sg.Text("abc", key="text1", |