conway.git
5 years agoFix possible bug master
Wincent Colaiuta [Thu, 30 Jun 2016 06:04:33 +0000 (23:04 -0700)] 
Fix possible bug

I was seeing fps go from 60 to 120 after clicking,
suggesting double-scheduling.

5 years agoResume scheduling on interaction
Wincent Colaiuta [Thu, 30 Jun 2016 05:59:53 +0000 (22:59 -0700)] 
Resume scheduling on interaction

Untested. #GreatCommitMessagesOfOurTimes

5 years agoGo faster by clipping to `deadColor`
Wincent Colaiuta [Thu, 30 Jun 2016 05:33:45 +0000 (22:33 -0700)] 
Go faster by clipping to `deadColor`

We were continuing to increment all ever-alive cells (about 9,000 for the
default seed) even once they had completely faded beyond `deadColor` (white).
Now we stop once we hit `deadColor`, which means we paint fewer cells, and we
also stop eventually if the simulation reaches a single state steady state.

5 years agoPrefer strict equality
Wincent Colaiuta [Thu, 30 Jun 2016 05:21:55 +0000 (22:21 -0700)] 
Prefer strict equality

5 years agoInstead of click to paint, click and drag
Wincent Colaiuta [Thu, 30 Jun 2016 05:18:57 +0000 (22:18 -0700)] 
Instead of click to paint, click and drag

5 years agoSuppress unwanted selectability
Wincent Colaiuta [Thu, 30 Jun 2016 05:04:49 +0000 (22:04 -0700)] 
Suppress unwanted selectability

6 years agoAdd ability to click on canvas to spawn new cells
Wincent Colaiuta [Fri, 19 Feb 2016 09:45:32 +0000 (01:45 -0800)] 
Add ability to click on canvas to spawn new cells

6 years agoUse requestAnimationFrame instead of setTimeout
Wincent Colaiuta [Fri, 19 Feb 2016 09:37:06 +0000 (01:37 -0800)] 
Use requestAnimationFrame instead of setTimeout

Ends up being smoother.

8 years agoUse modulo for terseness in wrapping calculation
Wincent Colaiuta [Tue, 2 Jul 2013 22:20:10 +0000 (15:20 -0700)] 
Use modulo for terseness in wrapping calculation

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoUse strict
Wincent Colaiuta [Wed, 8 May 2013 04:59:38 +0000 (21:59 -0700)] 
Use strict

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoAdd fps indicator
Wincent Colaiuta [Wed, 8 May 2013 03:36:19 +0000 (20:36 -0700)] 
Add fps indicator

Updated every half-second, approximately.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoApply minor indentation fix
Wincent Colaiuta [Wed, 8 May 2013 02:54:22 +0000 (19:54 -0700)] 
Apply minor indentation fix

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoMove location of center cell check
Wincent Colaiuta [Wed, 8 May 2013 02:49:59 +0000 (19:49 -0700)] 
Move location of center cell check

For better readability, get this out the way at the top of the loop.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoAdd license and simple README
Wincent Colaiuta [Tue, 7 May 2013 07:08:03 +0000 (00:08 -0700)] 
Add license and simple README

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoMake interval configurable
Wincent Colaiuta [Fri, 3 May 2013 09:58:28 +0000 (02:58 -0700)] 
Make interval configurable

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoAdd UI for controlling seed
Wincent Colaiuta [Fri, 3 May 2013 09:53:16 +0000 (02:53 -0700)] 
Add UI for controlling seed

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoAdd basic control buttons
Wincent Colaiuta [Fri, 3 May 2013 09:06:04 +0000 (02:06 -0700)] 
Add basic control buttons

Some janky hand-coded event handlers here, but they get the job done.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoAdd actual seeding
Wincent Colaiuta [Fri, 3 May 2013 08:46:30 +0000 (01:46 -0700)] 
Add actual seeding

Courtesy of seedrandom.js. Not exposed in the UI yet, so always runs the
same game.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoAdd comments for clarity
Wincent Colaiuta [Fri, 3 May 2013 08:39:03 +0000 (01:39 -0700)] 
Add comments for clarity

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoTweak dying delta, for prettiness
Wincent Colaiuta [Fri, 3 May 2013 08:35:37 +0000 (01:35 -0700)] 
Tweak dying delta, for prettiness

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoFirst cut at fading out dying cells
Wincent Colaiuta [Fri, 3 May 2013 08:28:14 +0000 (01:28 -0700)] 
First cut at fading out dying cells

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoOn hitting edges, wrap around
Wincent Colaiuta [Fri, 3 May 2013 05:27:07 +0000 (22:27 -0700)] 
On hitting edges, wrap around

This is really supposed to happen on an infinite grid. Instead of
pretending that off-grid cells are all dead, wrap around at the edges.

This is a little more complicated, and still not strictly kosher, but
it does avoid some anomalous behaviors at the edges.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoFix seeding
Wincent Colaiuta [Fri, 3 May 2013 05:18:21 +0000 (22:18 -0700)] 
Fix seeding

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoSwitch to 2D array
Wincent Colaiuta [Fri, 3 May 2013 05:11:53 +0000 (22:11 -0700)] 
Switch to 2D array

This makes a lot of the grid access simpler, at the cost of making
initial seeding harder. The pay-off seems worth it, as the simpler logic
will likely reduce bugs (in fact, I think the symmetry bug that I was
seeing before is gone now; although there is a new bug in its place,
which shows the initial state of the grid being initialized not quite as
randomly as I would hope).

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoAdd multiplier
Wincent Colaiuta [Fri, 3 May 2013 04:34:38 +0000 (21:34 -0700)] 
Add multiplier

To make it easier to actually see what's going on.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
9 years agoFirst dumb cut at Conway's Game of Life
Wincent Colaiuta [Fri, 3 May 2013 04:31:36 +0000 (21:31 -0700)] 
First dumb cut at Conway's Game of Life

No seed support yet (would require a custom random number generator).

Signed-off-by: Wincent Colaiuta <win@wincent.com>