N Towers Puzzle
by ACLNM
31 Jan 2013
My very simple version of the Eight Queens Puzzle.
|
Watch this File
|
| File Information |
| Description |
[Indices] = NTowersPuzzle( [entry]);
[Indices Board] = NTowersPuzzle( [entry]);
Input formats:
NTowersPuzzle( [empty] or [invalid] ) => default
NTowersPuzzle( P ) => startposition is (P, P)
NTowersPuzzle( L, C) => startposition is (L, C)
NTowersPuzzle( L, C, N) => startposition is (L, C) on N-by-N board
This is my very limited version of the Eight Queens Puzzle (chess).
It produces a N-number Towers on a N-by-N chess board, ence the name.
The board is considered to be a N-by-N matrix.
The pieces positions are signed by ONEs and the positions without pieces
are signed by ZEROs.
The user is allowed to decide the position of the starting piece.
If not empty or invalid input, the default board size is 8-by-8.
If starting piece position is invalid, it produces random position.
The function itself may return two different arguments:
the first is a vector with the coordinates of the pieces;
the second is the matrix with signed position of the pieces.
It prints the coordinates and the board.
@ ACx // Janeiro 2013
|
| Required Products |
MATLAB
|
| MATLAB release |
MATLAB 7.14 (R2012a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
|
Contact us