Skip to content

Commit

Permalink
add state viz
Browse files Browse the repository at this point in the history
  • Loading branch information
DiesIrae committed Mar 3, 2019
1 parent 03cb1ea commit c9068a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/life/life.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const getCellNextState = (x, y) => {
return getNextStateFromContext(state, neighboursStates)
}

// Beacon for state-viz: BEGIN COPY

const getCell = (x, y, initial, isNext) => {
const cellPrefix = isNext ? "nextCell" : "cell"
const id = `${cellPrefix}_${x}_${y}`
Expand Down Expand Up @@ -136,6 +138,8 @@ const lifeMachine = Machine({
},
})

// Beacon for state-viz: END COPY

console.time("computation")
const life = interpret(lifeMachine).onTransition((state, event) => {
//console.log(state)
Expand Down

0 comments on commit c9068a7

Please sign in to comment.