# This is a simple Ruby script to traverse grid elements in a spiral starting from top left