xtriangles
==========

A Triangles Widget

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 <bagleyd@tux.org>


  Try resizing the puzzle.  Notice the puzzle resizes to take advantage of
  the "room" available.

  If you were looking for a auto-solver, sorry.

  Keep in mind that the puzzle portion is a widget that can be simply stuck
  in other X programs. (If you find a use for this, let me know).

  Refer to the man page for detailed command line options and instructions
  on how to operate.

  If you want further information on puzzles, I'll be glad :-) to send
  it to you.

MATHEMATICAL STUFF USED IN CONSTRUCTION

  Assuming it is a triangle of i triangles in each row and the
  numbering starts from 1.
    Corner 1-> 1
           2-> i^2-2i+2
           3-> i^2

    Center -> i%3 =>
           0: None
           1: j(j+1)+1 where j=2(i-1)/3
           2: j(j+1)+1 where j=2(i-2)/3+1

    Max_Width -> i units
    Max_Height -> 3^(1/2)i/2 units

    Start -> x= i/2 units
             y=0
             side=UP
             fin=1
             step=1
    Next -> (fin==n) =>
         true: x+= -step/2 units; y+=3^(1/2)/2 units; side=UP;
               step+=2; fin+=step
         default: side=!side; x+=1/2 unit;
               y+= (side==UP)?-3^(1/2)/2:3^(1/2)/2

    Same row? -> (m'==n') where s'=sqrt_trunc(s-1) {k}
    Same trbl? -> (((m-1) - m'*m')/2 == ((n-1) - n'*n')/2)) {i}
    Same tlbr? -> (((m'+1)(m'+1) - m)/2 == ((n'+1)(n'+1) - n)/2) {j}

FOUND A BUG?

  Send bugs reports and fixes to the author. For bugs, please include
  as much information as to their location as possible, since I may not
  be able to duplicate them.
