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 matplotlib.pyplot as plt | |
#from random import randrange | |
def itOne(n): | |
return 1 if n==1 else (n*3+1)//2 if n%2 else n//2 | |
return 1 if n==1 else n*3+1 if n%2 else n//2 | |
def itFull(n): | |
ni=n | |
cs=[ni] |
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 matplotlib.pyplot as plt | |
#from random import randrange | |
def itOne(n): | |
return 1 if n==1 else (n*3+1)//2 if n%2 else n//2 | |
return 1 if n==1 else n*3+1 if n%2 else n//2 | |
def itFull(n): | |
ni=n | |
cs=[ni] |
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 matplotlib.pyplot as plt | |
#from random import randrange | |
def itOne(n): | |
#return 1 if n==1 else (n*3+1)//2 if n%2 else n//2 | |
return 1 if n==1 else n*3+1 if n%2 else n//2 | |
def itFull(n): | |
ni=n | |
cs=[ni] |
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
f=.4 :0 | |
m=.>:>./x,y | |
t=.(|+(1+m)*0>:*)@(i.@#-~])@(],m$~(>&#)*(-&#)) | |
x(t~(*@-&((m+#x,y)&#.))t)y | |
) | |
(0) f (>a:) | |
1 | |
(>a:) f (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
''' | |
Collects answers to a PPCG KotH question and saves the largest code block | |
from each answer (using the name and language info in the answer header) | |
into a directory. | |
''' | |
import html,re,os,sys,urllib.request,zlib,argparse | |
def clean(s): | |
s=html.unescape(s) | |
try: |