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 itertools import product | |
import re | |
fh = open('input', 'r') | |
lines = {} | |
for line in fh: | |
sx, sy, bx, by = map(int, re.findall('-?\d+', line)) | |
d = abs(bx - sx) + abs(by - sy) + 1 | |
for endpoints, mb, norm in [ |
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
M[16],X=16,W,k;main(){T(system("stty cbreak") | |
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i | |
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M | |
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<< | |
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k) | |
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d | |
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X] | |
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4; | |
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4|| | |
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-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
set nocompatible | |
set timeout timeoutlen=500 ttimeoutlen=0 | |
syntax enable | |
filetype on | |
augroup filetypedetect | |
au! BufRead,BufNewFile *.jsx setfiletype javascript | |
augroup END | |
set t_Co=256 background=light |
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
J=1;exec'''z="";b=-1.6;exec' | |
x=y=0;exec"x,y=2*x*y+J,y*y-x | |
*x+b;"*20;z+=" O"[x*x+y*y<2] | |
;b+=.040;'*60;print z;J-=.10 | |
;'''.replace('\n','')*20#Jay |
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,os;M=[0]*30000;A=[] | |
p=k=x=0;S=open(sys.argv[1]).read() | |
while x<len(S):exec"""M[p]+=1 | |
M[p]-=1 M[p]=ord(os.read(0,1)or"\\0") | |
os.write(1,chr(M[p])) p-=p>0 p+=1 | |
k=A.append(x)if+M[p]else+1 x=A.pop()-1 | |
k+=1 0 k-=1 0""".split()['+-,.<>[][+]+' | |
.find(S[x]+'+'*(k>0))];M[p]&=255;x+=1 |
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/python | |
# -*- coding: utf-8 -*- | |
start, end = u'가힝' # Korean | |
#start, end = u'あゟ' # Japanese | |
def esc(c): | |
if c in '[]\\\'\"': | |
return '\\' + c | |
return c |
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
sub Y{$p=$_;for$i(1..4){$p=join'',map{substr+($k&&$k-$i?$p:join'',map{s/@//g;s | |
/(.)\1/++($a=$1)/eg;$_|'@'x4}$p=~/.{4}/g),3+$_%4*4-($_/4|0),1}0..15}$p}$_='@'x | |
16;for(`stty cbreak`;print"\e[2J\e[H";$_=Y map{$k=index+JDACB,getc}0..2){$k=0; | |
1until$r=0|rand 16,!/@/||s/(?<=^.{$r})@/rand>.1?A:B/e;printf'%4s|%s',/\w/&&1<< | |
(ord)-64,++$g%4?'':$/for/./g;last if$e=WIN x/K/||Y!~/@/&&LOSE}print$e # [2048] |
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
#!/bin/bash | |
:|((read f g h | |
[[ -f .$g&&$g != *..* ]]&&echo "$h 200 O | |
"&&cat .$g)|nc -q0 -lp$1)>/dev/fd/0;$0 $1 |
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
<div class="row"> | |
{{Front}} | |
<span id="playa" class="hooks hooks-l">{{Playability}}</span> | |
<span id="number" class="hooks hooks-r hooks-u">{{Number}}</span> | |
</div> | |
<script> | |
function $$(id) { return document.getElementById(id); } | |
$$('playa').innerText |= 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
$SPS = 16000; | |
$PI = 3.14159265359; | |
$PITCH_ROLL = 1; | |
$BPM = 170; | |
%FREQS = ( | |
A => 440.000, | |
B => 493.883, | |
C => 261.626, |
NewerOlder