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", |
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
from nicegui import ui, app | |
from nicegui.events import ClickEventArguments | |
import random | |
app.add_static_files('/images', 'images' ) | |
lookup = { | |
"Scissors": { | |
"Scissors": "It's a draw.", | |
"Rock": "Rock ruins scissors. You lose.", |
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 vpython as vp | |
xarrow = vp.arrow(pos=vp.vector(0,0,0), axis=vp.vector(1,0,0), color=vp.vector(1,0,0)) | |
yarrow = vp.arrow(pos=vp.vector(0,0,0), axis=vp.vector(0,1,0), color=vp.vector(0,1,0)) | |
zarrow = vp.arrow(pos=vp.vector(0,0,0), axis=vp.vector(0,0,1), color=vp.vector(0,0,1)) | |
barrel1 = vp.cylinder(pos=vp.vector(-1,1,0), radius=0.25, axis=vp.vector(3,0,0), color=vp.vector(0.6,0.6,0.6)) |
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
# requriements: | |
# sudo pip3 install vpython | |
# sudo pip3 install pygame | |
import vpython as v | |
import random | |
import pygame | |
#except ModuleNotFoundError: | |
# print("I could not import pygame - joystick support is disabled. Try to (re)install pygame") |
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
# Animation für jeden Würfel | |
import random | |
import PySimpleGUI as sg | |
animation_ende = {"w1":0, | |
"w2":0, | |
"w3":0, | |
"w4":0, | |
"w5":0, |
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 turtle | |
import random | |
screen = turtle.getscreen() | |
screen.setup(width=1.0, height=0.9, startx=0, starty=0) | |
width = 1000 | |
height = 500 | |
screen.setworldcoordinates(0,0,width, height) |
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 turtle | |
import math | |
import random | |
screen = turtle.getscreen() | |
screen.setup(width=1.0, height=0.9, startx=0, starty=0) | |
#width, height = screen.window_width(), screen.window_height() | |
width = random.randint(20000,50000) | |
height = width | |
screen.setworldcoordinates(0,0,width, height) |
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
class Game: | |
"""containers for everything""" | |
monsters = {} | |
#items = {} | |
locations = {} | |
player = None | |
current_room = None | |
class Location: |
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 | |
#sg.theme("Material1") | |
#sg.theme_element_background_color(color = "#000000") | |
#sg.theme_background_color(color="#FFFFFF") | |
#sg.theme_button_color(color="#FFFFFF") | |
class Game: |