A22.0002 - ASSIGNMENT 5


You are part of a team that is developing a new video game and you have been assigned the task to write the part that computes the new cursor position on the screen and prints a specific symbol. Your procedure will also detect errors (illegal moves and illegal input) and report the number of errors.

Specs : (i.e., what your procedure should and should not do)


Example run:

   Test-run of CursorMovement. Enter series of commands ending in $

   ddrrld+ddul>rrru#lllll|$

                                                                                   
                                                                                   
                                                                                   
    +                                                                              
    >|  
    
   There where 3 errors


Notes :

CursorMovement will keep on fetching characters until it reaches the end command ($). You will need to keep two counters, the horizontal offset and the vertical offset; which you will update depending on the command you just received. If the command is a printable symbol, verify that the counters have a legal value, then either print the symbol or update the error count.