Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules
/node_modules
/.pnp
.pnp.js

# testing
/coverage
Expand All @@ -16,7 +18,6 @@
.env.test.local
.env.production.local

**npm-debug.log*
**yarn-debug.log*
**yarn-error.log*
**yarn.lock
npm-debug.log*
yarn-debug.log*
yarn-error.log*
245 changes: 16 additions & 229 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,240 +1,27 @@
# Cellular Automata and Conway's "Game of Life"
# Cellular Automata and Conway's "Game of Life":
*by **Rob Allen**

---

**NOTE: This is not a data science project.** If you're in the data
science track and want to do a DS-specific project, jump to the [Data
Science Build Week
Repo](https://github.com/LambdaSchool/CS-Data-Science-Build-Week-1).
# Project Overview

---
You can take a quick peek at the **live demo** [here](https://cs-build-week-1-psi.vercel.app/)

Welcome to John Conway's "Game of Life"! This is a computer science
classic from 1970, a program that simulates a _cellular automaton_
(plural _automata_). It has connections to all kinds of different
aspects of computer science and nature.

Over the course of this week, students will work on creating their own
application in which users will be able to run different "Game of Life"
scenarios. This module leads the reader through the fundamentals of
Conways's "Game of Life" and will guide them through the process of
creating an app utilizing tools and frameworks that have been taught
over the course of their specific track.

![example-patterns](https://media.giphy.com/media/4VVZTvTqzRR0BUwNIH/giphy.gif)

[from Wikipedia](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Examples_of_patterns)

## Collaboration

This is a solo project, not a team project. Each person will be expected
to make their own repo and do their own coding.

That said, we _encourage_ cooperation during the Understand, Plan, and
Reflect phases of UPER. It's the Execution that everyone will have to do
their own work for.

This doesn't mean you can't ask for help during coding. Definitely feel
free to reach out. But there won't be any pair programming or splitting
the project into different chunks for different people.

## Clone this repo?

Or start from scratch?

Recommend starting from scratch. That way you'll have a clean commit
history and won't have to worry about merging changes from this
informational repo in yours.

## Objectives

* Student should be able to create a unique, high-quality project that
can be added to a professional portfolio
* [Student should be able to describe the rules of Conway’s “Game of
Life”](objectives/rules-game-life)
* [Student should be able to explain what cellular automata are and
describe how they are useful in real
life](objectives/explain-describe-ca)
* [Student should be able to correctly analyze the ‘Turing Completeness’
of Conway’s “Game of Life”](objectives/turing-complete)
* Student should be able to implement a visualization of Conway’s “Game
of Life” using technologies related to their specific
track.
* [Student should be able to utilize "double buffering" to implement
the game](objectives/double-buffer)

## MVP Features

### Preliminary Work

* Research Conway’s "Game of Life". Figure out how it works, why it’s
useful, and how the notion of Turing Completeness is related to this
topic.

### Building Your App

#### Visualizing the "Game of Life"

The main entry point of your application should house the visualization
of this cellular automaton. Include necessary components, such as:

* Grid to display cells.
* Cell objects or components that, at a minimum, should have:
* Properties
* current state: (alive, dead), (black, white)
* Clickable/Tappable:
* can be clicked to allow user to setup initial cell configuration
* should NOT be clickable while simulation is running
* Behaviors
* Toggle state functionality: switch between alive & dead either
because user manually toggled cell before starting simulation or
simulation is running and rules of life caused cell to change
state
* An appropriate data structure to hold a grid of cells that is at least
25x25. Go as big as you want.
* Text to display current generation # being displayed
* Utilize a timeout function to build the next generation of cells &
update the display at the chosen time interval
* Button(s) that start & stop the animation
* Button to clear the grid

Write an algorithm that:

* Implements the following basic steps:
* For each cell in the current generation's grid:
1. Examine state of all eight neighbors (it's up to you whether you
want cells to wrap around the grid and consider cells on the
other side or not)
2. Apply rules of life to determine if this cell will change states
3. When main loop completes:
1. Swap current and next grids
2. Repeat until simulation stopped
* Breaks down above steps into appropriate sub-tasks implemented with
helper functions to improve readability
* Uses double buffering to update grid with next generation.
* Does something well-documented with the edge of the grid. (e.g. wrap
around to the far side--most fun!--or assumes all edge cells are
permanently dead.)

### Custom Features

Implement at least 3 of the following features:
## Specifications

* Create a few sample cell configurations that users can load and run
* Add an option that creates a random cell configuration that users can
run
* Add additional cell properties, like color or size, and incorporate
them into your visualization
* Allow users to specify the speed of the simulation
* Provide functionality to manually step through the simulation one
generation at a time, as opposed to animating automatically
* Allow users to change the dimension of the grid being displayed
* Given a specific generation, calculate the configuration of cells at
that point in time, and jump to that state, bypassing animation (i.e.
skip ahead _n_ generations).
* If you have an idea for a custom feature on this list, run it by your
TL or instructor
## TL;DR

#### About
### Development Mode

* On the main entry point of the application, include a separate section
or link to another page or popup that describes the two main rules
(birth & death) of Conway’s Game of Life
To get started developing right away and run the project in Develepment mode, clone this [repository](https://github.com/robertjallen/CS-Build-Week-1)
* install all project dependencies with `npm install`

## Stretch Goals

* Implement 2+ additional custom features, above
* Deploy your app to a hosting service or, for iOS, to TestFlight (or
the App Store!). Web devs can see [more deployment info
here](resources/web/deployment).
* Write a how-to guide or blog post that walks readers through the
work you did to implement your project
* Expand your simulation into the third dimension. Google `3D Conways
Life`. Google for how to do 3D stuff on your platform. Web users might
check out [3D-ThreeJS](https://github.com/LambdaSchool/3D-ThreeJS),
and iOS might look at [SceneKit](https://developer.apple.com/scenekit/).
* Explore alternate algorithms for finding the nth generation, such
as [Hashlife](https://en.wikipedia.org/wiki/Hashlife)

## Sample Wireframe

Example wireframes here. _This is only one possible layout. You can use
any layout you come up with, as long as it completes MVP._

We encourage you to be creative with your presentation and make it your
own.

### Mobile

iOS example, could also inspire mobile web.

![wireframe](resources/ios/game-of-life-iOS-mock-1.png)
![wireframe](resources/ios/game-of-life-iOS-mock-2.png)

### Desktop/Tablet

![wireframe](wireframes/wireframe_1.png)


## Code and Repo Quality

Though this is not currently a requirement, it is a strong suggestion.

### Code

* Make your code look sharp and professional if you think anyone will
see it.
* Comments that say what part of the problem a function or block of
code solves.
* Only comment on what a single line does if that single line is
unclear.
* Blank lines to visually break up logical sections of code, analogous
to paragraph breaks.

### Repo

* Well-organized directories.
* Good file names that let a reader quickly determine which file is
where.
* Good `README.md` files that help the reader with code navigation and
installation.
* What is the project?
* What problem does it solve?
* Exceptional difficulties and solutions, if any.
* TODO list/wishlist. What do you want to add to it if you have more
time?

## Rubric

**Your simulation will receive a 2 when it satisfies the following:**

1. Display includes a text area that shows the current generation of
cells being displayed
2. Display includes a grid of cells, at least 25x25, that can be
toggled to be _alive_ or _dead_
3. Display includes working buttons that start / stop the animation
and clear the grid
4. Algorithm to generate new generations of cells correctly
implemented
5. At least 3 features from ***Custom Features*** section
successfully implemented
6. Application includes a section outlining the rules to Conway's
"Game of Life"

**Your simulation will receive a 3 when it satisfies all of the above
requirements AND implements one of the above stretch goals.**

## Track-Specific Help

Channels for help that's about your specific technologies, if the TLs
and/or instructor doesn't have enough knowledge in that area.

* DS: Your cohort channel
* iOS: #ios_help
* Web: Your cohort channel

## Additional Resources
## Functionality
### Desktop View
Welcome to John Conway's "Game of Life"! This is a computer science
classic from 1970, a program that simulates a _cellular automaton_
(plural _automata_). It has connections to all kinds of different
aspects of computer science and nature.

For various platforms:
![example-patterns](https://media.giphy.com/media/4VVZTvTqzRR0BUwNIH/giphy.gif)

* [Resources](resources/)
Binary file removed github-settings.png
Binary file not shown.
1 change: 1 addition & 0 deletions lines.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9/22
23 changes: 23 additions & 0 deletions my-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
38 changes: 38 additions & 0 deletions my-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"bootstrap": "^4.5.2",
"flocc": "^0.5.5",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3",
"reactstrap": "^8.6.0",
"use-sound": "^1.0.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added my-app/public/favicon.ico
Binary file not shown.
43 changes: 43 additions & 0 deletions my-app/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added my-app/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added my-app/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading