Keybase proof
I hereby claim:
- I am wkta on github.
- I am marlonb (https://keybase.io/marlonb) on keybase.
- I have a public key ASAEevw2gIoaWk0hnlEiGszm7SWBXNS4qFg_p65betnfBgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
PROMPT_MSG='type an integer greater or equal to 1 > ' | |
input_ok = False | |
while not input_ok: | |
try: | |
num_tested = int(input(PROMPT_MSG)) | |
if num_tested >= 1: | |
input_ok = True | |
except ValueError: | |
pass |
# thema= EXIT, description= a dumb game. How to win this? | |
import random | |
import time | |
import sys | |
COIN_F = (True,False) # coin flipping | |
RUSSIAN_R = (False,False,True,False,False,False) # luck: 1 out of 6 | |
START_MSG = 'A new gladiator enters the arena...' | |
D_QUOTES = ( | |
'Death may have taken you but memories remain', |
# thema= INFINITY, tested with python3.1 + pygame1.9.1 | |
import pygame | |
from time import sleep | |
import random | |
from math import cos,sin,pi | |
# constants | |
DISP_WIDTH = 800 | |
DISP_HEIGHT = 600 |
from random import choice | |
mid_names = [ "" for i in xrange(7) ] | |
mid_names.extend( [ "Kindred", "Junior", "Senior", "Jack" ]) | |
first_names = \ | |
[ "Tiger", "Mike", "Edgar", "Jean-Paul", "Sandra", "Clara", "Gary", "Philip", "Edwin" ] | |
last_names = [ "Woods", "Jackson", "Nelson", "Watson", "Palmer", "Hagen", "Nicklaus", "Haeger", "de LaMartre" ] | |
def printRandomName(): | |
mid = choice(mid_names) |
import random | |
import time | |
def detPrecision( candidate, model): | |
chars_cand = list( candidate) | |
chars_model = list(model) | |
while( len(chars_cand)<len(chars_model) ): | |
chars_cand.append(' ') | |
while( len(chars_cand)>len(chars_model) ): | |
chars_cand.pop() |
import re | |
print "Testing your knowledge on regular expressions" | |
partterns = [ | |
"a{4,}b", "Y.*g", "ro..c..ter", "[a,m,k]{5,8}" ] | |
for pat in partterns: | |
print "Try to type a string that matches the REGULAR EXPRESSION",pat | |
success = False | |
while True: | |
user_str = raw_input() |
# this code is awesome, you will see it everywhere! | |
import sys | |
import random | |
import os | |
alphabet = [chr(i) for i in range(ord('a'),ord('z') + 1) ] | |
def genRandomName(): | |
name_length = random.randint(2,8) | |
lchar = list() | |
for i in xrange(name_length): |
import pygame | |
DISP_WIDTH = 640 | |
DISP_HEIGHT = 480 | |
def refreshScreen(): | |
window.fill( pygame.Color('black') ) | |
pygame.display.flip() | |
# init. pygame libr; create the screen and diplays a help message in the console |
import pygame | |
from time import sleep | |
import random | |
from math import cos,sin,pi | |
DISP_WIDTH = 800 | |
DISP_HEIGHT = 600 | |
class MobileElement: | |
MOMENTUM = 0.985 | |
'''abstract class representing something that moves''' |