This file contains hidden or 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
# vier gewinnt | |
def frage_nach_spalte(erlaubte_spalten, erlaube_q=True): | |
""" | |
:param erlaubte_spalten: z.B. [0,1,2,4,6] | |
:param erlaube_q: True oder False | |
:return: None (für quit) oder index der gewünschten Spalte | |
""" | |
while True: | |
if erlaube_q: |
This file contains hidden or 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
# tic tac toe | |
# done: maximal 9 spielzüge | |
# done: besetzes Feld soll nicht mehr spielbar sein | |
# done: gewinnermittlung | |
def hat_jemand_gewonnen(spieler): | |
""" | |
kontrolliert die liste felder, ob ein das zeichen | |
namens 'spieler' 3 x nebeneinander (horizontal, |
This file contains hidden or 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 time | |
import random | |
class Game: | |
untergrenze = 1 | |
obergrenze = 100 | |
def frage_nach_zahl(prompt="Bitte Zahl eingeben", | |
untergrenze = 1, |
This file has been truncated, but you can view the full file.
This file contains hidden or 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/env python | |
# | |
# Hi There! | |
# | |
# You may be wondering what this giant blob of binary data here is, you might | |
# even be worried that we're up to something nefarious (good for you for being | |
# paranoid!). This is a base85 encoding of a zip file, this zip file contains | |
# an entire copy of pip (version 25.1.1). | |
# | |
# Pip is a thing that installs packages, pip itself is a package that someone |
This file contains hidden or 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 time | |
import random | |
class Game: | |
untergrenze = 1 | |
obergrenze = 100 | |
def hauptmenü(): | |
print("------------------------------------") | |
print("------- zahlenratenspiel -----------") |
This file contains hidden or 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 | |
class Monster: | |
# class variables | |
number = 0 | |
zoo = {} | |
def __init__(self, **kwargs): | |
self.number = Monster.number | |
Monster.number += 1 |
This file contains hidden or 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 socket | |
def start_client(): | |
# Create a socket object | |
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
client_socket.connect(('localhost', 12345)) | |
print("Connected to server.") | |
while True: | |
# Send a message to the server |
This file contains hidden or 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 FreeSimpleGUI as sg | |
#sg.popup_ok("hallo") | |
database = { | |
"player": { | |
"name":"player", | |
"filename":"player1.png", | |
"attack":15, | |
"defense":21, |
This file contains hidden or 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 FreeSimpleGUI as sg | |
import math | |
import random | |
col_player_1_r=sg.Column(layout=[ | |
[sg.Multiline(default_text="history:\n", | |
autoscroll=True, | |
key="history", | |
disabled=True, | |
size=(50,10))] |
This file contains hidden or 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 FreeSimpleGUI as sg | |
import math | |
import random | |
col_rechts=sg.Column(layout=[ | |
[sg.Multiline(default_text="history:\n", | |
autoscroll=True, | |
key="history", | |
disabled=True, | |
size=(50,10))] |
NewerOlder