How do I make things happen on load/unload?
def load():
print('[SP] Plugin has been loaded successfully!')
def unload():
print('[SP] Plugin has been unloaded successfully!')
# [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 |
# [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): |
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 |
# [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 |
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: |
from hlt import * | |
from networking import * | |
myID, gameMap = getInit() | |
sendInit("PythonBot") | |
while True: | |
moves = [] | |
gameMap = getFrame() | |
for y in range(gameMap.height): |
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): |
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) |
"Shop" | |
{ | |
"ttt_sort_items" | |
{ | |
"value" "1" | |
"description" "Sort shop items? 0 = Disabled. 1 = Enabled (default)." | |
} | |
"ttt_credits_killer_innocent_victim_innocent_subtract" | |
{ | |
"value" "1500" |
How do I make things happen on load/unload?
def load():
print('[SP] Plugin has been loaded successfully!')
def unload():
print('[SP] Plugin has been unloaded successfully!')