Code covered by the BSD License  

Highlights from
MATLAB Hexxagon

4.33333

4.3 | 3 ratings Rate this file 6 Downloads (last 30 days) File Size: 6.58 KB File ID: #18155
image thumbnail

MATLAB Hexxagon

by Per-Anders Ekstrom

 

29 Dec 2007 (Updated 15 May 2009)

Graphical User Interface for playing the Ataxx clone Hexxagon.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

Hexxagon is an abstract strategy board game which involves play by two parties on a hexagonal board. The object of the game is to make your pieces constitute a majority of the pieces on the board at the end of the game, by converting as many of your opponent's pieces as possible.
 
Each player begins with three pieces for the first player and second player respectively. The game starts with the six pieces on the six corners of the board.
 
During their turn players must first select the piece they wish to move, the source, and then select an empty square, the destination, that is either adjacent to, or having a distance of less than three, from the source. Diagonal distances are equivalent to orthogonal distances, i.e. it is legal move to a square who's relative position is two squares away both vertically and horizontally. If the destination is adjacent to the source, a new piece is created on the empty destination square. Otherwise the piece on the source moves to the destination. After the move, all of the opponent player's pieces adjacent to the destination piece are converted to the color of the moving player. Players must move unless no legal move is possible, in which case they must pass.
 
The game ends when all positions of the board have been filled or one of the players has no remaining pieces. The player with the most pieces wins. A draw may occur when the number of squares are even.
 
(text above has been adapted from Wikipedia)
 
Hexxagon has single and double player modes, score tracking and sound effects.
 
Example:
       hexxagon % Start Hexxagon Interface

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
05 Jan 2008 Kevin Hung

Nice game and GUI. But I run into problem with the first screen after typing hexxagon on Matlab command line. I only get 3 blank boxes. I cannot select single user or double user mode. But if I click on the bottom box, then I can start the game with double user mode.

06 Jan 2008 Kevin Hung

I have tried it on R2006b and R2007b.

Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 1)

Java VM Version: Java 1.6.0 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode

14 Mar 2008 Elmar Tarajan

Great Game! Thanks a lot! :)

07 Nov 2008 Husam Aldahiyat

Pretty cool, but the boxes on the menu screen are blank.
I'm on MATLAB 7.4.

Please login to add a comment or rating.
Updates
06 Nov 2008

Updated some bugs noticed with Matlab release 7.6.0 (R2008a)

15 May 2009

Added screen shot.

Tag Activity for this File
Tag Applied By Date/Time
games Per-Anders Ekstrom 22 Oct 2008 09:40:54
hexxagon Per-Anders Ekstrom 22 Oct 2008 09:40:54
attax Per-Anders Ekstrom 22 Oct 2008 09:40:54
board Per-Anders Ekstrom 22 Oct 2008 09:40:54
game Per-Anders Ekstrom 22 Oct 2008 09:40:54
othello Per-Anders Ekstrom 22 Oct 2008 09:40:54
games Cristina McIntire 10 Nov 2008 10:46:54

Contact us at files@mathworks.com