Chetan Keni

Chetan Keni

  • NA
  • 1
  • 1.2k

Algorithm for chess

Jan 28 2015 5:29 AM
A chess board is represented with the help of 2D Array (such as [0][0]......[63][63]). The game is going on and one opponent is left with only and only KING (it is not CHECKMATE yet). Write a program which takes current position of KING from the user and tells the all possible moves of the KING according to the position given by the user.
2) You have an old compiler that only understands the following operations:
ADD R1 R2 R3 (add R1 and R2 and result stored in R3)
MOVE R1 R2 (Copy value from R1 to R2)
SUB R1 R2 R3 (sub R1 and R2 and result stored in R3)
COMP R1 R2 R3 (compare R1 and R2 and larger value stored in R3)
Write a prog using these operations to find the max number in an array of numbers stored in the register R1-R10 and store the result in R0