Skip to content

Instantly share code, notes, and snippets.

@ReeceHub
ReeceHub / app.py
Created April 29, 2019 22:31
Roman Numerals
from flask import Flask
from roman_numerals import add
app = Flask(__name__)
@app.route('/add/<a>/<b>')
def add_endpoint(a, b):
return f'Answer: {add(a, b)}'
def add(first, second):
smooshed = ''.join(sorted(first + second, reverse=True))
smooshed = smooshed.replace('IIIII', 'V')
smooshed = smooshed.replace('VV', 'X')
smooshed = smooshed.replace('XXXXX', 'L')
return smooshed
@ReeceHub
ReeceHub / roman_numerals.py
Created December 7, 2018 15:11
roman numerals tdd fridays
order = ['I', 'V', 'X', 'L', 'C', 'D', 'M']
equivalences = {
'IIIII': 'V',
'VV': 'X',
'XXXXX': 'L',
'LL': 'C',
'CCCCC': 'D',
'DD': 'M',
}
@ReeceHub
ReeceHub / keybase.md
Created July 20, 2018 09:42
Keybase proof

Keybase proof

I hereby claim:

  • I am reecehub on github.
  • I am reecelong (https://keybase.io/reecelong) on keybase.
  • I have a public key ASBA1lrbgd5uciIErep4FQ_f4nSgS94tQo5x4EnMC8c4rgo

To claim this, I am signing this object:

import time
def next_generation(input):
mygrid = Grid(input)
mygrid.pretty_print()
nex_gen_grid = mygrid._next_generation()
return nex_gen_grid.dump()
class Grid:
@ReeceHub
ReeceHub / asteroids2.py
Created June 22, 2017 11:05
First attempt at Asteroid Robots challenge
import json
class Robot:
def __init__(self, asteroid, x, y, bearing):
self.x = x
self.y = y
self.bearing = bearing
self.asteroid = asteroid
@ReeceHub
ReeceHub / GildedRoseRequirements.txt
Created June 22, 2017 11:01
First attempt at Gilded Rose kata
======================================
Gilded Rose Requirements Specification
======================================
Hi and welcome to team Gilded Rose. As you know, we are a small inn with a prime location in a
prominent city ran by a friendly innkeeper named Allison. We also buy and sell only the finest goods.
Unfortunately, our goods are constantly degrading in quality as they approach their sell by date. We
have a system in place that updates our inventory for us. It was developed by a no-nonsense type named
Leeroy, who has moved on to new adventures. Your task is to add the new feature to our system so that
we can begin selling a new category of items. First an introduction to our system: