Build a Simple Roguelike This challenge is based on one proposed on the usenet group rec.games.roguelike.development a few years ago.  I can't find the original newsgroup post, but you can have a look a the Github repo of solutions.  It was only golfed in a couple of languages and I'd love to see some more!

Objective

The aim is to build a program that presents a top-down view of a dungeon using ascii characters.  There will be an @ sign representing the player that can be moved through the free space in the dungeon (represented by ), though it cannot pass through the walls (represented by #).

The map of the dungeon must look like this:

####  ####
#  #  #  #
#  ####  #
#        #
##      ##
 #      #
 #      #
##      ##
#        #
#  ####  #
#  #  #  #
####  ####


The player must begin at location {2,2}, where {0,0} is the top left-hand corner.

Interface

The user needs to be able to move the player in the four cardinal directions using the arrow keys on the keyboard.

There needs to be some way for the user to exit the program.  It does not need to be a graceful exit (for example, it doesn't matter if an exception is printed).

The map and player need to be drawn before any input has been taken, and the player needs to be updated after each input.

Libraries

Feel free to use established libraries for console input or output, such as Curses.  Just mention in your answer what you are using.

Scoring

This is code golf, shortest code wins!
C, 257 253 222 220

Uses system("cls") instead of curses (use system("clear") for Linux systems) and a clever algorithm to fit the map into an 8-digit number. Non-extended keys end the program, e.g. escape.

EDIT: Now also shows your hero below the map by using a&lt;230 instead of a&lt;132:

    ##
   ####
 ###  ###
 # #  # #
## #  # ##
   ####
  #    #
 ##    ##


Code:

a,p=14,w=11,X,Y;m(I){X=I%w-1,Y=I/w;return 70313263&gt;&gt;(Y&gt;5?w-Y:Y)*5+(X&gt;4?9-X:X)&amp;1;}main(){do{system("cls");a=a&amp;4?1:a&amp;2?-1:a&amp;8?-w:w;p+=!m(p+a)*a;for(a=0;++a&lt;230;)putch(a%w?a-p?m(a)*35:64:10);}while(a=getch()&gt;&gt;7?getch():0);}