[comp.sys.handhelds] new puzzle, new blinky

mike@DRD.Com (Mike Rovak) (01/11/91)

Well, here's my first attempt at a game posting.  First, an HP version of
a new sliding tile puzzle.  Second, a version of the CHIP48 game BLINKY
which uses the same control keys as SYZYGY.


This is an HP48SX version of a cute little sliding-piece puzzle I saw last
month.

Object of the game is to reorder the numbered sliding pieces until they
are in numerical order.  This is done by either sliding pieces left around
the track, sliding pieces right around the track, or spinning the little 
flipper which contains 4 consecutive pieces at a time, thus reversing the 
order of the 4 pieces.

Download the game into a directory, go into it, and press PLAY.  Game comes
up with the pieces in numerical order (unless a previous game in progress
was saved).  Note:  Game CLEARs the stack.

Menu options:

    \<-S         \->S       FLIP       MIX         SAVE         QUIT
 shift left   shift right   flip    jumble the   save game    kill game
                                      pieces    in progress

Shift Left
Shift Right

    Take no parameter (assume shift only 1 position), or take a single
real number parameter which represents the number of positions to shift. 
Parameter saves the time of repeated updating of the display, which 
consumes more time than it should.  Any ideas how to speed this up?

Flip

    Rotates the flipper which is represented in the display by the U-shaped
line enclosing 4 pieces.

Mix

    Gives a pseudo-random mix of the pieces by using the legal moves, thus
ensuring that there is indeed a solution.

Save

    Saves the current game position in a list variable called SAVEL.  Rename
this variable to make it more permanent.  If this variable is present when
PLAY is executed, the game it represents will resume and the variable will be
purged.

Quit

    Kills the current game and the junk on the stack the game uses.


As an aside, the variable PIECE is the same as used for the 24-piece puzzle
which was posted earlier.  I moved it up the directory hierarchy to save
memory since I also have the other puzzle, and include it here for 
completeness.


Here be the game:

<------------------------- CUT HERE ---------------------------->
%%HP: T(3)A(D)F(.);
DIR
  PLAY
    \<< STD DEC 64
STWS ERASE CLEAR
      IFERR 'SAVL'
RCL
      THEN CLEAR 1
20
        FOR j j
        NEXT
      ELSE OBJ\->
