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 / hangman
Last active December 20, 2015 00:19 — forked from yipyip/hangman
#!/usr/bin/env python3.3
# -*- coding: utf-8 -*-
"""A Hangman Demo for Python3 form yipyip. Guess some python3 keywords !
see https://gist.github.com/yipyip/6038584 for original code
"""
####
import random
@horstjens
horstjens / cannon1.py
Created October 10, 2018 17:28 — forked from PaulPolaschek/cannon1.py
artillery game with python turtle
import turtle
import random
peter=turtle.Turtle()
peter.pencolor("blue")
peter.pensize(3)
peter.fillcolor("red")
franz=turtle.Turtle()
franz.pencolor("yellow")
import random
class Ship:
'''all ships are part of the boat class'''
number = 1
def __init__(self, player, length):
'''chooses random location & direction for ship for a given length'''
# print('ship size: ', length, sep='')
import random
class Ship:
'''all ships are part of the boat class'''
number = 1
def __init__(self, player, length):
'''chooses random location & direction for ship for a given length'''
# print('ship size: ', length, sep='')
@horstjens
horstjens / 15_python_tips.md
Created May 11, 2023 09:11 — forked from Julynx/15_python_tips.md
15 Python Tips To Take Your Code To The Next Level!
@horstjens
horstjens / astar.py
Last active September 15, 2023 09:00 — forked from ryancollingwood/astar.py
# Credit for this: Nicholas Swift
# as found at https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2
from warnings import warn
import heapq
class Node:
"""
A node class for A* Pathfinding
"""