Skip to main content
deleted 27 characters in body; edited title
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237

Knight moves in chessChess game

I am trying to learn JavaJava by doing some (easy) ACM ICPC problems. The problem consist to check if the knight in a chess game can move from a point A(r1, c1)A(r1, c1) to B(r2, c2)B(r2, c2) with one move only. Here the code I wrote:

inputInput:

Output:

Where the first number is n, the number of block in the chessChess board (in the normal chessChess board n=8n = 8).

I'm looking for a review in terms of best practices, things things I should or shouldn't do, or or things I should do in another way.

Knight moves in chess game

I am trying to learn Java by doing some (easy) ACM ICPC problems. The problem consist to check if the knight in a chess game can move from a point A(r1, c1) to B(r2, c2) with one move only. Here the code I wrote:

input:

Output

Where the first number is n, the number of block in the chess board (in the normal chess board n=8).

I'm looking for a review in terms of best practices, things I should or shouldn't do, or things I should do in another way.

Knight moves in Chess game

I am trying to learn Java by doing some (easy) ACM ICPC problems. The problem consist to check if the knight in a chess game can move from a point A(r1, c1) to B(r2, c2) with one move only.

Input:

Output:

Where the first number is n, the number of block in the Chess board (in the normal Chess board n = 8).

I'm looking for a review in terms of best practices, things I should or shouldn't do, or things I should do in another way.

Tweeted twitter.com/#!/StackCodeReview/status/647797856645087232
Added info about input from comments.
Source Link
RubberDuck
  • 30.9k
  • 6
  • 71
  • 174

Where the first number is n, the number of block in the chess board (in the normal chess board n=8).

I'm looking for a review in terms of best practices, things I should or shouldn't do, or things I should do in another way.

I'm looking for a review in terms of best practices, things I should or shouldn't do, or things I should do in another way.

Where the first number is n, the number of block in the chess board (in the normal chess board n=8).

I'm looking for a review in terms of best practices, things I should or shouldn't do, or things I should do in another way.

added 125 characters in body
Source Link
janos
  • 111.7k
  • 15
  • 152
  • 391

I'm looking for a review in terms of best practices, things I should or shouldn't do, or things I should do in another way.

I'm looking for a review in terms of best practices, things I should or shouldn't do, or things I should do in another way.

Source Link
Chaker
  • 265
  • 1
  • 3
  • 7
Loading