This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.specs2.mutable._ | |
import org.specs2.specification._ | |
import org.specs2.matcher._ | |
import org.specs2.execute._ | |
import org.specs2.control.Debug | |
import org.specs2.main.ArgumentsShortcuts | |
import akka.testkit.TestKitBase | |
import akka.actor.ActorSystem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Conway's Game of Life | |
;;; Using a set of coordinates to provide a infinite world | |
;;; | |
;;; Moritz Ulrich <[email protected]> | |
;;; Cologne Clojure User Group | |
;;; November 17, 2011 | |
(ns game-of-life.core | |
(:use [clojure.set :as set])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; msoutier's solution to Interpose a Seq | |
;; https://4clojure.com/problem/40 | |
(fn [s c] (butlast (mapcat #(list %1 s) c))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; msoutier's solution to Replicate a Sequence | |
;; https://4clojure.com/problem/33 | |
(fn [c n] (mapcat #(repeat n %) c)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; msoutier's solution to Pack a Sequence | |
;; https://4clojure.com/problem/31 | |
partition-by identity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; msoutier's solution to Duplicate a Sequence | |
;; https://4clojure.com/problem/32 | |
#(interleave % %) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; msoutier's solution to Drop Every Nth Item | |
;; https://4clojure.com/problem/41 | |
(fn [coll n] | |
(keep-indexed #(if (not= 0 (mod (inc %1) n)) %2 nil) coll)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; marius' solution to Compress a Sequence | |
;; https://4clojure.com/problem/30 | |
#(map last (partition-by str %)) |