from math import * from numpy import * rot = lambda p: [(-y,x) for x,y in p] yflip = lambda p: [(x,-y) for x,y in p] mv = lambda x1,y1,p: [(x+x1, y+y1) for x,y in p] def a(l): if l == 1: return [(0,0), (1,0), (1,1), (0,1)] else: l = l // 2 ax = a(l) return rot(yflip(ax)) + mv(l+1,0,ax) + mv(l+1,l+1,ax) + mv(l,2*l+1,rot(rot(rot(yflip(ax))))) def mktext(s): sz = int(ceil(log(len(s))/log(2)/2)) r = zeros((1<" + c + "" r=r[::-1,:] return r def mkhtml(s): s = [c.upper() for c in s if c.upper() in [chr(x) for x in range(ord('A'),ord('Z')+1)]+["!"]] return "".join(""+"".join(row) for row in mktext(s)) def mkfile(fn,s): f=open(fn,"w"); f.write(''' Hax ''') f.write(mkhtml(s)) f.write('''
''') rickroll = "We're no strangers to love\nYou know the rules and so do I\nA full commitments what I'm thinking of\nYou wouldn't get this from any other guy\n\nNever gonna give you up\nNever gonna let you down\nNever gonna run around and desert you\nNever gonna make you cry\nNever gonna say goodbye\nNever gonna tell a lie and hurt you\n rickrolled" mkfile("hax.html", rickroll)