Convert String to Grid

Hey, I am kinda new to ruby... and programing...
Anyway, I had an idea of making an ascii game with ruby for the console.
I found a way to make (and break :P) grids, but can't figure out how to
convert a map file into a grid. The map file has a key included and I
think I can figure out how to parse that but I cannot for the life of me
how to put the map into a grid, for character movement. Anyone know how?

···

--
Posted via http://www.ruby-forum.com/.

Could you show what your map file looks like, and what you would like it to
look like after being processed? (ie what is a grid, an array of arrays?)

···

On Wed, May 4, 2011 at 1:26 PM, Matthew D. <mattjdupree@gmail.com> wrote:

Hey, I am kinda new to ruby... and programing...
Anyway, I had an idea of making an ascii game with ruby for the console.
I found a way to make (and break :P) grids, but can't figure out how to
convert a map file into a grid. The map file has a key included and I
think I can figure out how to parse that but I cannot for the life of me
how to put the map into a grid, for character movement. Anyone know how?

--
Posted via http://www.ruby-forum.com/\.

Matthew D. wrote in post #996640:

Hey, I am kinda new to ruby... and programing...
Anyway, I had an idea of making an ascii game with ruby for the console.
I found a way to make (and break :P) grids, but can't figure out how to
convert a map file into a grid. The map file has a key included and I
think I can figure out how to parse that but I cannot for the life of me
how to put the map into a grid, for character movement. Anyone know how?

I'm not new to ruby, nor to programming. I have no idea what a 'grid'
is, nor what a 'map file' is. Are those universal terms that everyone
under the age of 15 understands?

···

--
Posted via http://www.ruby-forum.com/\.

He's referring to a tile map so he can make a tile map
editor/converter with ruby. Think like glade but for games.

Think Lode Runner from the apple ][ days =)
Or even mario.

Here is an example of a graphical one:
http://images.mapeditor.org/tiled-qt-screenshot-2.png

The idea is once the map is created it can be saved (i.e. multi
dimensional array)

when it's read back in the it builds the grid back on the screen and
act as a complete surface but with the memory footprint of a couple
small sized sprites.

op look into ncurses for your game. If you need help parsing the map
you will need to show us the map file. Just a simple screen example
not the whole file. Also include this "key" you refer to. Seeing you
don't have control over the file where did it come from? What other
program/language created it? Is this homework?

···

~

On Wed, May 4, 2011 at 8:21 PM, 7stud -- <bbxx789_05ss@yahoo.com> wrote:

Matthew D. wrote in post #996640:

Hey, I am kinda new to ruby... and programing...
Anyway, I had an idea of making an ascii game with ruby for the console.
I found a way to make (and break :P) grids, but can't figure out how to
convert a map file into a grid. The map file has a key included and I
think I can figure out how to parse that but I cannot for the life of me
how to put the map into a grid, for character movement. Anyone know how?

I'm not new to ruby, nor to programming. I have no idea what a 'grid'
is, nor what a 'map file' is. Are those universal terms that everyone
under the age of 15 understands?

--
Posted via http://www.ruby-forum.com/\.