099b95fab4
The recognizer algorithm operates on a `NonEmptyGrid` of `Maybe` elements. However, there may exist some progenitor object with auxiliary metadata payload that is independent of the algorithm but should be presented along with the final recognized structure. So long as an "extraction" function is provided that derives the nonempty grid of `a`s from the original object `b`, we can send `b` along for the ride through the algorithm without concern to `b`'s internals. # Changes Overall this refactoring makes the code more generic and simpler. * Build the recognizer automata at scenario parse time * Enforce grid no emptiness earlier in recognizer construction * Subsume redundant `_structureDefs` member of `StaticStructureInfo` record with `_staticAutomatons` field * Make some type signatures in the UI more generic * Push the conversion from `Cell` to `Entity `further up the pipeline * Remove some derived `Show` instances (`show`-ing a Scenario is not likely to be useful due to sheer volume of content) |
||
---|---|---|
.github | ||
.vscode | ||
app | ||
data | ||
docs | ||
editors | ||
example | ||
images | ||
scripts | ||
src | ||
test | ||
tournament | ||
web | ||
.gitignore | ||
.hlint.yaml | ||
.stan.toml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
COMMUNITY.md | ||
CONTRIBUTING.md | ||
DESIGN.md | ||
feedback.yaml | ||
fourmolu.yaml | ||
LICENSE | ||
NOTICE | ||
README.md | ||
scenarios | ||
swarm.cabal | ||
weeder.toml |
Swarm
Swarm is a 2D programming and resource gathering game. Program your robots to explore the world and collect resources, which in turn allows you to build upgraded robots that can run more interesting and complex programs. More info can be found on the Swarm website.
Contributing
See CONTRIBUTING.md for information about various ways you can contribute to Swarm development!
Building
If you just want to play the game, head over to the Swarm website for installation instructions. If you want to build Swarm from source (e.g. in order to contribute, or to test out the latest bleeding-edge unreleased features), read on.
-
Clone the Swarm repository, e.g.
git clone https://github.com/swarm-game/swarm.git
-
If you don't already have the
cabal
tool:-
Get the
ghcup
tool, a handy one-stop utility for managing all the different pieces of a Haskell toolchain. -
Use
ghcup
to install a supported version of GHC:ghcup install ghc 9.8.2
-
Use
ghcup
to installcabal
:ghcup install cabal
-
-
Now use
cabal
to build and run Swarm:cd /path/to/the/swarm/repo cabal run -O0 swarm:exe:swarm
(Note that we recommend turning off optimizations with
-O0
since they don't seem to make much difference to the speed of the resulting executable, but they make a big difference in compilation time.) -
Go get a snack while
cabal
downloads and builds all of Swarm's dependencies. -
You might also want to check out the
scripts
directory, which contains an assortment of useful scripts for developers.