Skip to content

Instantly share code, notes, and snippets.

#!/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'
@NoobStuff
NoobStuff / euler11.py
Created August 31, 2016 04:13
Project Euler Problem #11
'''
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),
@NoobStuff
NoobStuff / color.py
Last active February 26, 2016 12:03
RGBA color class using property decorators
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))
@NoobStuff
NoobStuff / rock_paper_scissors.py
Created December 30, 2015 07:06
rock paper scissors (lizard spock) noob project
import random
RED = '\x1b[31m'
YELLOW = '\x1b[33m'
GREEN = '\x1b[32m'
RESET = '\x1b[0m'
class RPS(object):
# Move : Counter
regular_moves = {