mardi 12 janvier 2021

a program that places the numbers from 0 to 24 on a 5x5 table according to the rules given below? [closed]

Implement your java program using methods. Display all possible correct placements of your numbers in your program.

 All of the numbers from 0 to 24 have been placed successfully on the board.  Numbers must be placed in sequential order starting from 0.

 After placing a number, if there is an empty cell, the next number can be placed in the same column or row after 2 cells or in a diagonal after 1 cell. For example;

After the number 0 is placed randomly in the table, there are 3 possible cells for number 1. The number 1 can be placed two units to the right or two units down or one unit diagonally.

After the number 1 is placed in the table, the number 2 can be placed two units down or 1 unit diagonally.

After the number 2 is placed in the table, the number 3 can be placed two units to the right or 1 unit diagonally.

After the number 3 is placed in the table, the number 4 can be placed 1 unit diagonally.

After the number 4 is placed in the table, the number 5 can be placed two units down or 1 unit diagonally.

The number placement game will be completed by placing all the numbers in the empty cells correctly.




Aucun commentaire:

Enregistrer un commentaire