I used the JavaScript roguelike-library rot.js by Ondřej Žára. Apart from this I wrote everything myself.