This file contains hidden or 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 randint | |
import sys | |
#allow for python2 and python3 compatibility | |
if sys.version_info >= (3,0): | |
raw_input = input | |
#list of final attribute scores | |
statList = [] |
This file contains hidden or 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
math.randomseed(os.time()) | |
attributes = {} | |
for i = 0, 5, 1 do | |
--initialize array for current stat | |
stat = {}; | |
--roll 4d6 | |
for j = 0, 3, 1 do | |
stat[j] = math.random(1, 6) |
This file contains hidden or 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
/* mallopt options that actually do something */ | |
#define M_TRIM_THRESHOLD -1 | |
#define M_TOP_PAD -2 | |
#define M_MMAP_THRESHOLD -3 | |
#define M_MMAP_MAX -4 | |
#define M_CHECK_ACTION -5 | |
#define M_PERTURB -6 | |
#define M_ARENA_TEST -7 | |
#define M_ARENA_MAX -8 |
This file contains hidden or 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
char * itoa(int i,unsigned base){ | |
static char s[sizeof(int)*8+2]; | |
char*t=s+sizeof(int)*8; | |
int sgn=i>=0?1:-1; | |
i/=sgn; | |
do*t--="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\ | |
abcdefghijklmnopqrstuvwxyz+/"[i%base];while(i/=base,i>0); | |
if(sgn<0)*t='-'; | |
else++t; | |
return t; |
This file contains hidden or 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
forknum = fork(); | |
if(forknum == 0){ | |
fprintf(stderr, "parent "); | |
wait(&childstatus); | |
} | |
else{ | |
fprintf(stderr, "child "); | |
childstatus = 0; | |
exit(childstatus); | |
} |
This file contains hidden or 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 d(l): | |
j=b=0;m=l[j];r=[] | |
for i in l: | |
(m,b)=[(m,0),(i,1)][i>=m] | |
if b>0:r+=[i] | |
j+=1 | |
l[:]=r |
This file contains hidden or 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
lambda s:''.join(['10'[c>'0']for c in s]) |
This file contains hidden or 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<sstream> | |
#include<string> | |
[](int x){std::stringstream q;q<<x<<"spooky"<<x+2<<"me";return q.str();} |
This file contains hidden or 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
} else { | |
// | |
This file contains hidden or 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
# 1 | |
print('Hello, World!') | |
# 2 | |
from math import factorial as f | |
print(str(f(int(input())))) | |
# 3 | |
def p(N):r=range(2,N);return sum(x for x in r if sum(x%d==0 for d in r)<2) |
OlderNewer