How would you create a map?

Apr 24, 2009 at 10:52pm
So how would I go about creating a simple little map. Maybe output a simple box consiting of @ signs or something. Any help?
Last edited on Apr 24, 2009 at 10:52pm
Apr 24, 2009 at 11:03pm
You mean something like:


**********
* *
* *
* *
* *
**********

?

Just use cout and output the spaces/newlines as needed.
Last edited on Apr 24, 2009 at 11:03pm
Apr 25, 2009 at 3:47am
how bout an array type deal, that you can move around in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
psuedo code

char map [20] [20]
//proceede to set the map up
map [1][1] = @
//ect
int x =10
int y= 10

cout<< [x-4][y-4] through [x+4][y-4]
cout<<[x-4][y-3]... and so on till [x+4][y+4]

looping getchar if n, y++ if s, y-- if e, x++ if w, x-- ///north south east and west
reprint map


very rough draft. gotta watch the out of ranges array locations and such.
Last edited on Apr 25, 2009 at 3:49am
Apr 25, 2009 at 7:54am
is there a way to read it from a .txt file?
Topic archived. No new replies allowed.