Skip to content

Instantly share code, notes, and snippets.

View TheTimgor's full-sized avatar

TheTimgor

View GitHub Profile
@TheTimgor
TheTimgor / send_tweet.py
Last active June 3, 2020 00:47
@moeshitbot annotated source code
# ___ _ ______ ____
# / | | / / __ \/ __ \
# / /| | | /| / / / / / / / /
# / ___ | |/ |/ / /_/ / /_/ /
# /_/ |_|__/|__/\____/\____/
#
# @moeshitbot, by timgor | timgor.moe
# annotated source code
#
# this is my shitty cute anime pics twitter bot.
def fast_rot(width, height, raster):
for j in range(0, width):
for k in range(0, height):
to = width * height - (height * j + k + 1)
i = (width - j - 1) + width * k
if i != to:
while i > to:
i = width * (height - (i % height) - 1) + ((i - (i % height)) / height)
buffer = raster[int(i)]
raster[int(i)] = raster[int(to)]