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:
simon 2016-09-24 10:29:34 +01:00
parent f1b35dc948
commit 6237eab0cd
13 changed files with 50 additions and 49 deletions

View file

@ -1,4 +1,4 @@
(defproject mw-engine "0.1.5-SNAPSHOT"
(defproject mw-engine "3.0.0-SNAPSHOT"
:description "Cellular automaton world builder."
:url "http://www.journeyman.cc/microworld/"
:manifest {
@ -9,13 +9,14 @@
"Implementation-Version" "unset"
}
:jvm-opts ["-Xmx4g"]
:source-paths ["src/clj" "src/cljc"]
:license {:name "GNU General Public License v2"
:url "http://www.gnu.org/licenses/gpl-2.0.html"}
:plugins [[lein-marginalia "0.7.1"]]
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/math.combinatorics "0.0.7"]
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/math.combinatorics "0.1.3"]
[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"]
[net.mikera/imagez "0.3.1"]
[fivetonine/collage "0.2.0"]])
[net.mikera/imagez "0.11.0"]
[fivetonine/collage "0.2.1"]])

View file

@ -1,13 +1,13 @@
(ns ^{:doc "Simple functions to allow a world to be visualised."
:author "Simon Brooke"}
mw-engine.display
microworld.engine.display
(:require [hiccup.core :refer [html]]
mw-engine.utils
mw-engine.world))
microworld.engine.utils
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
;;;; modify it under the terms of the GNU General Public License

View file

@ -1,14 +1,14 @@
(ns ^{:doc "Functions to transform a world and run rules."
:author "Simon Brooke"}
mw-engine.core
microworld.engine.core
(:require [clojure.core.reducers :as r]
[mw-engine.world :as world]
[mw-engine.utils :refer [get-int-or-zero map-world]])
[microworld.engine.world :as world]
[microworld.engine.utils :refer [get-int-or-zero map-world]])
(: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
;;;; modify it under the terms of the GNU General Public License

View file

@ -2,16 +2,16 @@
compute drainage on a world, assumed to have altitudes already set
from a heightmap."
:author "Simon Brooke"}
mw-engine.drainage
(:require [mw-engine.core :refer [run-world]]
[mw-engine.heightmap :as heightmap]
[mw-engine.utils :refer [get-int-or-zero get-least-cell get-neighbours
microworld.engine.drainage
(:require [microworld.engine.core :refer [run-world]]
[microworld.engine.heightmap :as heightmap]
[microworld.engine.utils :refer [get-int-or-zero get-least-cell get-neighbours
get-neighbours-with-property-value
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
;;;; modify it under the terms of the GNU General Public License

View file

@ -1,16 +1,16 @@
(ns ^{:doc "Functions to apply a heightmap to a world."
:author "Simon Brooke"}
mw-engine.heightmap
microworld.engine.heightmap
(:import [java.awt.image BufferedImage])
(:require [fivetonine.collage.util :as collage :only [load-image]]
[mikera.image.core :as imagez :only [filter-image get-pixels]]
[mikera.image.filters :as filters]
[mw-engine.utils :refer [abs get-int get-neighbours map-world]]
[mw-engine.world :refer [make-world]]))
[microworld.engine.utils :refer [abs get-int get-neighbours map-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
;;;; 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.
* `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;
* `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
@ -86,7 +86,7 @@
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
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;
* `heightmap` an (ideally) greyscale image, whose x and y dimensions should
exceed those of the world of which the `cell` forms part."

View file

@ -1,12 +1,12 @@
(ns ^{:doc "A set of MicroWorld rules describing a simplified natural ecosystem."
:author "Simon Brooke"}
mw-engine.natural-rules
(:require mw-engine.utils
mw-engine.world))
microworld.engine.natural-rules
(:require microworld.engine.utils
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
;;;; modify it under the terms of the GNU General Public License

View file

@ -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."
:author "Simon Brooke"}
mw-engine.utils
microworld.engine.utils
(:require
[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
;;;; modify it under the terms of the GNU General Public License

View file

@ -1,12 +1,12 @@
(ns ^{:doc "Functions to create and to print two dimensional cellular automata."
:author "Simon Brooke"}
mw-engine.world
microworld.engine.world
(: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
;;;; modify it under the terms of the GNU General Public License

View file

@ -1,6 +1,6 @@
(ns mw-engine.core-test
(ns microworld.engine.core-test
(:require [clojure.test :refer :all]
[mw-engine.core :refer :all]))
[microworld.engine.core :refer :all]))
(deftest apply-rule-test
(testing "Application of a single rule"

View file

@ -1,8 +1,8 @@
(ns mw-engine.drainage-test
(ns microworld.engine.drainage-test
(:require [clojure.test :refer :all]
[mw-engine.world :as world]
[mw-engine.utils :as utils]
[mw-engine.drainage :refer :all]))
[microworld.engine.world :as world]
[microworld.engine.utils :as utils]
[microworld.engine.drainage :refer :all]))
(deftest is-hollow-test
(testing "detection of hollows"

View file

@ -1,8 +1,8 @@
(ns mw-engine.heightmap-test
(ns microworld.engine.heightmap-test
(:use clojure.java.io)
(:require [clojure.test :refer :all]
[mw-engine.heightmap :refer :all]
[mw-engine.world :as world :only [make-world]]
[microworld.engine.heightmap :refer :all]
[microworld.engine.world :as world :only [make-world]]
[clojure.math.combinatorics :as combo]))
(deftest apply-heightmap-test

View file

@ -1,8 +1,8 @@
(ns mw-engine.utils-test
(:use [mw-engine.world :as world])
(ns microworld.engine.utils-test
(:use [microworld.engine.world :as world])
(:require [clojure.test :refer :all]
[clojure.math.combinatorics :as combo]
[mw-engine.utils :refer :all]))
[microworld.engine.utils :refer :all]))
(deftest abs-test
(testing "Absolute value function"

View file

@ -1,6 +1,6 @@
(ns mw-engine.world-test
(ns microworld.engine.world-test
(:require [clojure.test :refer :all]
[mw-engine.world :refer :all]
[microworld.engine.world :refer :all]
[clojure.math.combinatorics :as combo]))
(deftest genesis-test