N Towers Puzzle

My very simple version of the Eight Queens Puzzle.

You are now following this Submission

[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

Cite As

ACLNM (2026). N Towers Puzzle (https://www.mathworks.com/matlabcentral/fileexchange/40106-n-towers-puzzle), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Strategy & Logic in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0