Use four keys 'H', 'K', 'J', 'L' to move the worker to the left,
up, down, right, respectively.
Assume you defined 4 variables
S_LEFT = 1
S_UP = 2
S_DOWN = 3
S_RIGHT = 4
Define a function nextToWorker(map, direction), which will
look up the map and return
the neighbor cell of the worker in that direction. For example, in the
following figure, nextToWorker(S_LEFT) == 'H' and nextToWorker(S_UP) == ' '.
Define a function moveWorker(map, direction).
In your main loop, when the user press the UP key ('K'), and
nextToWorker(S_UP) == ' ',
call moveWorker(map, S_UP) to move the worker (update its position in
the map) and re-draw.
Handle S_DOWN, S_LEFT and S_RIGHT similarly.
Define a function error_message(msg) to
warn the player if it is not a legal move.
You may want the computer to generate audio signals to warn
the user.
In Python, it is simple to generate an alert beep by