3 OBJECTS ARE PLACE IN A 6*6 GRID. The Initial Starting Position of a Man is (0,0). Walk the GRID to find the Objects :
Heres a sample output :
--------------------------
Welcome to THE GRID SEARCH GAME: Walk to Find Objects:
OBJECTS ARE PLACED AT:
Square Object PLaced at(x,y): (5,5)
Circle Object Placed at(x,y): (3,4)
Rectangular Object Placed at(x,y): (2,3)
Starting Position: (0,0)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
northeast
CurrentPosition(x,y): (1,1)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
northeast
CurrentPosition(x,y): (2,2)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
northeast
CurrentPosition(x,y): (3,3)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
northeast
CurrentPosition(x,y): (4,4)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
northeast
CurrentPosition(x,y): (5,5)
Square Object Encountered
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
northeast
CurrentPosition(x,y): (0,0)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
west
CurrentPosition(x,y): (5,0)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
south
CurrentPosition(x,y): (5,5)
Square Object Encountered
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
southwest
CurrentPosition(x,y): (4,4)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
west
CurrentPosition(x,y): (3,4)
Circle Object Encountered
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
west
CurrentPosition(x,y): (2,4)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
south
CurrentPosition(x,y): (2,3)
Rectangular Object Encountered
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
north
CurrentPosition(x,y): (2,4)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
north
CurrentPosition(x,y): (2,5)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
north
CurrentPosition(x,y): (2,0)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
southwest
CurrentPosition(x,y): (1,5)
Enter Direction(North/South/East/West/NorthEast/NorthWest/SouthEast/SouthWest) or 'Done' to End :
done
Done
Tuesday, September 28, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment