Skip to content

Instantly share code, notes, and snippets.

@joseraya
joseraya / Roman.scala
Created April 14, 2012 15:47
Roman Numerals Scala (2)
A more functional version would be:
package kata
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.{BeforeAndAfterEach, FlatSpec}
class Roman extends FlatSpec with ShouldMatchers {
case class Symbol(latin:Int, roman:String)
var symbols = List(Symbol(5,"V"), Symbol(4, "IV"), Symbol(1,"I"))
@joseraya
joseraya / Roman.scala
Created April 14, 2012 15:02
Roman Numerals Kata
package kata
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.{BeforeAndAfterEach, FlatSpec}
class Roman extends FlatSpec with ShouldMatchers {
case class Symbol(latin:Int, roman:String)
var symbols = List(Symbol(5,"V"), Symbol(4, "IV"), Symbol(1,"I"))
@joseraya
joseraya / life.clj
Created December 3, 2011 22:34
Game of life clojure implementation
(ns life.test.core
(:use [life.core])
(:use [clojure.test]))
(def alive 1)
(def dead 0)
(defn cell-at [board x y]
(nth (nth board y []) x 0))