Skip to content

Instantly share code, notes, and snippets.

View horstjens's full-sized avatar
💭
teaching python/pygame to children

Horst JENS horstjens

💭
teaching python/pygame to children
View GitHub Profile
@horstjens
horstjens / linus7.py
Last active April 22, 2024 16:01
linus
import vpython as vp
level1 = """
#################################
#1..ö..........#................#
#...ö....#######................#
#...............................#
#...............................#
#..............######...........#
#..............#................#
@horstjens
horstjens / turtlerace1.py
Last active March 13, 2024 07:26
wiesberggasse
import turtle
import random
breite = 1200
höhe = 800
turtle.setup(breite,höhe)
turtle.speed(0)
stall = [turtle.Turtle(),
turtle.Turtle(),
@horstjens
horstjens / pygame003.py
Created January 13, 2024 11:01
pygame starter example: moving a circle, changing the colors
# Example file showing a circle moving on screen
import pygame
# pygame setup
pygame.init()
screen = pygame.display.set_mode((1280, 720))
clock = pygame.time.Clock()
running = True
dt = 0
@horstjens
horstjens / babyturtles1.py
Created January 6, 2024 19:50
babyturtles
import turtle
import random
class Salat(turtle.Turtle):
salatliste = []
def __init__(self):
super().__init__()
self.hideturtle()
@horstjens
horstjens / sternschnuppe1.py
Created January 6, 2024 08:00
sternschnuppe
import turtle
import random
class Stern(turtle.Turtle):
sternenliste = []
löschen = False # muss man einen Stern löschen?
def __init__(self, pos, startfarbe=(1,1,0), endfarbe=(1,1,1)):
super().__init__()
self.hideturtle()
@horstjens
horstjens / htmltabelle.py
Created January 2, 2024 09:26
htmltabelle
start = """<!DOCTYPE html>
<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
@horstjens
horstjens / spacebattle2.py
Created December 16, 2023 10:46
spacebattle2
import vpython as vp
import random
class Game:
beams = []
scene=vp.canvas(title="Space fight")
# xyz
#vp.arrow(axis=vp.vector(1,0,0), color=vp.color.red)
@horstjens
horstjens / spacebattle1.py
Last active December 9, 2023 10:58
space battle (vpython)
import vpython as vp
# xyz
#vp.arrow(axis=vp.vector(1,0,0), color=vp.color.red)
vp.text(pos=vp.vector(1.5,0,0), text="x",
color=vp.color.red, height=0.1)
#vp.arrow(axis=vp.vector(0,1,0), color=vp.color.green)
vp.text(pos=vp.vector(0,1.5,0), text="y",
color=vp.color.green, height=0.1)
#vp.arrow(axis=vp.vector(0,0,1), color=vp.color.blue)
@horstjens
horstjens / viergewinnt4.py
Last active December 23, 2023 09:43
viergewinnt pysimplegui
import random
import PySimpleGUI as sg
spieler = 1
summe = 0
rows = 6 # max. 26
cols = 7 # max. 26
gewinnt = 4
@horstjens
horstjens / viergewinnt2.py
Last active November 25, 2023 09:19
vier gewinnt
import random
spieler = 1
summe = 0
rows = 6 # max. 25
cols = 17 # max. 25
gewinnt = 5
spielzug = 0
#feld = [
# [0,0,0,0,0,0,0],
# [0,0,0,0,0,0,0],