Project Puzzles Notes


Title: PUZZLES
Author: David A. Bagley, bagleyd AT verizon.net
Copyright: BSD
Description: Sliding block and rotational puzzles

Contents

Things To Do...
JavaScript - Latest Tweaks...
Java - Latest Tweaks...
Java - Older Releases
X and Windows - Latest Tweaks...
X and Windows - Older Releases

Things To Do...

  1. Panex: add features to new Android App version. Current major problem is that the animation did not port from applet/application to Android. Also undo here is not working.
  2. cubes: auto-solve only works when sizeX>=4, sizeY>=4, and sizeZ=1
  3. triangles, hexagons: these puzzles have no auto-solve capability.
  4. triangles, hexagons: double buffering.
  5. triangles: clean up lines from slide, more scalable using numSlides.
  6. triangles: variable sides... it would be a hexagon then.
  7. mlink: auto-solve only works when tiles=4 and faces=4
  8. mlink: initial ordering like cubes?
  9. barrel: auto-solve for orient mode
  10. panex: auto-solve only solves from beginning
  11. 3D puzzles: If colors are made equivalent the program may not detect that it is solved.
  12. rubik: auto-solve only works when size (ie the number of cubes) on the sides are all the same and the size is either 2 or 3; a 4x4x4 solver needed.
  13. rubik: 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.
  14. dino: auto-solve only works when it has period 3 movement
  15. pyraminx: auto-solve only works when the size is 2 or 3 and has period 3 movement
  16. oct: auto-solve only works when the size is 2 or 3 and has period 4 movement
  17. mball: auto-solve only works it has wedges <= 8 _or_ 1 band, so solves for Saturn Puzzle, Hockey Puck Puzzle, and Masterball. It would be nice to solve for all wedges and bands.
  18. mball: should use more realistic 3D drawing techniques.

X Things To Do...

  1. xtriangles, xhexagons: double buffering.
  2. pyraminx, oct, mball: should use more realistic 3D drawing techniques.

JavaScript - Latest Tweaks...

  8.0.3:
    Animated Cubes, Triangles, Hexagons, Panex.
  8.0.0:
    Implemented Cubes, Triangles, Hexagons, Panex.

Android - Latest Tweaks...

  8.0.4:
    Old website http://www.tux.org/~bagleyd died, shifted code base to
      new website http://www.sillycycle.com
  8.0.3:
    Android Lollipop 5.0 fix to turn off hardware acceleration or would
      crash with Sig 11.
  8.0.0:
    Panex: Android App version.

