1: Preparation for conversion to CLJC. Doesn't yet fully work but that seems
to be due to a breaking change in a library.
This commit is contained in:
parent
f1b35dc948
commit
6237eab0cd
13
project.clj
13
project.clj
|
@ -1,4 +1,4 @@
|
||||||
(defproject mw-engine "0.1.5-SNAPSHOT"
|
(defproject mw-engine "3.0.0-SNAPSHOT"
|
||||||
:description "Cellular automaton world builder."
|
:description "Cellular automaton world builder."
|
||||||
:url "http://www.journeyman.cc/microworld/"
|
:url "http://www.journeyman.cc/microworld/"
|
||||||
:manifest {
|
:manifest {
|
||||||
|
@ -9,13 +9,14 @@
|
||||||
"Implementation-Version" "unset"
|
"Implementation-Version" "unset"
|
||||||
}
|
}
|
||||||
:jvm-opts ["-Xmx4g"]
|
:jvm-opts ["-Xmx4g"]
|
||||||
|
:source-paths ["src/clj" "src/cljc"]
|
||||||
:license {:name "GNU General Public License v2"
|
:license {:name "GNU General Public License v2"
|
||||||
:url "http://www.gnu.org/licenses/gpl-2.0.html"}
|
:url "http://www.gnu.org/licenses/gpl-2.0.html"}
|
||||||
:plugins [[lein-marginalia "0.7.1"]]
|
:plugins [[lein-marginalia "0.7.1"]]
|
||||||
:dependencies [[org.clojure/clojure "1.6.0"]
|
:dependencies [[org.clojure/clojure "1.8.0"]
|
||||||
[org.clojure/math.combinatorics "0.0.7"]
|
[org.clojure/math.combinatorics "0.1.3"]
|
||||||
[org.clojure/tools.trace "0.7.8"]
|
[org.clojure/tools.trace "0.7.8"]
|
||||||
[org.clojure/tools.namespace "0.2.4"]
|
[org.clojure/tools.namespace "0.2.10"]
|
||||||
[hiccup "1.0.5"]
|
[hiccup "1.0.5"]
|
||||||
[net.mikera/imagez "0.3.1"]
|
[net.mikera/imagez "0.11.0"]
|
||||||
[fivetonine/collage "0.2.0"]])
|
[fivetonine/collage "0.2.1"]])
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
(ns ^{:doc "Simple functions to allow a world to be visualised."
|
(ns ^{:doc "Simple functions to allow a world to be visualised."
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
mw-engine.display
|
microworld.engine.display
|
||||||
(:require [hiccup.core :refer [html]]
|
(:require [hiccup.core :refer [html]]
|
||||||
mw-engine.utils
|
microworld.engine.utils
|
||||||
mw-engine.world))
|
microworld.engine.world))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;
|
;;;;
|
||||||
;;;; mw-engine: the state/transition engine of MicroWorld.
|
;;;; microworld.engine: the state/transition engine of MicroWorld.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This program is free software; you can redistribute it and/or
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU General Public License
|
;;;; modify it under the terms of the GNU General Public License
|
|
@ -1,14 +1,14 @@
|
||||||
(ns ^{:doc "Functions to transform a world and run rules."
|
(ns ^{:doc "Functions to transform a world and run rules."
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
mw-engine.core
|
microworld.engine.core
|
||||||
(:require [clojure.core.reducers :as r]
|
(:require [clojure.core.reducers :as r]
|
||||||
[mw-engine.world :as world]
|
[microworld.engine.world :as world]
|
||||||
[mw-engine.utils :refer [get-int-or-zero map-world]])
|
[microworld.engine.utils :refer [get-int-or-zero map-world]])
|
||||||
(:gen-class))
|
(:gen-class))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;
|
;;;;
|
||||||
;;;; mw-engine: the state/transition engine of MicroWorld.
|
;;;; microworld.engine: the state/transition engine of MicroWorld.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This program is free software; you can redistribute it and/or
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU General Public License
|
;;;; modify it under the terms of the GNU General Public License
|
|
@ -2,16 +2,16 @@
|
||||||
compute drainage on a world, assumed to have altitudes already set
|
compute drainage on a world, assumed to have altitudes already set
|
||||||
from a heightmap."
|
from a heightmap."
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
mw-engine.drainage
|
microworld.engine.drainage
|
||||||
(:require [mw-engine.core :refer [run-world]]
|
(:require [microworld.engine.core :refer [run-world]]
|
||||||
[mw-engine.heightmap :as heightmap]
|
[microworld.engine.heightmap :as heightmap]
|
||||||
[mw-engine.utils :refer [get-int-or-zero get-least-cell get-neighbours
|
[microworld.engine.utils :refer [get-int-or-zero get-least-cell get-neighbours
|
||||||
get-neighbours-with-property-value
|
get-neighbours-with-property-value
|
||||||
map-world]]))
|
map-world]]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;
|
;;;;
|
||||||
;;;; mw-engine: the state/transition engine of MicroWorld.
|
;;;; microworld.engine: the state/transition engine of MicroWorld.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This program is free software; you can redistribute it and/or
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU General Public License
|
;;;; modify it under the terms of the GNU General Public License
|
|
@ -1,16 +1,16 @@
|
||||||
(ns ^{:doc "Functions to apply a heightmap to a world."
|
(ns ^{:doc "Functions to apply a heightmap to a world."
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
mw-engine.heightmap
|
microworld.engine.heightmap
|
||||||
(:import [java.awt.image BufferedImage])
|
(:import [java.awt.image BufferedImage])
|
||||||
(:require [fivetonine.collage.util :as collage :only [load-image]]
|
(:require [fivetonine.collage.util :as collage :only [load-image]]
|
||||||
[mikera.image.core :as imagez :only [filter-image get-pixels]]
|
[mikera.image.core :as imagez :only [filter-image get-pixels]]
|
||||||
[mikera.image.filters :as filters]
|
[mikera.image.filters :as filters]
|
||||||
[mw-engine.utils :refer [abs get-int get-neighbours map-world]]
|
[microworld.engine.utils :refer [abs get-int get-neighbours map-world]]
|
||||||
[mw-engine.world :refer [make-world]]))
|
[microworld.engine.world :refer [make-world]]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;
|
;;;;
|
||||||
;;;; mw-engine: the state/transition engine of MicroWorld.
|
;;;; microworld.engine: the state/transition engine of MicroWorld.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This program is free software; you can redistribute it and/or
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU General Public License
|
;;;; modify it under the terms of the GNU General Public License
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
If the heightmap you supply is smaller than the world, this will break.
|
If the heightmap you supply is smaller than the world, this will break.
|
||||||
|
|
||||||
* `world` not actually used, but present to enable this function to be
|
* `world` not actually used, but present to enable this function to be
|
||||||
passed as an argument to `mw-engine.utils/map-world`, q.v.
|
passed as an argument to `microworld.engine.utils/map-world`, q.v.
|
||||||
* `cell` a cell, as discussed in world.clj, q.v. Alternatively, a map;
|
* `cell` a cell, as discussed in world.clj, q.v. Alternatively, a map;
|
||||||
* `property` the property (normally a keyword) whose value will be set on the cell.
|
* `property` the property (normally a keyword) whose value will be set on the cell.
|
||||||
* `heightmap` an (ideally) greyscale image, whose x and y dimensions should
|
* `heightmap` an (ideally) greyscale image, whose x and y dimensions should
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
If the heightmap you supply is smaller than the world, this will break.
|
If the heightmap you supply is smaller than the world, this will break.
|
||||||
|
|
||||||
* `world` not actually used, but present to enable this function to be
|
* `world` not actually used, but present to enable this function to be
|
||||||
passed as an argument to `mw-engine.utils/map-world`, q.v.;
|
passed as an argument to `microworld.engine.utils/map-world`, q.v.;
|
||||||
* `cell` a cell, as discussed in world.clj, q.v. Alternatively, a map;
|
* `cell` a cell, as discussed in world.clj, q.v. Alternatively, a map;
|
||||||
* `heightmap` an (ideally) greyscale image, whose x and y dimensions should
|
* `heightmap` an (ideally) greyscale image, whose x and y dimensions should
|
||||||
exceed those of the world of which the `cell` forms part."
|
exceed those of the world of which the `cell` forms part."
|
|
@ -1,12 +1,12 @@
|
||||||
(ns ^{:doc "A set of MicroWorld rules describing a simplified natural ecosystem."
|
(ns ^{:doc "A set of MicroWorld rules describing a simplified natural ecosystem."
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
mw-engine.natural-rules
|
microworld.engine.natural-rules
|
||||||
(:require mw-engine.utils
|
(:require microworld.engine.utils
|
||||||
mw-engine.world))
|
microworld.engine.world))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;
|
;;;;
|
||||||
;;;; mw-engine: the state/transition engine of MicroWorld.
|
;;;; microworld.engine: the state/transition engine of MicroWorld.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This program is free software; you can redistribute it and/or
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU General Public License
|
;;;; modify it under the terms of the GNU General Public License
|
|
@ -1,13 +1,13 @@
|
||||||
(ns ^{:doc "Utility functions needed by MicroWorld and, specifically, in the
|
(ns ^{:doc "Utility functions needed by MicroWorld and, specifically, in the
|
||||||
interpretation of MicroWorld rule."
|
interpretation of MicroWorld rule."
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
mw-engine.utils
|
microworld.engine.utils
|
||||||
(:require
|
(:require
|
||||||
[clojure.math.combinatorics :as combo]))
|
[clojure.math.combinatorics :as combo]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;
|
;;;;
|
||||||
;;;; mw-engine: the state/transition engine of MicroWorld.
|
;;;; microworld.engine: the state/transition engine of MicroWorld.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This program is free software; you can redistribute it and/or
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU General Public License
|
;;;; modify it under the terms of the GNU General Public License
|
|
@ -1,12 +1,12 @@
|
||||||
(ns ^{:doc "Functions to create and to print two dimensional cellular automata."
|
(ns ^{:doc "Functions to create and to print two dimensional cellular automata."
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
mw-engine.world
|
microworld.engine.world
|
||||||
(:require [clojure.string :as string :only [join]]
|
(:require [clojure.string :as string :only [join]]
|
||||||
[mw-engine.utils :refer [population]]))
|
[microworld.engine.utils :refer [population]]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;
|
;;;;
|
||||||
;;;; mw-engine: the state/transition engine of MicroWorld.
|
;;;; microworld.engine: the state/transition engine of MicroWorld.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This program is free software; you can redistribute it and/or
|
;;;; This program is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU General Public License
|
;;;; modify it under the terms of the GNU General Public License
|
|
@ -1,6 +1,6 @@
|
||||||
(ns mw-engine.core-test
|
(ns microworld.engine.core-test
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer :all]
|
||||||
[mw-engine.core :refer :all]))
|
[microworld.engine.core :refer :all]))
|
||||||
|
|
||||||
(deftest apply-rule-test
|
(deftest apply-rule-test
|
||||||
(testing "Application of a single rule"
|
(testing "Application of a single rule"
|
|
@ -1,8 +1,8 @@
|
||||||
(ns mw-engine.drainage-test
|
(ns microworld.engine.drainage-test
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer :all]
|
||||||
[mw-engine.world :as world]
|
[microworld.engine.world :as world]
|
||||||
[mw-engine.utils :as utils]
|
[microworld.engine.utils :as utils]
|
||||||
[mw-engine.drainage :refer :all]))
|
[microworld.engine.drainage :refer :all]))
|
||||||
|
|
||||||
(deftest is-hollow-test
|
(deftest is-hollow-test
|
||||||
(testing "detection of hollows"
|
(testing "detection of hollows"
|
|
@ -1,8 +1,8 @@
|
||||||
(ns mw-engine.heightmap-test
|
(ns microworld.engine.heightmap-test
|
||||||
(:use clojure.java.io)
|
(:use clojure.java.io)
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer :all]
|
||||||
[mw-engine.heightmap :refer :all]
|
[microworld.engine.heightmap :refer :all]
|
||||||
[mw-engine.world :as world :only [make-world]]
|
[microworld.engine.world :as world :only [make-world]]
|
||||||
[clojure.math.combinatorics :as combo]))
|
[clojure.math.combinatorics :as combo]))
|
||||||
|
|
||||||
(deftest apply-heightmap-test
|
(deftest apply-heightmap-test
|
|
@ -1,8 +1,8 @@
|
||||||
(ns mw-engine.utils-test
|
(ns microworld.engine.utils-test
|
||||||
(:use [mw-engine.world :as world])
|
(:use [microworld.engine.world :as world])
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer :all]
|
||||||
[clojure.math.combinatorics :as combo]
|
[clojure.math.combinatorics :as combo]
|
||||||
[mw-engine.utils :refer :all]))
|
[microworld.engine.utils :refer :all]))
|
||||||
|
|
||||||
(deftest abs-test
|
(deftest abs-test
|
||||||
(testing "Absolute value function"
|
(testing "Absolute value function"
|
|
@ -1,6 +1,6 @@
|
||||||
(ns mw-engine.world-test
|
(ns microworld.engine.world-test
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer :all]
|
||||||
[mw-engine.world :refer :all]
|
[microworld.engine.world :refer :all]
|
||||||
[clojure.math.combinatorics :as combo]))
|
[clojure.math.combinatorics :as combo]))
|
||||||
|
|
||||||
(deftest genesis-test
|
(deftest genesis-test
|
Loading…
Reference in a new issue