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
%%%------------------------------------------------------------------- | |
%%% @author Alex S | |
%%% @copyright (C) 2016, Alex S | |
%%% @doc | |
%%% Homegrown Hinze/Paterson FingerTree implementation optimized for speed and | |
%%% occasionally size. | |
%%% Note that despite Erlang being an eager language, we do not use | |
%%% Kaplan-Tarjan implementation because I didn't want to descend into | |
%%% madness of stacks of stacks upon stacks; thus, this implementation | |
%%% gives no real-time guarantees but good amortized guarantees. |
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
# snake | |
from collections import deque | |
import functools | |
import operator | |
import time | |
import tkinter | |
from tkinter.constants import * | |
import random | |
class point(tuple): |
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 random | |
def recase(w): | |
return ''.join(x.upper() if random.randint(0, 1) else x.lower() for x in w) | |
import sys | |
n = int(sys.argv[2]) | |
for i in range(n): | |
print(recase(sys.argv[1]), end=' ') | |
print() |