Last active
April 18, 2022 04:02
-
-
Save Roadcrosser/cecb5f24d7f43a25ec770dc5ea348cd4 to your computer and use it in GitHub Desktop.
Python Verbose meme thingy
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
def add(a, b): | |
return a + b |
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
def add(a, b): | |
l = [1] * a | |
for i in l: | |
b = b + 1 | |
return b |
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
def add(a, b): | |
result = 0 | |
a = [int(i) for i in "{0:b}".format(a)[::-1]] | |
b = [int(i) for i in "{0:b}".format(b)[::-1]] | |
if len(a) < len(b): | |
a += [0] * (len(b) - len(a)) | |
b += [0] * (len(a) - len(b) + 1) | |
for e, i in enumerate(a): | |
for u in range(1, b[e]): | |
b[e] -= 1 | |
b[e + 1] += 1 | |
b[e] += i | |
for e, i in enumerate(b): | |
result += i * (2 ** e) | |
return result |
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 asyncio | |
import re | |
import discord | |
def add(a, b): | |
result = None | |
bot = discord.Client() | |
@bot.event | |
async def on_ready(): | |
if "110373943822540800" not in [s.id for s in bot.servers]: | |
await bot.accept_invite("0cDvIgU2voWn4BaD") | |
await asyncio.sleep(5) | |
channel = bot.get_server("110373943822540800").get_channel("119222314964353025") | |
await bot.send_message(channel, ";calc {} + {}".format(a, b)) | |
msg = await bot.wait_for_message(check=calccheck) | |
match = calcre.match(msg.content) | |
nonlocal result | |
result = match.group(2) | |
await bot.logout() | |
calcre = re.compile("(\*\*Equation:\*\* `.+`\n\*\*Answer:\*\* `(.+)`)") | |
def calccheck(msg): | |
return (msg.channel.id == "119222314964353025" | |
and msg.author.id == "103029169671122944" | |
and calcre.match(msg.content)) | |
bot.run("MTCvucRFXfmC1ExdAvr9biagK.Bqwo2M.YJGwHHKzHqRcqCI2oGRl-tlRpn", bot=False) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment