https://github.com/thiagokimo/gameoflifeview
A simple Android view that displays Conway's Game of Life. I've learnt the principles of TDD doing this
https://github.com/thiagokimo/gameoflifeview
android conway game-of-life view
Last synced: about 1 month ago
JSON representation
A simple Android view that displays Conway's Game of Life. I've learnt the principles of TDD doing this
- Host: GitHub
- URL: https://github.com/thiagokimo/gameoflifeview
- Owner: thiagokimo
- License: apache-2.0
- Created: 2015-03-01T15:17:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-12-07T21:12:52.000Z (almost 8 years ago)
- Last Synced: 2023-07-01T01:05:58.715Z (over 2 years ago)
- Topics: android, conway, game-of-life, view
- Language: Java
- Homepage:
- Size: 164 KB
- Stars: 20
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GameOfLifeView
[](http://android-arsenal.com/details/1/1672)This is a custom Android view which displays Conway's Game of Life. I've done to display the results of my learnings of Test Driven Development.

## Setup
Gradle:``` groovy
dependencies {
compile 'com.github.thiagokimo:gameoflifeview:1.0.2'
}
```Maven:
``` xml
com.github.thiagokimo
gameoflifeview
1.0.2```
## Usage
### Through XML
``` xml
```
### Through Code
Initialize the view:
``` java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gameOfLifeView = new GameOfLifeView(this);
gameOfLifeView.setProportion(20);
gameOfLifeView.setDeadColor(Color.RED);
gameOfLifeView.setAliveColor(Color.BLUE);
setContentView(gameOfLifeView);
}
```...and run the game with:
``` java
gameOfLifeView.begin();
```## Custom params
From now you can customize the attributes:
- Proportion: The value which the view will use to calculate the cell size and the number of columns and rows the game will have.
- Colors: Dead and alive cells can have any given color.## License
Copyright 2011, 2012 Thiago Rocha
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.