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 __future__ import division | |
def gcd(a, b): | |
if a == 0: | |
return 1 | |
while b != 0: | |
t = b | |
b = a % b | |
a = 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
def _(s=None,a=0): | |
if isinstance(s, str): | |
try: | |
if a == 0: | |
exec(s) | |
elif a == 1: | |
return eval(s) | |
except Exception as e: | |
return repr(e) | |
elif s == 0: |
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
# 8 characters: _ ~ + , ( ) [ ] and 1 function | |
# code.py is the original code | |
# obf.py is the obfuscated code | |
def _(s=None,a=0): | |
if isinstance(s, str): | |
try: | |
if a == 0: | |
exec(s) | |
elif a == 1: |
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
import sys | |
import itertools | |
no_of_disks = int(raw_input("No. of disks: ")) if len(sys.argv) < 2 else int(sys.argv[1]) | |
def disk_to_move(move_number): | |
diff = move_number ^ (move_number + 1) | |
return bin(diff)[2:].count("1") - 1 | |
def generate_move(disk_to_move, disk_states): |
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
import sys | |
import time | |
import os | |
class _Getch: | |
"""Gets a single character from standard input. Does not echo to the | |
screen.""" | |
def __init__(self): | |
try: | |
self.impl = _GetchWindows() |
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
import turtle | |
t = turtle.Turtle() | |
s = turtle.Screen() | |
t.pu() | |
t.goto(0,0) | |
t.pd() | |
t.speed(0) | |
# mod here |
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 PIL import Image | |
import random | |
raw_input = input | |
rule = int(raw_input("Rule: ")) | |
itn = int(raw_input("Number of rows: ")) | |
w = (2*itn)-1 | |
print("") |
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
#""" | |
#Encoder | |
c=[chr(x) for x in range(65,91)+range(97,123)+range(48,58)+[43,47]];a=raw_input();p=(3-(len(a)%3))%3;a+="\x00"*p;a=''.join(["0"*(8-len(x))+x for x in [bin(ord(x)).replace("0b","") for x in a]]);a=[c[int(x,2)] for x in [a[i:i+6] for i in range(0,len(a),6)]];a=''.join(a[:(len(a)-p)])+"="*p;print(a) | |
#""" | |
""" | |
#Decoder | |
c=[chr(x) for x in range(65,91)+range(97,123)+range(48,58)+[43,47,61]];a=raw_input();a=''.join(["0"*(6-len(x))+x for x in [bin(c.index(x)%64).replace("0b","") for x in a]]);a=''.join([chr(int(a[i:i+8],2)) for i in range(0,len(a),8)]);print(a) | |
#""" |
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 PIL import Image | |
from fractions import gcd | |
from math import sqrt | |
w = 2048 | |
img = Image.new("RGB", (w, w), color=(255,255,255)) | |
for i in range(1,w): | |
for j in range(1,w): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.