5.0

5.0 | 1 rating Rate this file 7 Downloads (last 30 days) File Size: 3.78 KB File ID: #1941
image thumbnail

Fifteens

by

 

11 Jul 2002 (Updated )

Goal is to arrange 15 numbered squares in the 4x4 field.

| Watch this File

File Information
Description

Want to relax sometimes when working with MATLAB? Here I post an example of a game, invoked from the MATLAB environment to be played by pushing GUI buttons in a figure window. The game is very simple (looking) but not so easy to accomplish the goal. The purpose is to arrange 15 numbered squares in the 4*4 field (so that only one space is available) in the numbering order: 1,2,3,...,15. Only the squares adjacent to the empty space can be moved to this space at each step (by pressing their buttons).

Originally it is played with 15 plastic (or wooden) chips in a box, not the computer buttons. It is one one of the best simple games I know, much simpler to learn than anything else but still requires some thinking to do . (guess I was not smart enough to be a good chess player...). I used to play it as a kid (we called it "pyatnashki", means "fifteens" in Russian). I have no idea where it originally came from and how popular it was in other countries.

MATLAB release MATLAB 5.3 (R11)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
16 Nov 2012 tudor dima

oldies by goldies ... thanks!
And pretty impressive for 10 year-old code, all I had to do in order to make it run in 2010b was to edit line 27 from:
if fnd~=[]
to:
if ~isempty(fnd)

The plastic "perspico" was a huge hit in Romania when I was a kid. Numbers came in two colours (blue/red for odd/even) and on the back it had 6 (or maybe 9?) different output solutions to reach. (the normal 1-15 was called "horizontal", then "vertical", "spiral", "random" (a jumble everyone avoided), "total 30" and "impossible" which was 15:-1:1 , of course unreachable due to its opposite parity.
Thanks, this made my day :-)

Contact us