Skip to content

Instantly share code, notes, and snippets.

def test():
class Node(object):
def __init__(self, name, *successors):
self.successors = list(successors)
self.name = name
self.color = "white"
def __repr__(self):
@ramsesoriginal
ramsesoriginal / PSP
Created January 30, 2018 12:24
Matnatfat
MatNatFat
name: MatNatFat
Cont
name: Controlling
parent: MatNatFat
Rec
name: Recherche
parent: MatNatFat
Ent
@ramsesoriginal
ramsesoriginal / pa10test.py
Last active January 21, 2018 04:29
PA10 Test Functions
import sys
class ListStream:
def __init__(self):
self.data = []
def write(self, s):
@ramsesoriginal
ramsesoriginal / tests.py
Last active January 15, 2018 15:03
PA09 Test
import time
outputBuffer = ""
output = ""
def out(s = False, l = False, trimList=True):
global outputBuffer
if s:
@ramsesoriginal
ramsesoriginal / debugtest.py
Created January 2, 2018 21:26
PA08 Testfunktion
def test(title="Test", expression="x0", expectedResult=(True, 0), expectedException = False, arguments=[True], hideOK = False):
out = "\n" + title + "\n"
out = out + '\tauswertung ("' + expression + '", ' + str(arguments) + ')'
reraise = False
if expectedException:
out = out + "\n" + "\tResult should be an exception"
else:
out = out + "\n" + "\tResult should be: " + str(expectedResult)
try:
'''testStart
testCategory Tests aus der Angabe
testName Weg Findbar
maxtime 3
expectedResult 11
call abstand((0, 9), (2, 2))
testName Weg Nicht Findbar
'''testStart
testCategory Tests aus der Angabe
testName Weg Findbar
maxtime 3
expectedResult 11
call abstand((0, 9), (2, 2))
testName Weg Nicht Findbar
print(" Tests aus der Angabe")
print(" Dies ist das Haus vom Nikolaus")
print("erwartet:", False)
print("erhalten:", eulertour ([[1, 2, 3], [0, 2, 3], [0, 1, 3, 4], [0, 1, 2, 4], [2, 3]]))
print(" There and back again")
import timeit
def debugPrint(n, R, expected):
start_time = timeit.default_timer()
result = ist_aequivalenzrelation(n, R)
elapsed = timeit.default_timer() - start_time
if result != expected or elapsed > 1.5:
rstring = str(R)
if len(rstring) > 100:
@ramsesoriginal
ramsesoriginal / GAW
Last active August 29, 2015 14:05
News
<b>03.11.2014:</b>Released my first game, A-Maze-Ball! (http://ramsesoriginal.itch.io/gaw1)
<b>27.10.2014:</b> <i>Started working on the first real Game a Week game</i>
<b>22.08.2014:</b> Released the protoype game for Game a Week, EXTREME BALLS! (http://ramsesoriginal.info/GAW-1/)