This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Pacman Checkers Hero Deathmatch 2013 | |
A game by Tyler Leite | |
''' | |
# This app is made using Pythonista, an iOS application for creating Python programs | |
# with audio, graphics, and touch input. | |
# Documentation for Pythonista can be found here: http://omz-software.com/pythonista/docs/ios/ | |
from scene import * | |
from random import seed, randrange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game: | |
def __init__(self): | |
self.flags = '1 0 0 0 0 0 0 0'.split() | |
def check_flags(self, line): | |
flags = line.split()[1].replace('flags:', '') | |
if flags == 'none': | |
return True | |
for f in range(len(flags)): | |
if flags[f] == '1' and self.flags[f] == '0': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import atan2, sin, cos, sqrt, pi, floor | |
class Vec2: | |
def __init__(self, x=0, y=0, form='rect'): | |
self.x = x | |
self.y = y | |
if form == 'rect' or form == 'polar': | |
self.form = form | |
else: | |
print('Invalid Vec2 form: %s' % form) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import * | |
def one_liner(): | |
while raw_input('You %s. ' % choice('win lose draw'.split())).lower() not in 'stop exit quit'.split(): party_time = True | |
def pro_strats(): | |
wins = dict(zip('rock paper scissors'.split(), 'scissors rock paper'.split())) #what beats what | |
loses = dict(zip('rock paper scissors'.split(), 'paper scissors rock'.split())) #what loses to what | |
hist = list() | |
clever = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
from hashlib import * | |
from bcrypt import hashpw, gensalt | |
def super_hash_bros(string, salt): | |
if salt is None: | |
salt = gensalt() | |
return (hashpw(string, salt), salt) # not technically how this is used, | |
# salt already returned by hashpw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import remove | |
from uuid import uuid4 | |
def get_xml_tag(line): | |
tag = line = line.strip(' ').strip('<') | |
tag = tag.split(' ')[0] | |
if '>' in tag: | |
tag = tag.split('>')[0] | |
return tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctime> | |
class Random { | |
public: | |
Random(int seed=time(NULL)) : m_seed(seed) {} | |
//Return a random number from 0 to range-1 | |
int next(const int range){ | |
m_seed = (1028597*m_seed + 488249) % 1737017; | |
return m_seed % range; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random as r | |
# Probability distribution of each syllable | |
syllables = list('11111222222222222222222222333333333333333344456') | |
# Consonants that can start a word | |
c_s = "w,wr,r,t,tw,th,thr,y,p,ph,pr,d,dr,f,fr,fl,g,gl,gr,gh,h,j,k,kl,kr,c,ch,cl,cr,z,v,b,br,n,m,s,sl,sk,sm,sn,st,fr,l".split(',') | |
# Consonants in the middle of a word | |
c_m = "w,ws,wd,wr,wt,wth,wp,wk,wn,wm,wb,r,rt,rp,rm,rn,rc,rb,rl,rk,rd,rs,rth,rch,t,th,thr,tch,t,ts,y,ys,p,pl,pr,ps,s,sh,sch,st,sm,sn,dr,ddl,dd,f,ff,fr,fl,mp,mn,gs,gl,j,k,kl,kr,kw,l,ll,lm,ls,sl,sk,z,zz,ch,cr,ct,cl,ck,v,b,br,bs,bl,n,ns,m,ms,nth".split(',') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class TicTacToeNode: | |
def __init__(self): | |
self.board = ['.'] * 9 | |
self.win_states = (\ | |
[0,1,2], [3,4,5], [6,7,8],\ | |
[0,3,6], [1,4,7], [2,5,8],\ | |
[0,4,8], [2,4,6]\ | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#disgusting code dont try to read | |
from PIL import Image, ImageFilter | |
import os | |
import sys | |
import random | |
import math | |
def fill(arr, x, y): |
OlderNewer