DROP 'SAVL' PURGE
      END 1 20 UD {
# 37d # 5d } {
# 37d # 13d } LINE
{ # 37d # 13d } {
# 93d # 13d } LINE
{ # 93d # 13d } {
# 93d # 5d } LINE
SH3 3 FREEZE { {
"\<-S" LS } { "S\->" RS
} { "FLIP" FLIP } {
"MIX" MIX } {
"SAVE" SAVE } {
"QUIT" QUIT } }
TMENU
    \>>
  LS
    \<< 'LS2' SH4
    \>>
  RS
    \<< 'RS2' SH4
    \>>
  FLIP
    \<< FL2 FL3
    \>>
  MIX
    \<< 1 100
      START RAND 3
* IP 1 + MX2
      NEXT SH2
    \>>
  SAVE
    \<< 20 \->LIST
'SAVL' STO QUIT
    \>>
  QUIT
    \<< CLEAR 0 MENU
    \>>
  UD
    \<< \-> s f
      \<< s f
        FOR j 21 j
- PICK j DC
        NEXT
      \>>
    \>>
  DC
    \<< \-> c n
      \<< PICT n DC3
c DC2
      \>>
    \>>
  DC2
    \<< \-> c
      \<< PIECE c GET
REPL
      \>>
    \>>
  DC3
    \<< \-> n
      \<< 'L' n GET
      \>>
    \>>
  FL2
    \<< 1 5
      START LS2
      NEXT 4 ROLLD
SWAP ROT 1 5
      START RS2
      NEXT
    \>>
  FL3
    \<< 2 5 UD 3
FREEZE
    \>>
  LS2
    \<< 20 ROLL
    \>>
  RS2
    \<< 20 ROLLD
    \>>
  SH2
    \<< 1 20 UD 3
FREEZE
    \>>
  SH3
    \<< { # 0d # 0d }
PVIEW
    \>>
  SH4
    \<< \-> p
      \<< DEPTH 20
        IF >
        THEN SH3 1
SWAP
          START p
EVAL
          NEXT SH2
        ELSE p EVAL
SH2
        END
      \>>
    \>>
  MX2
    \<< \-> n
      \<<
        CASE 'n==1'
          THEN LS2
          END 'n==2
'
          THEN RS2
          END FL2
        END
      \>>
    \>>
  L { { # 25d # 0d
} { # 39d # 0d } {
# 53d # 0d } {
# 67d # 0d } {
# 81d # 0d } {
# 95d # 0d } {
# 107d # 8d } {
# 119d # 16d } {
# 119d # 29d } {
# 107d # 37d } {
# 95d # 45d } {
# 81d # 45d } {
# 67d # 45d } {
# 53d # 45d } {
# 39d # 45d } {
# 25d # 45d } {
# 13d # 37d } {
# 1d # 29d } { # 1d
# 16d } { # 13d
# 8d } }
  PPAR {
(-6.5,-3.1)
(6.5,3.2) X 0 (0,0)
FUNCTION Y }
  PIECE {
GROB 11 11 FF70306010401340124012401240174010403060FF70
GROB 11 11 FF70306010401740144017401140174010403060FF70
GROB 11 11 FF70306010401740144017401440174010403060FF70
GROB 11 11 FF70306010401540154017401440144010403060FF70
GROB 11 11 FF70306010401740114017401440174010403060FF70
GROB 11 11 FF70306010401640114017401540174010403060FF70
GROB 11 11 FF70306010401740144012401140114010403060FF70
GROB 11 11 FF70306010401740154017401540174010403060FF70
GROB 11 11 FF70306010401740154017401440174010403060FF70
GROB 11 11 FF7030601040D840945094509450D94010403060FF70
GROB 11 11 FF7030601040DC40984098409840DD5010403060FF70
GROB 11 11 FF7030601040DC5090509C509440DD5010403060FF70
GROB 11 11 FF7030601040DC5090509C509050DD5010403060FF70
GROB 11 11 FF7030601040D45094509C509050D15010403060FF70
GROB 11 11 FF7030601040DC5094409C509050DD5010403060FF70
GROB 11 11 FF7030601040D85094409C509450DD5010403060FF70
GROB 11 11 FF7030601040DC50905098409440D54010403060FF70
GROB 11 11 FF7030601040DC5094509C509450DD5010403060FF70
GROB 11 11 FF7030601040DC5094509C509050DD5010403060FF70
GROB 11 11 FF7030601040D9401550D5505450D94010403060FF70
GROB 11 11 FF7030601040DD401940D9405840DD5010403060FF70
GROB 11 11 FF7030601040DD501150DD505440DD5010403060FF70
GROB 11 11 FF7030601040DD501150DD505050DD5010403060FF70
GROB 11 11 FF7030601040D5501550DD505050D15010403060FF70
}
END
<------------------------- CUT HERE ---------------------------->


Here's a blinky (CHIP48 string in uuencoded binary) which uses the same
control keys as SYZYGY, namely, 1=left, 2=right, 9=up, 6=down.  Much easier
to control the game this way.  Be sure to download in BINARY with translation
code 0 (no translation) after uudecoding.  Following it is the ASC\->
string version for those who do not have uudecode.  Download the string in
ASCII, run ASC\-> on it, and feed it to CHIP48.

<------------------------- CUT HERE ---------------------------->
begin 664 blinky
M2%!(4#0X+4$L*A $ 0#@$AI#:'(N($5G96)E<F<@,3$O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 4]F( >_[:M&[SA^*'(0#N@G"#<&XP@N* P('0)L*GU&[P
M@.(P !5FW-1",'T"0@!]_D(@? )"$'S^W-0 [FZ \0<Q !8:@0"#7D\ %92#
MD(/53P 5S#, %;*'XX. @\5/ !8 ,P 5YH?C%AJ#@(/%3P 6 #, %>:'XX.0
M@]5/ !7,,P 5LH?C%AIC0($R00 6&MS4?0+<U(?C;L^'XF(PAR$ [F,0@3)!
M !8:W-1]_MS4A^-NSX?B8@"'(0#N8R"!,D$ %AK<U'P"W-2'XV[/A^)B((<A
M .YC@($R00 6&MS4?/[<U(?C;L^'XF(0AR$ [L'P@!(P !8LA^-N,(?C@N,5
M4-S4@%Y/ !8Z8I!\_A9<@%Y/ !9&8C!] A9<@%Y/ !928J!\ A9<@%Y/ !8B
M8@!]_MS4;D^'XH<A .Z <&X#@.* 7H!>I\3P'MB4CO  [FX J #^'OX>_A[^
M'O-EJA[^'OX>_A[^'O-5?@$^@!9\ .Z"(X,S;@^ (($P)L: XH!>I^#P'M(R
M<@(R0!:B@B-S D,@ .X6HG "<0* 5H%6@5Z!7H%>@5ZJ'O$>\1[P'O!E .[Q
M96X!A$." (,091"#54\ @N5/ !<$92>"54\ %P2 (($PA.06Z/0IUG5V!H1#
M@@"#$&7H@U5/ (+E3P 7+&4#@E5/ !<L@""!,(3D%Q#T*=9U=@:$0X( @Q!E
M9(-53P""Y4\ %TR (($PA.07./0IUG5V!H1#@@"#$&4*@U5/ !=F@3"$Y!=8
M]"G6=78&\2G6=0#NI\#Q98'D/P!P :? \54 [J? \V6. (XE3P  [CX %YJ.
M$(XU3P  [J?"\54 [H[C8@]C_V$0XJ$7O($T,0 7J&$0@#0P !>H .YN 0#N
M      !0<"  8#!@ #!@,  @<%  ('!P   @                    @   
M    P    ("   # @(" P "   P(" @(" @(" @(" @(" T," @(" @(" @(
M" @(" @-"F4%!04%Y04%Y04%!07%"@IE!04%!>4%!>4%!04%Q0H*!0P(" \%
M# T%" @(#04.#P4," @/!0P-!0@(" T%"@H%"F4&!94*"C4%!<4*-04%E0IE
M!065"@HU!0;%"@4*"@4/!0@(" @(# @/!0@(" @(#P4(" P(" @(#P4/!0H*
M=06U!04%!<4*906U!>4%!>4%M07%"F4%!04%M075"@H%# @(" @-!0\%# @/
M!0@/!0@(#04/!0P(" @(#04*#P4/904%Y0HUY94*906P!06U!<4*->65"F4%
M!<4/!0\'= 75" \%#@\%" \%# @(" @-!0@/!0@/!0@/=074!PH%"C4%!?4%
M!;4%!=4(" T," ]U!06U!07U!065"@4*"@4(" @-!0P(" @--07%"@IE!94,
M" @(#04," @/!0H*=04%Q0H%" @(" @(#P4(#P4(" @(" @/!0IE!075"@H%
M# T&"C4%!04%Y04%]04%]04%Y04%!065"@8,#04*"@4(#P4(" @(" \%# T%
M" \%# T%" @(" @/!0@/!0H*-04%M04%!04%!94*"C4%!94*"C4%!04%!06U
M!065"@@(" @(" @(" @(" \(" @(" \(" @(" @(" @(" @//$*9F4(\ 1 /
5 'B$,C*$>  0X !X_/[^A'@ $.  
 
end
<------------------------- CUT HERE ---------------------------->

Here be the ASC\-> string:

<------------------------- CUT HERE ---------------------------->
%%HP: T(3)A(D)F(.);
"C2A2014010000E21A1348627E20254765626562776021313F21313D272930308
3018317A0C1F556600760062A7E604782EE672781E86A196C0A683B600C620D6
A1000E62C962667A4DAD4BCD4D32C9E3002106422C5283637F2184E8067227E6
46722721220F700400214E0808086508650865180A1865186518650501214A08
09086508650865180B1865186518650501214A7A4DAD4BA683B600AD4BE63F78
2EE640781EE62372270808086508650865180C186518651865050121E4080908
6508650865180D186518651865050121E47A4DCD4DC620D6A1CD4DE6FC782EE6
02781EE691722721E40604720AE604783E0807082E03002182E8067227722800
0E661176A07A2C62ED661176017A0C62ED46005680660076F0AA004D96AAA05D
960630720AE3003129AA004D96AAA05D964720572043033141AA004D96AAA05D
960630720AE3003129AA004D96AAA05D96672063613143AA004D96AAA05D9606
30720AE3003129AA004D96AAA05D9647EF57EF43003125AA004D96AAA05D9606
30720AE3003129AA004D96AAA05D9667EF630031273141AAA05D96AA415D9621
A13807E630382E48085809E660EE1A31EFE630EE1A4161E680EE1A41E2E670EE
1A416434305720340057EF34204720341047EF08041805622C2800E680082E03
0041E5E6700802282E24504166246041E72470418B6266E6CF782E7813880498
056166080418051720622C2800E680082E030031EB3630572031AD0804180517
EF622C2800E680082E030031EB360057EF31AD080418050720622C2800E68008
2E030031EB3620472031AD0804180507EF622C2800E680082E030031EB361047
EF31AD62668D49E80F00EEE60F082E08130F557A8D4D45671016500F7004001F
81310FE60F082E08130F557ACD4D456740080A180B622CE60F082E030041E9E6
C0783E080C180D622CE60F082E0300410BE603783E06FF0F810F51310F341046
A334204600310F2807E6C0282E080A180B622C7A4DE60F082E030041EEAD4B24
C0B7202400B7EF2480A7202440A7EFAD4B00EE1C0F0821030041EFE6C0783E28
3E418DAD4B08E5F40051C02640A7EF51E208E5F400518126C0B72051E208E5F4
0051422680A72051E208E5F400416F2600B7EFAD4BE63F782E781200EE280738
07E603282E080C180D622C7A4DE60F082E03005166CD4D2403D7202400D7EF24
02C7202401C7EFCD4D00EEE6081F70130061A1180038E5F40051493809385DF4
0051CC3300512B783E3808385CF40061003300516E783E61A13808385CF40061
003300516E783E3809385DF40051CC3300512B783E61A136041823140061A1CD
4DD720CD4D783EE6FC782E2603781200EE36011823140061A1CD4DD7EFCD4D78
3EE6FC782E2600781200EE36021823140061A1CD4DC720CD4D783EE6FC782E26
02781200EE36081823140061A1CD4DC7EFCD4D783EE6FC782E2601781200EE1C
0F0821030061C2783EE603783E283E5105CD4D08E5F40061A32609C7EF61C508
E5F40061642603D72061C508E5F4006125260AC72061C508E5F40061222600D7
EFCD4DE6F4782E781200EE0807E630082E08E508E57A4C0FE18D49E80F00EEE6
008A00EFE1EFE1EFE1EFE13F56AAE1EFE1EFE1EFE1EFE13F55E710E30861C700
EE28323833E6F008021803626C082E08E57A0E0FE12D2327202304612A283237
20340200EE612A072017200865186518E518E518E518E5AAE11FE11FE10FE10F
5600EE1F56E61048342800380156013855F400285EF400714056722855F40071
4008021803484E618E4F926D576760483428003801568E3855F400285EF40071
C256302855F40071C208021803484E71014F926D576760483428003801564638
55F400285EF40071C408021803484E71834F926D57676048342800380156A038
55F40071661803484E71854F926D5767601F926D5700EE7A0C1F56184EF30007
107A0C1F5500EE7A0C3F56E800E852F40000EEE30071A9E801E853F40000EE7A
2C1F5500EEE83E26F036FF16012E1A71CB18431300718A160108430300718A00
EEE61000EE000000000005070200060306000306030002070500020707000002
0000000000000000000000000000000800000000000C000000080800000C0808
080C000800C08080808080808080808080808080D0C080808080808080808080
80808080D0A056505050505E50505E505050505CA0A056505050505E50505E50
5050505CA0A050C08080F050C0D050808080D050E0F050C08080F050C0D05080
8080D050A0A050A056605059A0A05350505CA053505059A056505059A0A05350
605CA050A0A050F0508080808080C080F0508080808080F0508080C080808080
F050F050A0A057505B505050505CA056505B505E50505E505B505CA056505050
505B505DA0A050C080808080D050F050C080F05080F0508080D050F050C08080
8080D050A0F050F05650505EA0535E59A056500B50505B505CA0535E59A05650
505CF050F07047505D80F050E0F05080F050C080808080D05080F05080F05080
F057504D70A050A05350505F50505B50505D8080D0C080F05750505B50505F50
5059A050A0A050808080D050C0808080D053505CA0A0565059C0808080D050C0
8080F050A0A05750505CA050808080808080F05080F050808080808080F050A0
5650505DA0A050C0D060A053505050505E50505F50505F50505E5050505059A0
60C0D050A0A05080F0508080808080F050C0D05080F050C0D0508080808080F0
5080F050A0A05350505B50505050505059A0A053505059A0A053505050505050
5B505059A0808080808080808080808080F08080808080F08080808080808080
80808080F0C324999924C31001F00087482323488700010E0087CFEFEF488700
010E00C5C0"
<------------------------- CUT HERE ---------------------------->

------------------------------------------------------------------------
Disclaimer: My opinions do not necessarily reflect those of my employer.
========================================================================
------------------------------------------------------------------------
     mike@DRD.Com  
     uunet!apctrc!drd!mike
========================================================================

billw@hpcvra.cv.hp.com. (William C Wickes) (01/25/91)

I hate to complain about an otherwise nice program, but... 

Using CLEAR is a nasty thing to do to an unsuspecting 48.  IMHO, any
program should be able to clean up after itself without trashing stack
objects that it didn't put there.  And I shouldn't have to read a
program's listing to figure out how to defend against its side
effects. 

Bill Wickes
HP Corvallis