Basic examples (2)
o1 = new stzGrid([3, 2]) o1.MoveTo(1, 1) o1.MoveLeft() # Won't move and stays on same position ? @@( o1.Position() )
[ 1, 1 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 08_position.ring(opens in a new tab)
o1 = new stzGrid([6, 4]) ? @@( o1.SizeXT() ) o1.MoveTo(6, 1) ? @@(o1.Position()) o1.MoveRight() ? @@(o1.Position())
[ 6, 4 ] [ 6, 1 ] [ 6, 1 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 02_testing_hitting_the_right_boundary.ring(opens in a new tab)
Scope (2)
o1 = new stzGrid([3, 2]) o1.MoveTo(3, 1) ? @@( o1.Position() ) o1.MoveRight() # Won't move and stays on last node ? @@( o1.Position() ) o1.MoveUp() # Idem ? @@( o1.Position() )
[ 3, 1 ] [ 3, 1 ] [ 3, 1 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 07_position.ring(opens in a new tab)
o1 = new stzGrid([4, 4]) o1.MoveTo(2, 2) ? o1.Direction() o1.SetDirection(:down) ? o1.Direction() o1.MoveToNextPosition() ? @@( o1.Position() ) o1.MoveToPreviousPosition() ? @@( o1.Position() ) o1.SetDirection(:right) o1.MoveToNextPosition() ? @@( o1.Position() )
forward down [ 2, 3 ] [ 2, 2 ] [ 3, 2 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 09_testing_direction_changes_and_movement_combination.ring(opens in a new tab)
The extensions of this method
Each extension, and whether it exists for this method; an extension that exists combines with the others (FindSTCS).
Every example is a test file of the library, run inside the library for this page; only those whose output kept every promise their file wrote are shown.
See also
- The class stzGrid
- The area's reference: Collections & objects
- The other methods in these examples: stzGrid.Direction · stzGrid.MoveLeft · stzGrid.MoveRight · stzGrid.MoveToNextPosition · stzGrid.MoveToPreviousPosition · stzGrid.MoveUp · stzGrid.Position · stzGrid.SetDirection · stzGrid.Size

