This is a ruby gem that will help you make grids in the terminal
requires ruby >= 2.0.0
This gem might change in the future. So it is recomended that you use the bundler method listed below so you and anyone using your program gets the right gem version.
Add the following line to your Gemfile:
gem 'ascii_grid', '~> 0.1.2'
then run this command:
$ bundle install
To installl the latest version of the gem directly to your computer run this command:
$ gem install ascii_grid
First you will need to get the source code. You can do this any way you want. One way is by cloning it from GitHub. You can do so with this command:
$ git clone https://github.com/HArchitect/Ascii_grid.git
Then you need to run these two commands to install it to your computer.
$ gem build ascii_grid.gemspec
$ gem install ./ascii_grid-0.1.2.gem
To use this gem just create an Ascii_grid object and then use the make_grid method
grid = Ascii_grid.new(20, 20, 10, 10)
grid.make_grid(1, 2, 4, -3)
This will output the following grid in the terminal:
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | @ + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
--------------------|--------------------
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + @ + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
+ + + + + + + + + + | + + + + + + + + + +
You can find more info here: http://www.rubydoc.info/gems/ascii_grid/0.1.2/Ascii_grid
Here is the homepage of the gem: https://rubygems.org/gems/ascii_grid