Can anyone pls tell how to provide the pac id movement in its direcetion in game as i hv provided the all the possible directions(upward=north,downward=south,right=east,left=west)and printing them for same along with their crossings and end game.
The Output section of the statement tells you what to print for each turn. See also the comment on lines 45 and 46 of your code.
Also, if you want to print other things for debugging purpose, you have to print them to standard error. See also the comment on line 43 of your code. Hence, lines 38 and 39 have to be changed as well. For example, line 38 should be changed to: