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
var socket = require('socket.io-client')('http://localhost:8080', { transports: ['websocket'] }) | |
var chalk = require('chalk') | |
var listen_events = ['queue_update', 'game_update'] | |
socket.on('connect', function() { | |
console.log('Connected Successfully') | |
socket.emit('play', 'Beep Boop', 'Sy5tdf37g') | |
socket.emit('set_force_start', null, true) | |
}) |
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
# [2016-12-09] Challenge #294 [Hard] Rack management 3 | |
# https://www.reddit.com/r/dailyprogrammer/comments/5hcd0x/20161209_challenge_294_hard_rack_management_3/ | |
import copy, random, timeit | |
original_row = "sd?zeioao?mluvepesceinfxt?wyiru?ie?giator?t??nuefje?l?odndrotpewlgoobiinysagacaqski?aeh?rbhaervtnl?m" | |
words = [[line.strip(), 0] for line in open("enable1.txt") if len(line.strip()) < 11] | |
letters = "abcdefghijklmnopqsrtuvwxyz" | |
scores = [1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10] | |
practice = 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
# [2016-12-09] Challenge #294 [Hard] Rack management 3 | |
# https://www.reddit.com/r/dailyprogrammer/comments/5hcd0x/20161209_challenge_294_hard_rack_management_3/ | |
import copy, random, timeit | |
original_row = "sd?zeioao?mluvepesceinfxt?wyiru?ie?giator?t??nuefje?l?odndrotpewlgoobiinysagacaqski?aeh?rbhaervtnl?m" | |
words = [[line.strip(), 0] for line in open("enable1.txt") if len(line.strip()) < 21] | |
letters = "abcdefghijklmnopqsrtuvwxyz" | |
scores = [1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10] | |
practice = 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
# [2016-12-09] Challenge #294 [Intermediate] Rack management 2 | |
# https://www.reddit.com/r/dailyprogrammer/comments/5h40ml/20161207_challenge_294_intermediate_rack/ | |
import copy, random, timeit | |
words = [[line.strip(), 0] for line in open("enable1.txt") if len(line.strip()) < 11] | |
tilescores = dict(zip("abcdefghijklmnopqrstuvwxyz?", [1,3,3,2,1,4,2,4,1,8,5,1,3,1,1,3,10,1,1,1,1,4,4,8,4,10,0])) | |
char_freq = {'a': 22, 'c': 15, 'b': 9, 'e': 25, 'd': 16, 'g': 13, 'f': 7, 'i': 23, 'h': 10, 'k': 6, 'j': 1, 'm': 11, 'l': 17, 'o': 19, 'n': 20, 'q': 0, 'p': 12, 's': 24, 'r': 21, 'u': 14, 't': 18, 'w': 5, 'v': 4, 'y': 8, 'x': 2, 'z': 3} | |
def calcScore(word): |
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 sys | |
from collections import Counter | |
N = 10 # number of tiles in the rack | |
words = set(line.strip() for line in open("enable1.txt")) | |
row = "sd?zeioao?mluvepesceinfxt?wyiru?ie?giator?t??nuefje?l?odndrotpewlgoobiinysagacaqski?aeh?rbhaervtnl?m" | |
rack = [] | |
score = 0 | |
for line in sys.stdin: | |
if not line: continue |
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 nltk.corpus import brown | |
import copy | |
from nltk.probability import FreqDist | |
def findmostlikelytokens(testsentence, fq): | |
stack=[([], testsentence)] | |
resultlist=[] | |
while len(stack) > 0: | |
currentlist, sentence=stack.pop(0) | |
if len(sentence)==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 hlt import * | |
from networking import * | |
myID, gameMap = getInit() | |
sendInit("PythonBot") | |
while True: | |
moves = [] | |
gameMap = getFrame() | |
for y in range(gameMap.height): |
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
def memo(f): | |
def func(*args): | |
if args not in func.cache: | |
func.cache[args] = f(*args) | |
return func.cache[args] | |
func.cache = {} | |
return func | |
@memo | |
def collatz(n): |
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
i,s='36047399',[0]*10 | |
for j,k in zip(i,i[1:])[::2]: | |
r=sorted([int(j),int(k)]);r[1]+=1 | |
for l in range(*r):s[l]^=1 | |
print(s) |
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
"Shop" | |
{ | |
"ttt_sort_items" | |
{ | |
"value" "1" | |
"description" "Sort shop items? 0 = Disabled. 1 = Enabled (default)." | |
} | |
"ttt_credits_killer_innocent_victim_innocent_subtract" | |
{ | |
"value" "1500" |