its really weird if you look in the code it should display a | in the corner of
the screen but it doesn't and if you move left twice (hit "a" then enter then repeat)it shows 2 of them one in a correct position one not if you go up from the spawn position (hit "w" then enter) it is in a correct position if you go over once it displays it in the correct position.
They may not be the problem but they are bad to use. same with system("anything") and if the problem occurs with 'a' it is probably something to do with line 123. And to be honest it looks like your a and d are backwards shouldnt a go to the left and d go to the right? and try using x++, x--, y++, y--, or even x += 1, x -= 1, y += 1, y -= 1 instead of the x = x + 1, ect....
well other than the problem I said it works so...
its not with the a just the array you should compile it and try to do what I said in it because it is really weird and I honestly cant find the source of the problem