Skip to content

Instantly share code, notes, and snippets.

Simon Heppner spheppner

Block or report user

Report or block spheppner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@spheppner
spheppner / vector_template.py
Created Sep 27, 2018 — forked from horstjens/vector_template.py
pygame vector template game
View vector_template.py
# -*- coding: utf-8 -*-
"""003_static_blit_pretty_template.py"""
import pygame
import random
def make_text(msg="pygame is cool", fontcolor=(255, 0, 255), fontsize=42, font=None):
"""returns pygame surface with text. You still need to blit the surface."""
myfont = pygame.font.SysFont(font, fontsize)
@spheppner
spheppner / calculate_module.py
Created Jun 19, 2018
A module for calculating numbers (Python3) - Returns string
View calculate_module.py
def calculate(operator, nr1, nr2):
if operator != "/" or operator != "-" or operator != "+" or operator != "*":
return "Invalid Operator!"
elif operator == "/":
try:
return str(nr1//nr2)
except:
return "Error!"
elif operator == "-":
try:
@spheppner
spheppner / clear_module.py
Created Jun 6, 2018
Clear module (python3)
View clear_module.py
import os
def clear():
try:
os.system("cls")
except:
os.system("clear")
# You need this module in the same folder and you can simple import it with the "import" command
@spheppner
spheppner / simple_menu.py
Created Jun 6, 2018
Simple menu to program yourself! (python3)
View simple_menu.py
import os
menu = """#####################
# #
# [C]redits #
# [E]xit #
# #
#####################"""
def clear():
@spheppner
spheppner / reverser.py
Created May 14, 2018
Simple string reverser (Python3)
View reverser.py
def reverse(rstr):
return rstr[::-1]
reversed_string = reverse("Hello")
@spheppner
spheppner / swapper.py
Last active May 14, 2018
Improved 2-digit number swapper (Python3)
View swapper.py
def swap(a, b):
a, b = b, a
return a, b
swapped_value = swap(1, 2)
@spheppner
spheppner / calculator.py
Created May 9, 2018
Improved calculator (Open-Source, Python3)
View calculator.py
credits = """
Made by Simon Heppner
on 9th of May, 2018
"""
print(credits)
def addition(int1, int2):
return (int1 + int2)
def subtraction(int1, int2):
@spheppner
spheppner / numswap.py
Created May 9, 2018
simple number swapper (just for fun)
View numswap.py
def swap(numbersp):
swapped = str(numbersp)
a = swapped[0]
b = swapped[1]
swapped = int(b + a)
return swapped
swap(12)
@spheppner
spheppner / textgenerator.py
Created Oct 12, 2017
A imroved text generator with eSpeak
View textgenerator.py
import random
import subprocess
freunde=("Luka","Eni","Adrian","Caro","Marie","Ella","Boba Fett","Ein Känguru","Merkel", "Pikachu", "Manuel", "Hulk", "Superman", "Batman", "Captain America", "Anakin Skywalker", "Harry Potter", "Luke Skywalker", "Simon Heppner", "Paolo Perfahl", "Pablo Piccaso", "Horst Jens", "Herr Computer", "Spongebob", "Mr. Crabbs", "Maria", "Jesus", "Gott", "Teufel", "Poseidon", "Percy Jackson")
verben=("schimpft","schlägt","küsst","isst","verschlingt","hilft","kitzelt","verklagt", "umarmt", "programmiert", "ärgert", "nervt", "erschießt", "zermalmt", "zerdrückt", "erdrosselt", "liebt", "tötet")
orte=("am Strand","unter Wasser","im Schiff","über den Wolken","auf dem Spielplatz","in der Schule","in der Klasse","im Parlament", "im UFO", "im Uboot", "im Himmel", "beim Schreibtisch", "in der Schule", "in der Hölle", "auf Courocant", "auf Tatooine", "auf Alderaan", "am Berg", "im Gebirge", "im Raum", "im Kino", "vor dem Kino", "vor dem Computer", "vor der Kirche", "in der Kirche")
adj=("leidens
View vectorgame.py
# -*- coding: utf-8 -*-
"""
003_static_blit_pretty.py
static blitting and drawing (pretty version)
url: http://thepythongamebook.com/en:part2:pygame:step003
author: horst.jens@spielend-programmieren.at
licence: gpl, see http://www.gnu.org/licenses/gpl.html
works with pyhton3.4 and python2.7
You can’t perform that action at this time.