diff options
author | sanine <sanine.not@pm.me> | 2023-11-09 16:58:08 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-09 16:58:08 -0600 |
commit | d6c0a0830d6c61ea7c88ab6dff8189904ade4578 (patch) | |
tree | c1dade8ff0db56cb4b86dd156cdb2684340b4238 /src/simulation/lattice_rules.test.js | |
parent | dd1ac16fce099588d1333cba324810299b1029b6 (diff) |
add beehive test
Diffstat (limited to 'src/simulation/lattice_rules.test.js')
-rw-r--r-- | src/simulation/lattice_rules.test.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/simulation/lattice_rules.test.js b/src/simulation/lattice_rules.test.js index 681b721..9a6a344 100644 --- a/src/simulation/lattice_rules.test.js +++ b/src/simulation/lattice_rules.test.js @@ -81,3 +81,20 @@ test("glider", () => { [ D, D, D, D, D, D ], ]); }); + + +test("beehive", () => { + const L = { type: 'active', flags: {} }; + const D = { type: 'empty', flags: {} }; + const lattice = [ + [ D, D, D, D, D, D ], + [ D, D, L, L, D, D ], + [ D, L, D, D, L, D ], + [ D, D, L, L, D, D ], + [ D, D, D, D, D, D ], + ]; + + const world = { lattice, lattice_rules, agents: [], senses: [], actions: [] }; + //expect(world_update(world).lattice).toEqual([ + expect(apply(world_update, 1, world).lattice).toEqual(lattice); +}); |