Skip to content

Instantly share code, notes, and snippets.

Avatar

moonb3ndr wkta

  • Gaudia Tech Inc.
  • Strasbourg, France
  • Twitter @moonb3ndr
View GitHub Profile
@wkta
wkta / TextBlock_test.py
Last active Mar 11, 2022
example to show how one can manage text blocks (->GUI building) in a convenient way
View TextBlock_test.py
"""
how can we manage text blocks (->GUI building) in a convenient way?
This may be an answer. Contributors: .wkta-tom#7412 | S_P_Y#1331
"""
import pygame
def create_txtblock_surf(text, ft_obj, color=(0, 0, 0), bg_color=(255, 255, 255), alignment_f=0.0, debug=0):
"""
goal = to produce a pygame surface
@wkta
wkta / TECH-DEMO1.py
Last active Oct 7, 2021
Kata Engine xxx Tech-demo1 (asteroids-like)
View TECH-DEMO1.py
# TECH-DEMO1.py | revision: oct.07 - 2021
# showcases how the Kata engine works
# (tested with v0.0.6)
# Visit https://kata.games to learn more!
# source-code by "wkta-tom" | MIT License
# https://github.com/wkta
# thomas@gaudia-tech.com
View keybase.md

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:

View verbose_baseconv.py
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
@wkta
wkta / day_31.py
Last active Oct 24, 2019
#MonthOfCode day 31 - exit
View day_31.py
# 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',
@wkta
wkta / day_30.py
Last active Jan 23, 2022
#MonthOfCode day 30 - infinity
View day_30.py
# contact: thomas@gaudia-tech.com
# thema for this gist= INFINITY
# demo tested with libraries:
# katasdk 0.0.7 & python3.8.10
# "pip install katasdk" if needed
from math import cos, sin, pi
import katagames_sdk as katasdk
@wkta
wkta / day_29.py
Created Mar 31, 2014
#MonthOfCode day 29 - golf
View day_29.py
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)
@wkta
wkta / day_28.py
Created Mar 31, 2014
#MonthOfCode day 28 - race
View day_28.py
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()
@wkta
wkta / day_27.py
Created Mar 31, 2014
#MonthOfCode day 27 - pattern
View day_27.py
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()
@wkta
wkta / day_26.py
Created Mar 31, 2014
#MonthOfCode day 26 - malicious
View day_26.py
# 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):