diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-16 21:28:20 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-16 21:28:20 -0300 |
| commit | 6933f99ddb2d7103515d26838496309a807bba26 (patch) | |
| tree | 991c2fe7d4a57957222876e190fa4d16a0fb889c /examples/noc/test/pendulum.script | |
| parent | 82fca5c9f29124f37f6dcd08e73e6999ce44a69d (diff) | |
| download | sketchbook-6933f99ddb2d7103515d26838496309a807bba26.tar.gz sketchbook-6933f99ddb2d7103515d26838496309a807bba26.zip | |
Move standalone sketches into sketchbook examples
Diffstat (limited to 'examples/noc/test/pendulum.script')
| -rw-r--r-- | examples/noc/test/pendulum.script | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/noc/test/pendulum.script b/examples/noc/test/pendulum.script new file mode 100644 index 0000000..244be44 --- /dev/null +++ b/examples/noc/test/pendulum.script @@ -0,0 +1,18 @@ +# Grab the bob where it starts (angle PI/4), drag it out to the left, let go. +down 444 154 +expect dragging true +move 300 120 +move 200 100 +move 160 60 +frames 2 +expect dragging true +# The rod points at the pointer: (160, 60) from the pivot (320, 30). +expect angle -1.3854 ~0.001 +up 160 60 +expect dragging false +# Let go from rest: one step of gravity since. +expect angle_velocity 0.0022 ~0.0001 +# It swings back from the left. +frames 40 +expect angle 0.1588 ~0.001 +screenshot .zig-cache/e2e/pendulum.png |
