I've been trying to create a roguelike from scratch, and it was going well until I got to character movement. I know how to find the location of the @(player), but I don't know how to replace individual characters of the string. I have been searching for around 30 minutes now, and I still can't find anything that works. Help would be greatly appreciated.
document.onkeydown = function (event) {
switch (event.keyCode) {
case 37:
var characterpos = line3.indexOf("@");
// insert new code here
break;
line3, # . . @ . . #, what I want it to look like after pressing left, # . @ . . . #