kalyani
BAN USER- 0of 0 votes
AnswersProblem : Move the chess piece "KNIGHT" from any location on a
- kalyani in India
"3 x 3" Chess Board and make it go to the far right
hand bottom corner^. Chess Board in the problem is
not the usual Chess Board of 8 x 8.
KNIGHT starting position may be any position on board
Program should exit when knight moves to 3 x 3 corner.
Here is how my Chess board looks.
1 2 3
-------------------------
| | | |
1 | | | |
| | | |
-------------------------
| | | |
2 | | | |
| | | |
-------------------------
| | | |
3 | | | X | <<<<------- KNIGHT should reach
| | | | this square.
-------------------------
Remember: KNIGHT moves in specific way such as 2 steps in
one direction and 1 step left/right.
If the KNIGHT starts are position (2,2) then it cannot move further and
you have to throw exception with some error message.
We are not interested in any UI programming.
Run command: "java <some class> x y", where x is x-coordinate
and y is y-coordinate(starting position of Knight)
on the chess board. For this problem x & y could be
1(min) and 3(max) values and any value(2) in between.| Report Duplicate | Flag | PURGE
Software Engineer / Developer Java