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 (7)
o1 = new stzGrid([6, 4]) ? @@( o1.SizeXT() ) o1.MoveToNthNextNode(5) ? @@(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 11_testing_hitting_the_right_boundary.ring(opens in a new tab)
o1 = new stzGrid([6, 4]) ? @@( o1.SizeXT() ) ? @@(o1.Position()) o1.MoveForwardNNodes(3) ? @@(o1.Position()) o1.MoveBackwardNNodes(2) ? @@(o1.Position())
[ 6, 4 ] [ 1, 1 ] [ 4, 1 ] [ 2, 1 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 10_testing_multi-node_movement.ring(opens in a new tab)
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([6, 4]) ? @@( o1.SizeXT() ) o1.MoveDownNNodes(2) ? @@(o1.Position()) o1.MoveRightNNodes(3) ? @@(o1.Position()) ? @@(o1.NthNodeUp(2)) o1.MoveUpNNodes(2) ? @@(o1.Position())
[ 6, 4 ] [ 1, 3 ] [ 4, 3 ] [ 4, 1 ] [ 4, 1 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 12_testing_direction-specific_movements.ring(opens in a new tab)
o1 = new stzGrid([6, 4]) ? @@( o1.SizeXT() ) o1.MoveLeftNNodes(1) ? @@(o1.Position()) o1.MoveUpNNodes(1) ? @@(o1.Position()) o1.MoveToNode(6, 4) ? @@(o1.Position()) o1.MoveRightNNodes(1) ? @@(o1.Position()) o1.MoveDownNNodes(1) ? @@(o1.Position())
[ 6, 4 ] [ 1, 1 ] [ 1, 1 ] [ 6, 4 ] [ 6, 4 ] [ 6, 4 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 14_testing_boundary_cases_and_error_handling.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)
o1 = new stzGrid([6, 4]) ? @@( o1.SizeXT() ) o1.MoveToNode(3, 2) o1.SetDirection(:Forward) ? @@(o1.Position()) ? o1.Direction() ? @@(o1.NextNthNode(2)) ? @@(o1.PreviousNthNode(2)) o1.MoveToNextNthNode(2) ? @@(o1.Position()) o1.SetDirection(:Down) ? @@(o1.NextNthNode(1))
[ 6, 4 ] [ 3, 2 ] forward [ 5, 2 ] [ 3, 2 ] [ 5, 2 ] [ 5, 3 ]
run on 2026-10-02 04:22 inside the library at commit 0e72e2e2c; taken from 13_testing_nextprevious_nth_node_methods.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.MoveBackwardNNodes · stzGrid.MoveDownNNodes · stzGrid.MoveForwardNNodes · stzGrid.MoveLeft · stzGrid.MoveLeftNNodes · stzGrid.MoveRight · stzGrid.MoveRightNNodes · stzGrid.MoveToNextNthNode · stzGrid.MoveToNextPosition · stzGrid.MoveToNode · stzGrid.MoveToNthNextNode

