Skip to content

Instantly share code, notes, and snippets.

package com.lge.metr
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
import org.scalacheck.Prop.BooleanOperators
import org.scalacheck.Prop.classify
import org.scalacheck.Prop.collect
import org.scalacheck.Arbitrary
import org.scalacheck.Arbitrary._
import org.scalacheck._
@zlqhem
zlqhem / GameDef.scala
Created November 14, 2013 00:48
7주차 숙제 @ Functional Programming Principles in Scala https://class.coursera.org/progfun-003/assignment/view?assignment_id=19
package streams
import common._
/**
* This trait represents the layout and building blocks of the game
*
* @TODO: SHOULD RENAME `x` and `y` in class Pos to `row` and `col`. It's
* confusing to have `x` being the vertical axis.
*/
@zlqhem
zlqhem / waterpouring.scala
Last active December 27, 2015 23:49
written by jooyunghan and me
object waterpouring {
type State = (Int, Int)
val initState = (0, 0)
val target = 6
val limit = (4, 9)
abstract class Action {
def apply(current:State):State
}
import Data.List
import Data.Char
import Control.Monad
-- transpose
input="A-small-practice.in"
data Result = WinX | WinO | Draw | DontKnow deriving (Show, Eq)
type Board = [String]
whoWin :: Board -> Result
whoWin b