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 | |
RED = '\x1b[31m' | |
YELLOW = '\x1b[33m' | |
GREEN = '\x1b[32m' | |
RESET = '\x1b[0m' | |
class RPS(object): | |
# Move : Counter | |
regular_moves = { |
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
class Color: | |
''' RGBA color handler ''' | |
def __init__(self, hexcode='000000', alpha='00'): | |
self.hexcode = hexcode | |
self.alpha = alpha | |
@property | |
def hexcode(self): | |
return ('{:02x}' * 3).format(int(self.r), int(self.g), int(self.b)) |
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
''' | |
Project Euler Problem #11 | |
What is the greatest product of four adjacent numbers in the same direction | |
(up, down, left, right, or diagonally) in the 20×20 grid? | |
''' | |
grid = ( | |
( 8, 2,22,97,38,15, 0,40, 0,75, 4, 5, 7,78,52,12,50,77,91, 8), | |
(49,49,99,40,17,81,18,57,60,87,17,40,98,43,69,48, 4,56,62, 0), | |
(81,49,31,73,55,79,14,29,93,71,40,67,53,88,30, 3,49,13,36,65), |
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
#!/usr/bin/env python3 | |
import argparse | |
import warnings | |
import praw.errors | |
import praw_script_oauth as pso | |
from getpass import getpass | |
USERAGENT = 'SubredditCopy:v1.0 - /u/NoobStuff' | |
CLIENTID = 'APP_ID_HERE' |