diff options
Diffstat (limited to 'examples/noc/test/bin_lattice.script')
| -rw-r--r-- | examples/noc/test/bin_lattice.script | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/noc/test/bin_lattice.script b/examples/noc/test/bin_lattice.script new file mode 100644 index 0000000..e0d03ac --- /dev/null +++ b/examples/noc/test/bin_lattice.script @@ -0,0 +1,32 @@ +# 2000 boids start at random places and gather into flocks. Each looks only +# at the boids binned in its own and the 8 surrounding 40-pixel cells: the +# grid in State holds every boid once, in cell order. A drag adds one boid +# per pointer move while the button is down (mouseDragged). +frames 3 +expect boids.len 2000 +expect grid.start[0] 0 +expect grid.start[144] 2000 +frames 117 +expect clock.count 119 +expect boids.buffer[0].position[0] 87.396 ~0.01 +expect boids.buffer[0].position[1] 160.950 ~0.01 +expect boids.buffer[1999].position[0] 336.283 ~0.01 +# The top-left cell is empty now; boid 207 is the first in cell order. +expect grid.start[1] 0 +expect grid.order[0] 207 +down 100 300 +move 110 300 +move 120 300 +move 130 300 +up 130 300 +expect boids.len 2003 +# The last one was added at (130, 300) and has flown a step since. +expect boids.buffer[2002].position[0] 131.087 ~0.01 +move 200 200 +expect boids.len 2003 +frames 1 +expect grid.start[144] 2003 +# The pointer's 3x3 cells are shaded. +move 300 200 +frames 60 +screenshot .zig-cache/e2e/bin_lattice.png |