Java - Latest Tweaks...

  8.0.5:
    Old website http://www.tux.org/~bagleyd died, shifted code base to
      new website http://www.sillycycle.com
  8.0.4:
    Fixed panex write.
    Fixed cubes to show only x>=y>=z so there is some uniqueness in puzzle
     complexity and starting position.
  7.7.5:
    Applet: added handling when writing score so does not crash if fails.
    Separate util directory.
  7.7.4:
    Synchronized save and restore with C version.
    Rotating puzzles had bug in restoring saved position.
  7.7.3:
    Reorganized icons directory.
  7.7.1:
    Dialogs now use swing.
  7.7.0:
    Puzzle canvas now has default focus when applet comes up.
    Puzzle control up now makes bigger and down makes smaller
      (synchronized with slider) for cubes, hexagons, mlink.
  7.6.6:
    Took out JPopup and put in JMenu stuff from application.  Would have
      done before but did not realize Applet needs to be JApplet for this
      to work.
    Added border for htmls thanks to
      http://www.squidoo.com/html-backgrounds-
    Added Attach/Detach thanks to code snippet Code Ranch and JavaKB by
      Brian Pipa.
    Also found something in stackoverflow from Alex for resizing JFrame.
    Fixed error on several applets where it would not display "PRACTICE"
      in record when initially in practice mode.
    Fixed error on a few applets where the word "PRACTICE" would be cut.
    Now have sound initialization only run on first try to make a sound as
      I found sound initialization hangs on one of my systems.
  7.6.5:
    Added Puzzle Buffer that buffers to screen.
  7.6.4:
    Changed key mappings g->r for read file, r->e for redo.
  7.6.3:
    Added -perspective to make front most wedges bigger in mball.  Not sure
      I like it general, so made it an option, off by default.  This does
      not change any functionality.
    Added extra keys F12 for CW and F11 for CCW for mball, oct, pyraminx,
      rubik, skewb, dino and F12 for in and F11 for out for cubes.
    Added auto-solve capability for mball with 2, 4, or 6 wedges.
  7.6.2:
    Fixed all puzzles with auto-solve.  If randomizing and hit solve,
      auto-solve would get confused.
    Auto-solve for oriented mball with only 1 band.  12 wedges simulates a
      Hockey Puck puzzle (solution for 12 wedges taken from
      http://www.jaapsch.net/puzzles/puck.html ).  Wrote a quick program
      to help find moves for a 10 wedge version (included with distribution
      as puck.c).
  7.6.1:
    Added auto-solve capability for mball with 8 wedges.  This includes
      if the wedges are oriented.  If bands are reduced to 1, it can
      simulate the Saturn Puzzle.
    Changed orientation and terminology from ring to band to be consistent
      with wsd page for mball.
    Defaults to flip if there if it is ambiguous to turn or flip on a
      "point and click" move in mball, this makes it easier to simulate a
       Saturn puzzle.  Use shift key to do a turn here instead.
  7.6:
    Added auto-solve capability for oct (period 4).
  7.5.6:
    Added auto-solve capability for dino (period 3).
  7.5.5:
    Fixed a way of cheating by switching windows or scanning in entry.
    Added auto-solve capability for skewb.
  7.5:
    Cleaned up menu look.

Java - Older releases

  7.4.2:
    Panel info length was trying to be 4 times bigger than it should be.
    panex: new Algorithme mode.  Auto-solve for this now solves in
      minimum number of moves.  Also need to steal jump move (a move from
      stack 1 to stack 3) from cubes puzzle.
    panex: move another tile before tile all the way up, the first tile
      gets stuck, fixed.
    Auto-solve puzzles:
      cheating was possible in all puzzles using undo
      reset puzzle while still causes runtime error but does not keep trying
        to solve puzzle
    All puzzles: delay input parameter added
  7.4:
    Leading function names in lowercase.
    findbugs and pmd changes.
  7.3.4:
    Cursor changed to hand pointer.
    Added javadoc info.
  7.3.3:
    Constants changed.
    Added 3D look to frame for cubes, triangles, hexagons, panex.
    gcj warning cleanups.
  7.3.2:
    Updated action codes and synchronized Java and C code.
    Fixed drawing errors on Mlink and Barrel rotation.
  7.3.1:
    Sound added for mball, pyraminx, oct, dino, skewb, rubik.
    barrel: Auto-solve.
  7.3:
    Pyraminx & Rubik: autosolve & randomize delay.
    Interrupt on auto-solvers.  For Barrel some auto-solve code added
      but it is not usable yet.
    Spawned off a Canvas.java from main java code.
    Better keyboard interface code.
  7.2.7:
    New bump.au sound and db lowered removed, thanks to
      http://audacity.sourceforge.net to help clean the sound up.
  7.2.6:
    Fixed some resizing especially for rubik, skewb, and dino.
    Implemented JavaScript applet quit option.
    Now has left alignment so it will work cleaner with IE.
    Application flashing removed.
    Use generic names in code where possible.
    Changed default so that practice is true for puzzles that have it:
      rubik, skewb, dino, pyraminx, oct, mball, mlink, barrel.
    Now use http://netpbm.sourceforge.net to generate images from xpm.
  7.2.5:
    Cyan lining is back.
    Check for noninteger parameter input.
    pyraminx, oct: drag and drop between adjacent faces.
  7.2.4:
    rubik, skewb, dino: drag and drop between adjacent faces.
  7.2.3:
    cubes: Should now always work for all arrangements.  For example, 3x3x3
      was wrong.
  7.2.2:
    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...
    r is now for redo for all puzzles.  z is now the character for
      randomizing.  For cubes, triangles, and hexagons no records are
      set when randomized.  Panex has no randomizer.
    All puzzles have silver lining and tan background where applicable.
    Whole messageLabel should now be visible.
    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.
    triangles: no more fully random positions, a starting position is
      made by randomly turning puzzle CCW or CW (+-120 degrees).
  7.2.1:
    Rubik, Skewb, and Dino fixes for get in 2D.
    Recognize solved when doing undo where practice option exists.
    Mlink and Barrel fixes for move counter when get used.
    Mlink and Barrel fixes for undo and get/write if mouse drag is used
      for rotation.
    Line feed fixes.
    Cookies more readable.
    panex: scan instant and undo at double speed.
    panex: fixed drawing errors.
    panex: got rid of flashing when moving mouse.
    JavaScript/Cookie code back in.
    Ant build now fully supported.
    Jar files now have a MANIFEST so they can run as an application if
      downloaded.
  7.2:
    AWT to Swing... (I kind of liked AWT... but won over to get Mnemonics
      to look right).
    panex: in hanoi mode illegal moves are handled better
    xmlink: solve fix for swapping left most middle tiles.
    xmlink: solve fix for speed 49 and 50
  7.1.4:
    build.xml
    mlink, barrel, panex
      Rotating tiles and panex now mouse motion sensitive.
      Small graphical fixes.
    mlink, barrel, cubes, hexagons, mball, pyraminx, oct, rubik, skewb,
      dino, threed... mouse wheel if you uncomment it and compile it for
      Java >= 1.4

  7.1.3 and older
    Done Synchronizing Java and X for all puzzles
    Animation for panex
    Synchronizing Java and X for cubes... now has mandrill image.
    Mlink: auto-solver
    Problem telling one to randomize first for an illegal move fixed.
    Holding down undo button problem fixed.
    Barrel arrow bugs fixed.
    Left and Right icons commented out, take up too much valuable room and
      may be confusing.

    Cubes: use image scaling for "dripping" of cubes
    Double buffering for Cubes, Mlink, and Barrel
    Show rotate for Mlink and Barrel
    Sounds added for Mlink and Barrel
    Show sliding on Mlink and Barrel
    Barrel puzzle added
    Mlink cleanups
    Got rid of some deprecations and Xlints, more to do for Java1.5
    Mlink now has a practice option

    Rubik control movement fix for rectangular arrangements.
    Rubik auto-solve for 3x3x3 orient mode
    Rubik about help was messed up
    Esc key to hide
    Practice was left out of frame menu
    No scaling html problems:
      Triangles/Pyraminx/Rubik did not have enough room
    Fix from X
      get screen output
      record store fix
      static bars & font on mball -> dino
    Oct direction fix by keyboard
    Initial conversion from C to Java by Sarat Chandran
      .

X and Windows - Latest Tweaks...

  [Sep 13, 2016]  V8.0.5:
    Old website http://www.tux.org/~bagleyd died, shifted code base to
      new website http://www.sillycycle.com
  [Jan 08, 2016]  V8.0.4:
    Fixed cubes to show only x>=y>=z so there is some uniqueness in puzzle
      complexity and starting position.
  [Feb 24, 2015]  V8.0.0:
    Sound and install fixes.
  [May 19, 2014]  V7.7.5:
    Fix goof in mball.
  [May 13, 2014]  V7.7.4:
    Synchronized save and restore with Java version.
    Fixed synchronizing if resized while reading from saved log for rubik.
  [Jan 20, 2014]  V7.7.3: Not released
    Reorganized pixmap directory.
  [Jan 10, 2013]  V7.7.1:
    Cleaned up some duplication in Motif menu.
    Added scroll to feature help dialog.
    New bold fontlist in resource file, so things are easier to read.
  [Aug 31, 2012]  V7.7.0:
    Puzzle control up now makes bigger and down makes smaller
      for cubes, hexagons, mlink.
  [Oct 22, 2010]  V7.6.4:
    Changed key mappings g->r for read file, r->e for redo.
  [Jun 29, 2010]  V7.6.3:
    Added a work around for strange Windows arc behaviour if arcs end at
      0, 90, 180, or 270 degrees in mball.  Work around was to shift by one
      degree.  Not pretty but definitely prettier.
      https://forums.codegear.com/message.jspa?messageID=118084
    Added -perspective to make front most wedges bigger in mball.  Not sure
      I like it general, so made it an option, off by default.  This does
      not change any functionality.
    Added extra keys F12 for CW and F11 for CCW for mball, oct, pyraminx,
      rubik, skewb, dino and F12 for in and F11 for out for cubes.
    Added auto-solve capability for mball with 2, 4, or 6 wedges.
  [Mar 26, 2010]  V7.6.2:
    Auto-solve for oriented mball with only 1 band.  12 wedges simulates a
      Hockey Puck puzzle (solution for 12 wedges taken from
      http://www.jaapsch.net/puzzles/puck.html ).  Wrote a quick program
      to help find moves for a 10 wedge version (included with Java
      distribution as puck.c).
  [Mar 17, 2010]  V7.6.1:
    Added auto-solve capability for mball with 8 wedges.  This includes
      if the wedges are oriented.  If bands are reduced to 1, it can
      simulate the Saturn Puzzle.
    Changed orientation and terminology from ring to band to be consistent
      with wsd page in mball.
    Defaults to flip if there if it is ambiguous to turn or flip on a
      "point and click" move in mball, this makes it easier to simulate a
      Saturn puzzle.  Use shift key to do a turn here instead.
  [Jan 21, 2010]  V7.6:
    Version handling changed to a single version.h (and man page).
    Sound fixed for esound.
    Added auto-solve capability for oct (period 4).
  [Jan 13, 2010]  V7.5.6:
    Added auto-solve capability for dino (period 3).
    Orient markers fixed for GL in dino.
  [Jan 07, 2010]  V7.5.5:
    Fixed undo and redo for GL when at fastest speed in rubik, skewb, dino.
    Fixed a way of cheating by switching windows in rubik, skewb, dino.
    Fixed a memory corruption in skewb, dino.
    Added auto-solve capability for skewb.
  [Dec 21, 2009]  V7.5.4:
    Map arrow keys for GL for rubik, skewb, dino.
    Fix goof for twisting in OpenGL for skewb.
  [Dec 11, 2009]  V7.5.3:
    Added more delay for GL in rubik, skewb, dino.
    Added variable speed from rubik for randomizer and undo/redo in
      skewb, dino.
    Fixed flash in control draw in skewb, dino.
    Can now see actual twisting in OpenGL in dino.
  [Dec 07, 2009]  V7.5.2:
    Can now see actual twisting in OpenGL in skewb.
  [Nov 10, 2009]  V7.5.1:
    Windows version: added accelerator for references.
    GLU used for GL mouse mapping for rubik, skewb, dino.
      Gutted old 3d representation (except when no OpenGL available).
    Windows fix: changed GL code until no drawing errors, some Windows
      machines needed this for rubik, skewb, dino.
  [Jun 05, 2009]  V7.5:
    Fixed view for Windows not to reset puzzle for rubik, skewb, dino.
    Cleaned up menu look.
    Fixed again for NAS sound.

X and Windows - Older Releases

  [Dec 14, 2008]  V7.4.3:
    Fixed for NAS sound.
  [Nov 15, 2008]  V7.4.2:
    panex: new Algorithme mode.  Auto-solve for this now solves in
      minimum number of moves.  Also need to steal jump move (a move from
      stack 1 to stack 3) from cubes puzzle.
  [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 27, 2007]  V7.3.2:
    Fixed drawing errors on mlink and barrel rotation.
    barrel: 1B had and extra move in solution.
    Updated action codes and synchronized 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
  [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
      interruptible 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, skewb, xdino: drag and drop between adjacent faces.
    xdino: OpenGL for xdino added.
    xskewb and 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, and xdino).
  [Aug 08, 2006]  7.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, skewb, xdino: 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.
    panex: 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 truncated 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.