Skip to content

Instantly share code, notes, and snippets.

View sordina's full-sized avatar

Lyndon Maydwell sordina

View GitHub Profile
@sordina
sordina / Rover.hs
Last active December 10, 2015 12:19 — forked from anonymous/Rover.hs
import Data.List (foldl')
import Data.List.Split (chunksOf)
-- Main:
main :: IO ()
main = print $ run input == output
-- Test-Data:
@sordina
sordina / index.html
Created October 3, 2012 04:59 — forked from mbostock/.block
OMG Particles! (D3)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>OMG Particles!</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>
<style type="text/css">
body {
background: #222;
@sordina
sordina / Life.hs
Created December 9, 2011 01:40 — forked from anonymous/Life.hs
Small game of life implementation
import Data.List
import Control.Arrow
import System.Random
-- Core Life Engine
life = f 3 >>> map (map (q 3 >>> uncurry s))
s n 1 | n < 3 = 0 -- There is no 'off-by-one' error here
#!/usr/bin/env ruby
class Array
def transpose
width = self.map {|e| e.length}.max
trans = []
(0..width - 1).each do |col|
self.each do |row|
element = row[col]
(trans[col] ||= []) << element