How would you create a map?

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
You mean something like:


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

?

Just use cout and output the spaces/newlines as needed.
Last edited on
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
is there a way to read it from a .txt file?
Topic archived. No new replies allowed.