Skip to content

fredwu/code-test-2016-trunkplatform

Repository files navigation

Trunk Platform Code Test by Fred Wu

Prerequisite

  • ruby 2.2+
  • bundler
bundle install

Usage

./bin/zombieland --help

Example usage:
    -i, --input FILE                 Path to the zombie game input file
    -t, --tunnelling_wall [NO]       Enable the tunnelling wall mode

Normal Mode

./bin/zombieland -i example-data/input.txt

Tunnelling Wall Mode

./bin/zombieland -i example-data/input.txt -t yes

Application Architecture

    +----------------------------+
    |             CLI            |
    +--------------+-------------+
                   |
+------------------v-----------------+
|              Workflow              |
+------------------------------------+
|   +----------------------------+   |
|   |         Transformer        |   | <- Transforms CSV input for consumption.
|   +--------------+-------------+   |
|                  |                 |
|   +--------------v-------------+   |
|   |            Game            |   | <- Runs the game logic.
|   +----------------------------+   |
|   |  +----------------------+  |   |
|   |  |        Models        |  |   | <- Domain models.
|   |  +----------------------+  |   |
|   |  |  +----------------+  |  |   |
|   |  |  |       Map      |  |  |   |
|   |  |  | +------------+ |  |  |   |
|   |  |  | | Coordinate | |  |  |   |
|   |  |  | +------------+ |  |  |   |
|   |  |  +----------------+  |  |   |
|   |  |  +----------------+  |  |   |
|   |  |  |     Object     |  |  |   | <- Zombie or creature.
|   |  |  | +------------+ |  |  |   |
|   |  |  | |  Movement  | |  |  |   |
|   |  |  | +------------+ |  |  |   |
|   |  |  +----------------+  |  |   |
|   |  +----------------------+  |   |
|   +--------------+-------------+   |
|                  |                 |
|   +--------------v-------------+   |
|   |          Presenter         |   | <- Presents the game output to CLI.
|   +----------------------------+   |
+------------------------------------+

Test Suite

Run all the tests

bundle exec rake

Run only Rubocop

bundle exec rake rubocop

Run only spec

bundle exec rake spec

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages