Skip to content

Instantly share code, notes, and snippets.

@perey
perey / challenge224hard.py
Last active August 29, 2015 14:25
Langford sequence coding challenge
#!/usr/bin/env python3
"""Daily Programmer Challenge #224 [Hard] Langford Strings
https://www.reddit.com/r/dailyprogrammer/
"""
from string import ascii_uppercase
from copy import copy
@perey
perey / rectangle_tests.json
Last active August 29, 2015 14:25
Test data for reddit dailyprogrammer's Challenge #224 [Intermediate]
[
{"name": "the example",
"diagram": [
" +----+",
" | |",
"+-------------------------+-----+----+",
"| | | |",
"| +-------------------+-----+ |",
"| | | | |",
"| | | | |",
@perey
perey / codegolf_stars.py
Created July 16, 2015 08:02
"The Colors in Our Stars" Code Golf Challenge
#!/usr/bin/env python3
"""Pretty star picture maker.
This is the ungolfed version.
http://codegolf.stackexchange.com/questions/53124/the-colors-in-our-stars
"""
from collections import namedtuple
@perey
perey / svg-test.html
Created May 10, 2014 14:04
Test case for generating, viewing and saving SVG client-side in HTML+JS.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8"/>
<title>SVG Generator</title>
<style type="text/css">
figure {
width: 45%;
float: right;
}