diff options
Diffstat (limited to 'js/baba-yaga/scratch/baba/test_io_print.baba')
-rw-r--r-- | js/baba-yaga/scratch/baba/test_io_print.baba | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/baba-yaga/scratch/baba/test_io_print.baba b/js/baba-yaga/scratch/baba/test_io_print.baba new file mode 100644 index 0000000..4623089 --- /dev/null +++ b/js/baba-yaga/scratch/baba/test_io_print.baba @@ -0,0 +1,34 @@ +// Test the new io.print functionality + +// Simple grid for testing +testGrid : [ + [1, 0, 1], + [0, 1, 0], + [1, 0, 1] +]; + +// Test basic grid printing +io.print "Testing io.print with automatic grid detection:"; +io.print testGrid; + +io.print ""; +io.print "Testing explicit grid format:"; +io.print "grid" testGrid; + +io.print ""; +io.print "Testing regular data:"; +io.print "Number" 42; +io.print "String" "Hello World"; + +// Test with a larger grid (like from Game of Life) +glider : [ + [0, 1, 0, 0, 0], + [0, 0, 1, 0, 0], + [1, 1, 1, 0, 0], + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 0] +]; + +io.print ""; +io.print "Conway's Game of Life - Glider Pattern:"; +io.print glider; |