Be the first to rate this file! 4 Downloads (last 30 days) File Size: 2.01 KB File ID: #40106
image thumbnail

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
board, boardgame, caxaria, chess, eight queens puzzle, game, instituto superior tcnico, ist, towers
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us