# Hexes

OK, probably a 10000000000000th time askes question, but...
What size (width x height) of hexagon suits best for hex-based maps?

• : OK, probably a 10000000000000th time askes question, but...
: What size (width x height) of hexagon suits best for hex-based maps?
:
[blue]
Could you be more specific please.
I don't understand what are you using a map like that for and how do you see a map like that...

[/blue]

• I've never really understood how to program hexes most effectivly. Nevermind outputting them when I try to wrap my head around making a hex board I try using traditional arrays but only allowing 6 directions of movement, North South East West Northwest and Southwest, and when I do that making traditional hex 'shapes' for the playing field seems to waste an awful lot of space.
But then, how do you format the output?
• : I've never really understood how to program hexes most effectivly. Nevermind outputting them when I try to wrap my head around making a hex board I try using traditional arrays but only allowing 6 directions of movement, North South East West Northwest and Southwest, and when I do that making traditional hex 'shapes' for the playing field seems to waste an awful lot of space.
: But then, how do you format the output?
:
[blue]
I did a game once and it required a hex map and it looked something like this:
[code][red][b]
()()()()()()()()()()()()
()()()()()()()()()()()()
()()()()()()()()()()()()
()()()()[green]()[/green]()()()()()()()
()()()[green]()()[/green]()()()()()()()
()()()()()()()()()()()()
()()()()()()()()()()()()
()()()()()()()()()()()()
[/b][/red][/code]
Then I just figured that I can make a Matrix to put the elements like so:
[code]
(1,1)(2,1)(3,1)(4,1)(5,1)
(1,2)(2,2)(3,2)(4,2)(5,2)
(1,3)(2,3)(3,3)(4,3)(5,3)
(1,4)(2,4)(3,4)(4,4)(5,4)
(1,5)(2,5)(3,5)(4,5)(5,5)
(1,6)(2,6)(3,6)(4,6)(5,6)
[/code]
and the matrix being declared like this [green]TYPEDEF[/green] [black]a[5][6][/black].

Then for every odd line an element ( a[i][j] ) has the folowing exits:
[code]
a[i ][j-1]a[i+1][j-1]
a[i-1][j ]a[i ][j ]a[i+1][j ]
a[i ][j+1]a[i+1][j+1]
[/code]
and for every even line:
[code]
a[i-1][j-1]a[i ][j-1]
a[i-1][j ]a[i ][j ]a[i+1][j ]
a[i-1][j+1]a[i ][j+1]
[/code]