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 Battler: | |
def __init__(self, p, a, m, h): | |
self.power = p | |
self.armor = a | |
self.mhp = m | |
self.hp = h | |
def __repr__(self): | |
# return '{}/{}:{}/{}'.format(self.power, self.armor, self.hp, self.mhp) |
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 math, random | |
# constants | |
STATS = ['int','str','vit'] | |
RARITY_MULT = { | |
'common': 1, | |
'rare': 1.25, | |
'epic': 1.5, | |
'legendary': 2 | |
} |
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
REM recursively list mp4 files in current dir | |
DIR /s /b | FINDSTR ".mp4" |
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
sep = '-' | |
results = [] | |
def decompose(num, operands, path): | |
""" Append a valid path to results if it's possible to decompose the num. | |
num = number to decompose, | |
operands = list of operands allowed to use in the decomposition, | |
path = current chain of operands, string, | |
""" |
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 clock import Clock | |
from collections import defaultdict, deque | |
from constants import RESOLUTION, FONT_SIZE | |
from events import QuitEvent, EventManager, VTickEvent | |
from input import InputController | |
from pygame.rect import Rect | |
from pygame.sprite import LayeredDirty | |
from pygame.surface import Surface | |
from view import PygameDisplay | |
from widgets import MenuWidget |
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 collections import defaultdict | |
from time import sleep | |
import logging | |
class TickEvent: | |
pass | |
# components subscribed to TickEvent as "input" will be notified first, |
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
bots = c(0,20,40,60,80,100,120,140,160,180,200,250,300,350,400) | |
millis = c(0.08,0.19,0.45,0.55,0.68,0.79,0.95,1.05,1.24,1.22,1.38,1.7,1.8,2.2,2.4) | |
linfit = lm(millis ~ bots) | |
#attributes(linfit) # view the attrs of the fit | |
coeff = signif(linfit$coefficients[2], digits=3) # how many millis per bot | |
offset = signif(linfit$coefficients[1], digits=3) | |
rsquared = signif(summary(linfit)$r.squared, digits=3) | |
pval = signif(summary(linfit)$coefficients[2,4], digits=3) |
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
javascript:var%20b=document.body;var%20GR________bookmarklet_domain='http://www.google.com';if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/link-bookmarklet.js');void(b.appendChild(z));}else{} |
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
#! /usr/bin/env python3 | |
''' | |
Example ported to python3 | |
Original from Shandy Brown: https://github.com/sjbrown/writing_games_tutorial/blob/example1/code_examples/example.py | |
''' | |
def Debug(msg): | |
print (msg) |
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
<html> | |
<script type="text/javascript"> | |
var consonants = ['b','c','d','f']; | |
var vowels = ['a','e','i','o','u','y']; | |
var consBeg = ['b','c','f','g','k','p','q']; | |
var consEnd = ['j','l','r','s','z']; | |
var consAloneNoH = ['d','m','n','t','v','w','x']; | |
var consAlone = ['chr','shr','str','sr', 'sl', 'sj', 'sm', 'sn', 'dr','dj']; |