I am working on sound labyrinth game. My game is about a person getting trapped in the basement and the only way to navigate and get out is through sound. I have created a map over the basement and for each square there has to be a sound. ![Overview of the basement with each square representing a sound](https://i.stack.imgur.com/RqQWu.jpg)

The player starts in b5 with an intro sound and then has to move forward using the arrow keys. I've created this bit of code that plays a sound when forward arrow (`keycode === 38`) is pressed:

```
var thriller=new Audio("thriller.mp3");

document.addEventListener('keydown',
function (background) {
    if (background.keyCode === 38){
        thriller.play();
    }
}, false);

```

My question is:

* How does the code know in which square the player is situated? Is there some smart way in which I can systematize the squares and the sounds they represent?