Problem with my building function for my roguelike

This is a discussion on Problem with my building function for my roguelike within the Game Programming forums, part of the General Programming Boards category; Hi all,
as some might know i have been working on a simple roguelike to get better in programming. I ...

Problem with my building function for my roguelike

Hi all,

as some might know i have been working on a simple roguelike to get better in programming. I am trying to get a function working that will allow a Player to build walls in a dungeon if there isn't allready a wall there.

as some might know i have been working on a simple roguelike to get better in programming. I am trying to get a function working that will allow a Player to build walls in a dungeon if there isn't allready a wall there.

That may be the only compile-related problem but there are other problems in that code. It looks like there are many magic numbers and subtractions going on that obfuscate and confuse the very simple idea of checking an array element for a specific value and then performing logic based on the result. You need to look into removing all the magic numbers and fine tune (read: polish) that code.