Skip to content

Commit c751355

Browse files
committed
improves the getting started instructions and integrations
1 parent dcfe0aa commit c751355

File tree

6 files changed

+148
-15
lines changed

6 files changed

+148
-15
lines changed

.idea/runConfigurations/GameOfLife__build_.xml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/GameOfLife__clean_.xml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/GameOfLife__run_.xml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/GameOfLife__test_.xml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,56 @@
22

33
Inspired by a challenge issued earlier in the week.
44

5+
## Getting started
6+
7+
To get started clone this repo. The project is made to integrate with [IntelliJ idea](https://www.jetbrains.com/idea/).
8+
There are several gradle integrated run configurations that will aid in a quick start (see `GameOfLife [run]`).
9+
Running `gradlew.bat run`(windows) or `gradlew run`(linux)
10+
will start the application via cli.
11+
12+
### Run Configurations
13+
14+
For now these are all set via inline code.
15+
16+
Further development is set up to enable features such as
17+
18+
- Setting the location of the viewport.
19+
- Setting the scale of the viewport.
20+
- Progression speed of the simulation age / tick-speed
21+
- Pausing the simulation
22+
- Loading start configurations (active/inactive status on the grid) from files
23+
524
## Implementation
625

7-
After an initial lookover the linked wikipage [Conways Game of Life](http://en.wikipedia.org/wiki/Conway's_Game_of_Life). An implementation
8-
seems to require logic to keep track of the entities, and a canvas to render a limited space out of the total of the
9-
abstract 2d plane on which the game logic occurs across.
26+
After an initial look over the linked
27+
wikipage [Conways Game of Life.](http://en.wikipedia.org/wiki/Conway's_Game_of_Life)
28+
An implementation seems to require logic to keep track of the entities, and a canvas to render a limited space out of
29+
the total of the abstract 2d plane on which the game logic occurs across.
30+
31+
### Limitations on current implementation
32+
33+
The current implementation uses a `boolean[][]` type 2d array to store the abstract 2d plane.
34+
35+
The good: Primitive types when in arrays allow for very fast memory access. There is a great talk
36+
here [Youtube - Scott Meyers Nokia talk](https://www.youtube.com/watch?v=WDIkqP4JbkE) that describes why a large data
37+
set capable of being described by a and array of primitives should never be represented as an array of complex typed
38+
objects. This could however likely be rewritten in some combination of logic to handle chunks
39+
and arrays of 64bit integers for the best result.
40+
41+
The bad: This does however add a limitation where the size of the simulation space is neither infinite nor flexible.
42+
Adding simulation space into rows lower than 0 or columns lower than requires a full copy of the array into a larger
43+
array this is unideal.
1044

1145
### Ideas for further development
1246

13-
Move the implementation of the abstract grid containing an array of entities in series of classes into an spring powered mvc app.
47+
Move the implementation of the abstract grid containing an array of entities (see the class `EntityGrid`) into a spring
48+
powered mvc app. This would allow multiple observers to simultaneously observe.
49+
50+
Change the method of simulation progression such that it relies on a queue of changes. This could also allow different
51+
singular clients to stream/download and load the simulation asynchronously.
1452

15-
Extend the implementation of the rendering engine in java fx, to also cover a web app- perhaps angular with a 2d rendering library.
53+
~~Extend the implementation of the rendering engine in java fx, to also cover a web app- perhaps angular with a 2d
54+
rendering library.~~
1655

1756
## Dependencies
1857

app/build.gradle

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,12 @@ javafx {
2222
modules = [ 'javafx.controls', 'javafx.fxml' ]
2323
}
2424

25-
sourceSets {
26-
main {
27-
resources {
28-
srcDirs = ["src/main/java"]
29-
includes = ["**/*.fxml"]
30-
}
31-
}
32-
}
33-
3425
dependencies {
3526
// Use JUnit test framework.
3627
testImplementation 'junit:junit:4.13'
3728

3829
// This dependency is used by the application.
3930
implementation 'com.google.guava:guava:29.0-jre'
40-
4131
}
4232

4333
application {

0 commit comments

Comments
 (0)