xpuzzles ======== A collection of puzzles. Web: http://www.tux.org/~bagleyd/puzzles.html Download: Primary site: ftp://ftp.tux.org/pub/tux/bagleyd/xpuzzles Secondary site: ftp://ibiblio.org/pub/Linux/games/strategy Maintainer: David A. Bagley To configure, build, and install in /usr/local/bin make -f xpuzzles.Makefile configure make -f xpuzzles.Makefile # Motif version built by default make -f xpuzzles.Makefile run # this cycles through all make -f xpuzzles.Makefile install # if you like them # Any problems please consult the individual README's and let the author know. # xdial and xthreed are more or less demos and are not built by default. SLIDING BLOCK PUZZLES fixed starting position to set record xcubes: expanded 15 puzzle, auto-solves mxnx1 where m & n >= 4 xtriangles: easier than 15 puzzle xhexagons: 2 modes: one ridiculously easy, one harder than 15 puzzle xpanex: 2 modes: hanoi and Panex(tm), auto-solves for all ROTATIONAL 3D PUZZLES hold down control key to move whole puzzle letters that represent colors can be changed in mono-mode random starting position to set record xrubik: a lxmxn Erno Rubik's Cube(tm) (or Magic Cube) auto-solves 2x2x2 and 3x3x3 (non-orient mode) xpyraminx: a nxnxn Uwe Meffert's Pyraminx(tm) (and Senior Pyraminx), a tetrahedron with Period 2, Period 3, and Combined cut modes and it also has a sticky mode to simulate a Halpern's Tetrahedron or a Pyraminx Tetrahedron auto-solves in Period 3 for 2x2x2 and 3x3x3. xoct: a nxnxn Uwe Meffert's Magic Octahedron (or Star Puzzler) and Trajber's Octahedron with Period 3, Period 4, and Combined cut modes and it also includes a sticky mode xskewb: a Meffert's Skewb (or Pyraminx Cube), a cube with diagonal cuts, each face is cut to have a diamond shape xdino: a Triangle - 4 Cube - Dinosaur, (or Triangle - 4 Cube - 6 Colors) a cube with different diagonal cuts, each face is cut to have a "X" shape with Period 3 corner turning, Period 2 edge turning (Bosch's Cube), and Combined modes xmball: a variable cut Masterball(tm), variable number of latitudinal and longitudinal cuts on a sphere, where the longitudinal cuts permit only 180 degree turns COMBINATION ROTATIONAL AND SLIDING 3D PUZZLES hold down shift key to move whole puzzle letters that represent colors can be changed in mono-mode xbarrel: a Billion Barrel(tm) xmlink: a nxm Erno Rubik's Missing Link(tm), auto-solves 4x4 EXTRA STUFF (just for fun) xthreed: a primitive 3D viewer xdial: a configurable primitive dial Other neat X puzzles on the net: "puzzle" (X). "magiccube" (Motif) - can actually see the cube rotate in 3D space. "affenspiel" (X) - a sliding block monkey puzzle at sunsite.unc.edu /pub/Linux/games/x11/strategy Other OS's besides UNIX: Runs on VMS with X-Windows and also on MS Windows. Java ports of all puzzles available at author's web site. Some known problems and things to do: xtriangles: clean up lines from slide, more scalable using numSlides. xtriangles: variable sides... it would be a hexagon then. xrubik: better frame for 3D. xtriangles, xhexagons: double buffering. The 3D puzzles should use more realistic 3D drawing techniques. xrubik, xskewb, xdino: junk 3D interface when done with OpenGL. xrubik, xskewb, xdino: mouse interface for GL, 3 ways to proceed 1. Use a OpenGL library, anything portable out there? 2. Find faces mouse is on, similar to xthreed 3. Approximate face by using 3d code xskewb, xdino: see actual twisting in OpenGL. xcubes, xrubik, xpyraminx, xpanex, xmlink: currently these are the only puzzles in this collection with some auto-solve capability. xmlink: initial ordering like cubes? xrubik: auto-solve for 4x4x4. xrubik should handle the standard notation for 3x3x3, etc. This notation seems incompatible with the lxmxn cube. I should also provide a hook to do conversions between notations for all puzzles. If colors are made equivalent the program may not detect that it is solved. Updates to xpuzzles: [Jul 21, 2008] V7.4.1: Strange character at end of help title removed. pyraminx: Fixed a possible timing auto-solve problem. [Jul 11, 2008] V7.4: Leading function names in lowercase. panex: Fixed background color problem. pyraminx: Fixed turning bug when selecting face 2 then face 1 when horizontal. rubik, skewb, dino: Extra callback was causing 2d to go out of sync. rubik: Mouse release sometimes was using wrong face. [Feb 29, 2008] V7.3.4: Not released Changed pointer from crosshair to hand2. [Dec 24, 2007] V7.3.3: Constants changed. Windows error fix for cubes, hexagons, mlink, rubik when changing size. Added 3D look to frame for cubes, triangles, hexagons, panex. rubik bug found when changing size while GL puzzle rotating. rubik randomizes to a maximum of 100 moves. [Nov 06, 2007] V7.3.2: Fixed drawing errors on mlink and barrel rotation. barrel: 1B had and extra move in solution. Updated action codes and sync'd Java and C code. Various small changes. [Apr 10, 2007] V7.3.1: Sound added for mball, pyraminx, oct, dino, skewb, rubik. barrel: Auto-solve. barrel: Fixes for get and write. mlink: Fix for get. [Feb 23, 2007] V7.3: Html no longer corrupted. reverseVideo update. [Jan 08, 2007] V7.2.7: New bump.au sound, db lowered, and bumpdat.au removed, thanks to http://audacity.sourceforge.net to help clean the sound up. [Dec 12, 2006] V7.2.6: Changed default so that practice is true for puzzles that have it: xrubik, xskewb, xdino, xpyraminx, xoct, xmball, xmlink, xbarrel. Now use http://netpbm.sourceforge.net to generate images from xpm. [Nov 09, 2006] V7.2.5: xdino: Fix some orient line OpenGL problems. xdino: Fix Period 2 OpenGL problems. wrubik, wskewb, wdino: Windows OpenGL stuff now ported. wcubes, wmlink, wpanex, wpyraminx, wrubik: Windows version interruptable on auto-solve. xpyraminx, xoct: Drag and drop between adjacent faces. xpyraminx: Fixed minor drawing errors for orient lines. xpyraminx: Fixed bug when changing to Period 2. [Oct 11, 2006] V7.2.4: xrubik, xskewb, xdino: drag and drop between adjacent faces. xdino: OpenGL for xdino added. xskewb, xdino: Orienting faces for OpenGL added. skewb: Control-Alt was not working right for OpenGL. xrubik, xskewb, xdino: added view option for OpenGL, "v". Fixed menu to assure the ok part of queries is handled correctly. (Bug fixed from redo change in xpanex, xmlink, xbarrel, xmball, xpyraminx, xoct, xrubik, xskewb, xdino). [Aug 22, 2006] V7.2.3: cubes: Should now always work for all arrangements. For example, 3x3x3 was wrong. [Jul 21, 2006] V7.2.2: Fixed assorted memory leaks and uninitialized memory access reads. r is now for redo. z is now the character for randomize. triangles: no more fully random positions, a starting position is made by randomly turning puzzle CCW or CW (+-120 degrees). hexagons (corners): shifting them down by 2's work. x=1 and y=n top and bottom pieces are always trapped. There are some positions that are weird... x=1 y=3 and x=2 y=2 in particular and and these cases have to have special handling. x=1 y=3 x=2 y=2 special starting positions X X X X 1 4 3 1 5 4 2 5 2 6 3 7 hexagons (no corners): shifted by 1, actually always solvable from EVERY position, except x=n y=1 this case is easily handled. cubes: Starting position instead of random Tried shifting by one and all reversed but made solutions too trivial. Starting pattern is ordered going down columns. 1 4 7 10 1 2 3 4 2 5 8 11 => 5 6 7 8 3 6 9 X 9 10 11 X Special case of 2x2x1 is handled (or else its solved already). Nx1x1 to be handled also. Some patterns require the last numbers to be swapped in order for the puzzle to be solvable. Does it always work for all arrangements... not sure... [Jun 10, 2006] V7.2.1: xrubik, xskewb, xdino: get fix for Windows. xrubik: undo needed debouncing on own window. Recognize solved when doing undo where practice option exists. xpanex: scan instant and undo at double speed. xpanex: fixed drawing errors. [Apr 01, 2006] V7.2: Made usage string compatible with versions of Motif and screen. More defensive code in case getlogin fails. xpanex: in hanoi mode illegal moves are handled better. xmlink: solve fix for swapping left most middle tiles. [Oct 05, 2005] V7.1.5: scoreFile and userName fixes -version added -score added Common option help for X and X-Motif xhexagons: made corners key "o" to be consistent with alhextris [May 31, 2005] V7.1.4: Separated out compatible components (this was done to clean things up so code can be reused for altris games (tetris, welltris, hextris, & tertris)). [Feb 8, 2005] V7.1.3: xmlink, xbarrel, xcubes, xhexagons, xmball, xpyraminx, xoct, xrubik, xskewb, xdino, xthreed... mouse wheel for Windows now works. xmlink, xbarrel, xpanex Rotating tiles and panex now mouse motion sensitive. Small graphical fixes. xthreed a 3d viewer made slightly less primitive. Mouse can now find a face of polyhedron. [Dec 12, 2004] V7.1.2: Thanks to Debian maintainer Florian Ernst for esound fix and non-motif xrubik fix. xpanex: Speed implemented better and sound added. Fixed bug where changing complexity does not clear cheat flag. Did not easily start over if solved. Animation. xmball man page cleanups. Took out "2" for toggle of sound, only "@" from keyboard. This is to synchronize with Java code. [Sep 29, 2004] V7.1.1: xhexagons animation. xtriangles and xhexagons: Sound, "<" and ">" speed control. xmlink and xbarrel: Better speed control with "<" and ">". xcubes, xmlink, xbarrel: Installation of sound and mandrill files. [Aug 23, 2004] V7.1: Thanks to Debian maintainer Florian Ernst for fixing a compilation problem with X and without Motif. Added font option. xcubes, xmlink, xbarrel: Better double buffering. Picture option added, many ideas including the mandrill were borrowed from X puzzle by Don Bennett, HP Labs. Sound added. Sort of real time using getttimeofday. [Aug 10, 2004] V7.0.2: Menus and help for xthreed. xoct: Thanks to Debian maintainer Florian Ernst for fixing a compilation problem with X and without Motif. [Dec 15, 2003] V7.0.1: Undo fix and CW/CCW swap for xskewb. Mono fix for barrel. Colors on dino corrected. The Hide functionality of the Escape key now iconifies or drops in task bar. Accelerator Keys (F keys and regular keys) in Windows now work. Added help in Windows. Integrated Windows source into xpyraminx, xoct, xrubik, xskewb, xdino. wmlink & wbarrel: Animate rotate ported to Windows. wcubes: Auto-solve now works. wmball: Now avoids using FloodFill in Windows. [Nov 15, 2003] V7.0: xbarrel: New puzzle. xthreed: color pixmap added. xhexagons, xmlink: Fixed message initialization, it got scrunched due to switch initialization. xmlink: added a practice mode. Started integration of winpuz6.5 (Windows 3.1/95) into X source tree. Some older versions used Windows (6.x), Xt/Motif (5.x), Xt (4.x), Motif (3.x), XView (2.x), and SunView (1.x), see individual README files of each package for a more complete listing. xpanex, xpyraminx, and xoct are my favorites. Questions about the above, feel free to ask me... STARTING POSITION Instead of a random starting position make a starting position. Here records will make more sense because it does not involve a lucky random position. May still want to have a randomize.... Ideas follow... not mathematically proven. :) Hexagons (corners): shifting them down by 2's work. see http://www.tux.org/~bagleyd/hexagons.txt Does it always work for normal arrangements... not sure... There are some positions that are weird... x=1 y=n, x=2 y=2 and these cases have to have special handling. Hexagons (no corners): always solvable from EVERY position, except x=n y=1 this case is easily handled. Cubes: For example: 1 2 3 4 5 6 7 8 9 10 11 12 13 15 14 || \/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Note for a 1x4 puzzle this will not work. :) Just shifting them all down by 1 would. How everything is still handled ... not sure. [] 1 2 3 4 | 15 16 17 18 19 5 6 7 8 9 | 20 21 22 23 24 10 11 12 13 14 | 25 26 27 28 29 another possible arrangement (that may work better?) 1 4 7 10 1 2 3 4 2 5 8 11 => 5 6 7 8 3 6 9 9 10 11 If that does not work swapping the last numbers 10 and 11 will. (Another arrangement: a combination of the two ideas) If you want to pursue this I would like to make sure that the puzzle is always solvable first and have a rule for the exceptions, notably permutations of 2x2x1 and nx1x1. Considering a mxnx1... this seems to be true: If m and n are both even then need to switch the last two numbers Else you don't I would suspect its something like for lxmxn all odd ok 1 even ok 2 even needs a swap 3 even ok triangles: A starting position can be made if you turn it CCW (or CW) 120 degrees This works because the puzzle is symmetrical. It would not work for hexagons and cubes since the puzzle is not always symmetrical and in the case of cubes... planar. Size = 3 ^ v 4 7 3 6 1 2 5 || \/ 1 3 2 4 6 v 5 7 ^ The puzzle is ALWAYS solvable from a rotated position