write an Objective C command line program that runs a puzzle game called slider.
The puzzle consists of an n row ´ m column grid filled with the numbers starting at 1 in
ascending order. Each vertical column in the puzzle is numbered 0 through to m-1 and the
horizontal rows are numbered 0 to n-1.
The program uses two command line arguments. The first argument is the number of rows
and the second is the number of columns. For example
slider 3 4
will produce the following output
m : print this menu
p : print the puzzle
sX : scramble puzzle. X is the puzzle seed
rX : shift row X right
cX : shift col X down
x : exit the program
0 | 1 2 3 4
1 | 5 6 7 8
2 | 9 10 11 12
--+-------------
| 0 1 2 3
DETAILS
Starting the program:
The number of columns and rows must each be greater than 0 and less than 10. Failure to
enter correct puzzle size at the command line will result in slider printing a syntax message
about how the program is to be used.
Menu items:
Once the program is running the following menu options are available.
cX where X represents the column number. This will move each number in the column
down one square. The square at the bottom will be moved to the top.
rX where X represents the row number. This will move each number in the row right
one square. The square at the right will be placed in the left most square.
sX This command will randomly scramble the puzzle, using X as a seed to the random
number generator. See details below for scrambling the puzzle.
p Will print the puzzle grid
m will print these instructions
x will exit the program.
Examples of moving rows and columns:
0 | 1 2 3 4
1 | 5 6 7 8
2 | 9 10 11 12
--+-------------
| 0 1 2 3
Enter command => r1
0 | 1 2 3 4
1 | 8 5 6 7
2 | 9 10 11 12
--+-------------
| 0 1 2 3
Enter command => c2
0 | 1 2 11 4
1 | 8 5 3 7
2 | 9 10 6 12
--+-------------
| 0 1 2 3