[comp.sys.handhelds] Tetris

lennartb@lne.kth.se (Lennart Boerjeson @ KTH/LNE, The Royal Inst. of Tech.) (08/08/90)

This is Tetris for the HP48. The program is quite big.

Before loading this program, be sure to pack all GROBs on one line.
Start the game by selecting CST menu and press TETRIS. Exit the introduction
by hitting any key, except ON.
Use the cursor keys to move the falling object.
Rotate by pressing UP-arrow, drop by pressing DOWN-arrow.
NXT toggles display of next object.
RUBOUT exits game.

Flaws: I have no idea of how the original Tetris awards points. If someone
has, please mail me.

!++
! Lennart Boerjeson, System Manager
! School of Electrical Engineering
! Royal Institute of Technology
! S-100 44 Stockholm, Sweden
! tel: int+46-8-7907814
! Internet: lennartb@lne.kth.se
!--


%%HP: T(3)A(R)F(,);
DIR
  BLROW GROB 30 3 000000000000000000000000
  CHECKROWS
    \<< XY DXY + IM OB SIZE SWAP DROP B\->R 1 - 3 / IP NEG OVER +
      FOR y y CHKROW -1
      STEP
    \>>
  CHKP
    \<< 'NXY' STO NXY DXY + PIC OVER OB
      IFERR GXOR
      THEN 4 DROPN 0
      ELSE 'NPIC' STO PIC SWAP OB GOR NPIC SAME
      END
    \>>
  CHKP1
    \<< DXY + PIC OVER OB GXOR PIC ROT OB GOR SAME
    \>>
  CHKPLOOP
    \<<
      DO XY VL + CHKP
        IF
        THEN 1 DUP
        ELSE
          IF VL RE DUP
          THEN SIGN 0 R\->C NEG 'VL' STO+ 0
          ELSE 1
          END
        END
      UNTIL
      END
    \>>
  CHKROW
    \<< -5 SWAP R\->C PIC SWAP (29;-2) 3 / OVER + \-> A B
      \<< A B SUB ROWOB
        IF SAME
        THEN PIC A BLROW REPL 'PIC' STO
          PV
          PIC (-5;18) PIC (-5;19) B (0;1) + SUB REPL
          (-5;19) BLROW REPL 'PIC' STO
	  500 PTPLUS
          PV
        END
      \>>
    \>>
  CST { TETRIS INTRO MOVIE }
  DROPOB
    \<< UNPASTE
      IF CHKPLOOP
      THEN
        DO (0;-1) 'VL' STO+
        UNTIL XY VL + CHKP1 NOT
        END (0;1) 'VL' STO+
      END PASTE
    \>>
  DXY (-1;0)
  FLGS { # 84030000050FF0h # 0h }
  GETOB
    \<< NOBJ 'OBJ' STO NOBN 'OBN' STO NOB 'OB' STO
      (0;18) 'XY' STO MDXY RANDOBJ
    \>>
  GOVER "Game over"
  INIPIC
    \<< (-16;-3) 3 / (15;60) 3 / { X 0 (0;0) FUNCTION Y } + + 'PPAR' STO
      ERASE PICT { # 31h # 0h } { # 50h # 3Fh } DUP2 BOX SUB 'PIC' STO
      PICT { # 58h # 4h } VASILIJ REPL PICT { # 2h # Ah } INSTR REPL
    \>>
  INITT
    \<< INIPIC { # 0h # 0h } PVIEW RANDOBJ GETOB PASTE 'NV=0' DEFINE
      'PT=0' DEFINE PV 'VL=(0;-1)' DEFINE
    \>>
  INSTR GROB 38 50 CCD9CD10004594940000C49C9C100045949400004D949C
    10000000000000000000000000CF1000000042100000004710000000CA100
    0000042100000004210000000CF10000000000000008FDFDF000084525900
    0082525A00008FDADF000082575A000084525900008FDFDF0000000000000
    000000000000CCCD10000045551000004D4D1000004555000000C4D500000
    00000000000000000000FFFF00000010080000005AAB04ABA3DA290CA821D
    3190CB3115B2904B8215A2904AB211008000000FFFF0000000000000000FF
    FFF000001000800000199A989AE098AAA4AA40DB9A94AA4098AAA49A4019A
    B98AB401000800000FFFFF00000
  INTRO
    \<<
      IF 'MOVIE' VTYPE 15 SAME
      THEN MOVIE MOV UPDIR
      END
    \>>
  KEYACT
    \<<
      CASE DUP 25 SAME
        THEN ROTATEOB
        END DUP 35 SAME
        THEN DROPOB
        END DUP 34 SAME
        THEN LEFTOB
        END DUP 36 SAME
        THEN RIGHTOB
        END DUP 26 SAME
        THEN NV NOT 'NV' STO
        END DUP 55 SAME
        THEN DROP GOVER DOERR
        END 1000 ,1 BEEP
      END DROP
    \>>
  LEFTOB
    \<< (-1;0) 'VL' STO+
    \>>
  MDXY
    \<< OB SIZE 7 / B\->R SWAP 6 / B\->R NEG SWAP R\->C 'DXY' STO
    \>>
  MOVACT
    \<< UNPASTE
      IF CHKPLOOP
      THEN UPD
      ELSE PASTE CHECKROWS GETOB
        IF XY CHKP
        THEN UPD
        ELSE GOVER DOERR
        END
      END PV (0;-1) 'VL' STO
    \>>
  MOVIE
    DIR
      CST { }
      INIMOV
        \<< PICT SIZE 'PH' STO 'OPW' STO PLANE SIZE 'SH' STO 'SW' STO
          OPW SW + 'PW' STO PW PH BLANK SW # 0h 2 \->LIST PICT RCL REPL
          'PIC' STO PIC PICT STO
        \>>
      INIXY
        \<< SW OPW SW - 2 / + B\->R 'X' STO PH SH - 2 / 'Y' STO
        \>>
      MOV
        \<< REDSQ PICT STO INIMOV INIXY SW # 0h 2 \->LIST PVIEW
          DO PW 1 - B\->R 0
            FOR x x R\->B Y 2 \->LIST 'XY' STO
              PICT O PIC XY PLANE GOR XY NPLANE GXOR REPL -10
            STEP PICT O PIC REPL
          UNTIL KEY
          END DROP RSTXY RSTMOV
        \>>
      NPLANE GROB 83 11 00000C708FFFFFFFFFFF7008F0064040000000000040
        7C810A502FFFFFFFFFFF50D7770B5051DB5F1119D450500CFDDF65D55FBD
        B557509FF3000051D1BFB1B9D6509FF30CFF6DD5BFBDB5DD50970CF7005D
        15BFB1B5565058F700002FFFFFFFFFFF50DF000000400000000000407000
        00008FFFFFFFFFFF70
      O { # 0h # 0h }
      PLANE GROB 83 11 00000C708FFFFFFFFFFF7008F00E70CFFFFFFFFFFF707
        CF10E70EFFFFFFFFFFF70FFF70F70FFFFFFFFFFFF70FFFFFFFFFFFFFFFFF
        FFF70FFFFFFFFDFFFFFFFFFFF70FFFFFFFFFFFFFFFFFFFF70FFFFF700FFF
        FFFFFFFFF70FFF70000EFFFFFFFFFFF70FF000000CFFFFFFFFFFF7070000
        0008FFFFFFFFFFF70
      PPAR { (-6,5;-3,1) (6,5;3,2) X 0 (0;0) FUNCTION Y }
      REDSQ GROB 131 64 00000000000000002000000000000000000000000000
        0000002000000000000000000000000000000008F0000000000000000000
        000000000000002000000000000000000000000000000000600000000000
        000000000000000000000030000000000000000000000000000000002000
     	000000000000000000000000000000500000000000000000000000000000
	000880000000000000000000000000000000040100000000000000000000
	000000000004010000000000000000000000000000000880000000000000
	000000000000000000007000000000000000000000000000000000500000
	000000000000000000000000000050000000000000000000000000000000
	005000000000000000000000000000000000700000000000000000000000
	0000000408A000000000000000000000000000000408A000000000000000
	000000000000000F18A000000000000000000000000000000408A0800000
	00000000000000000000000C442180000000000000000000000000000644
	21E30000000000000000000000000004F521800000000000000000000000
	0000044EF381000002000000000000000000000AC282C000000200000000
	0000000000000A628280000007000000000000000000000542E3800000CF
	100000000000000000000552824100008F0000000000000000000084E283
	410000070000000000000000000042F2C2A200008A000000000000000000
	00495182A200000200000000000000000000C45182940000050000000000
	00000000004A534929000005000000000000000000008755C94A00008800
	00000000000000000084556B9C000088000000000000000000008455AA29
	0000CF10000000000000000000845555F70000CF10000000007511000000
	88F3B6140000CA100000000015B1000000880255140000CE100000000015
	510000008F02E3F70000C81000000000151100000088022A080000CF1000
	000000171100000088F32EFF10004710000000F700000000008404E70010
	004010000F7008FFF30000004404140010004018FFFF7000000CFF100042
	0808001000CFFFFFFF70333000001000CFFFFFFF1000CFFFFFFF70000333
	3B1000629429423000CFFFFFFF70000000001000529429425000CFFFFFFF
	70000000001008FFFFFFFFF000CFFFFFFF703333333B1008000880008000
	CFFFFFFF70000000001008000401008000CFFFFFFF700000033B10080004
	01008000CFFFFFFF70003330001008000401008000CFFFFFFF703300000B
	1008000401008000CFFFFFFF70000003301008FFFFFFFFF000CFFFFFFF70
	0003300CFFFFFFFFFFFFFFFFFFFFFFFF70033000E300000000000000000E
	FFFFFF7030008F1002DD989B38BBBBC200CFFFFF70000C70000A54510900
	909A220000FFFF7000E300000E5CD52930939B2200000EFF708F10000006
	54453900909820000000CF707000000002544D29309398C2000000007000
	00000000000000000000000000000000
      RSTMOV
        \<< PIC SW # 0h 2 \->LIST PW 1 - PH 1 - 2 \->LIST SUB
          PICT CLLCD TEXT STO { PIC PW SW SH OPW PH } PURGE
          WHILE KEY
          REPEAT DROP
          END
        \>>
      RSTXY
        \<< { X Y XY } PURGE
        \>>
    END
  NEWG?
    \<< RCLMENU \-> m 
      \<< { { YES \<< 0 CONT \>> } { NO \<< 1 CONT \>> } } TMENU
        2 FREEZE "Play again?" PROMPT m MENU
      \>>
    \>>
  NOB GROB 6 6 F3D2F3F3D2F3
  NOBJ { GROB 6 6 F3D2F3F3D2F3
         GROB 6 6 F3D2F3F3D2F3
	 GROB 6 6 F3D2F3F3D2F3
	 GROB 6 6 F3D2F3F3D2F3
       }
  NOBN 2
  NPIC GROB 32 64 FFFFFFFF100000081000000810000008100000081000000810
	0070081000500810007008100EF308100AD208100EF30810000008100000
	081000000810000008100000081000000810000008100000081000000810
	000008100000081000000810000008100000081000000810000008100000
	081000000810000008100000081000000810000008100000081000000810
	000008100000081000000810000008100000081000000810000008100000
	081000000810000008100000081000000810000008100000081000000810
	0000081000000810000008F700000FB500000DF700000FFF30000FBD2000
	0DFF30000FFF3000EFBD2000ADFF3000EFFFFFFFFF
  NV 0
  NXY (0;18)
  OB GROB 9 6 830082008300FF10D610FF10
  OBJ { GROB 9 6 830082008300FF10D610FF10
        GROB 6 9 838283F3D2F3838283
        GROB 9 6 FF10D610FF10830082008300
        GROB 6 9 705070F3D2F3705070
      }
  OBLIST { :L2OBJ:  { GROB 6 9 705070705070F3D2F3
                      GROB 9 6 0C1004100C10FF10D610FF10
                      GROB 6 9 F3D2F3838283838283
                      GROB 9 6 FF10D610FF10700050007000
                    }
           :L1OBJ:  { GROB 6 9 838283838283F3D2F3
                      GROB 9 6 FF10D610FF100C1004100C10
                      GROB 6 9 F3D2F3705070705070
                      GROB 9 6 7000
50007000FF10D610FF10
                    }
           :Z1OBJ:  { GROB 9 6 8F1086108F10F300D200F300
                      GROB 6 9 705070F3D2F3838283
                      GROB 9 6 8F1086108F10F300D200F300
                      GROB 6 9 705070F3D2F3838283
                    }
           :Z2OBJ:  { GROB 9 6 F300D200F3008F1086108F10
                      GROB 6 9 838283F3D2F3705070
                      GROB 9 6 F300D200F3008F1086108F10
                      GROB 6 9 838283F3D2F3705070
                    }
           :TOBJ:   { GROB 9 6 830082008300FF10D610FF10
                      GROB 6 9 838283F3D2F3838283
                      GROB 9 6 FF10D610FF10830082008300
                      GROB 6 9 705070F3D2F3705070
                    }
           :ROBJ:   { GROB 12 3 FFF0D6B0FFF0
                      GROB 3 12 705070705070705070705070
                      GROB 12 3 FFF0D6B0FFF0
                      GROB 3 12 705070705070705070705070
                    }
           :SOBJ:   { GROB 6 6 F3D2F3F3D2F3
                      GROB 6 6 F3D2F3F3D2F3
                      GROB 6 6 F3D2F3F3D2F3
                      GROB 6 6 F3D2F3F3D2F3
                    } }
  OBN 1
  PASTE
    \<< PIC XY DXY + OB GXOR 'PIC' STO
    \>>
  PIC GROB 32 64 FFFFFFFF1000000810000008100000081000000810000008100
	070081000500810007008100EF308100AD208100EF308100000081000000
	810000008100000081000000810000008100000081000000810000008100
	000081000000810000008100000081000000810000008100000081000000
	810000008100000081000000810000008100000081000000810000008100
	000081000000810000008100000081000000810000008100000081000000
	810000008100000081000000810000008100000081000000810000008100
	000081000000810000008F700000FB500000DF700000FFF30000FBD20000
	DFF30000FFF3000EFBD2000ADFF3000EFFFFFFFFF
  PPAR { (-5,33333333333;-1) (5;20) X 0 (0;0) FUNCTION Y }
  PT 440
  PTPLUS
    \<< 'PT' STO+
    \>>
  PV
    \<< PICT { # 0h # 0h } PICT RCL { # 31h # 0h } PIC
      REPL { # 6h # 2h } PT 1 \->GROB REPL { # 20h # 2h }
      # Ch # Ch BLANK REPL
      IF NV
      THEN { # 20h # 2h } NOB REPL
      END REPL
    \>>
  RANDOBJ
    \<< OBLIST DUP SIZE RAND * IP 1 + GET DTAG 'NOBJ' STO
      RAND 4 * 1 + IP 'NOBN' STO NOBJ NOBN GET 'NOB' STO
    \>>
  RESETFLGS
    \<< FLGS STOF
    \>>
  RIGHTOB
    \<< (1;0) 'VL' STO+
    \>>
  ROTATEOB
    \<< UNPASTE DXY OB OBJ OBN 4 MOD 1 + 'OBN' STO
      OBJ OBN GET 'OB' STO MDXY
      IF ROTCHK
      THEN UPD 3 DROPN
      ELSE 'OBJ' STO 'OB' STO 'DXY' STO PASTE
      END
    \>>
  ROTCHK
    \<< OB SIZE DROP 3 / B\->R \-> w
      \<< [ (0;0) (1;0) (-1;0) (2;0) (0;0) ] 1
        DO
          IF DUP w >
          THEN 0 1
          ELSE GETI DUP 'DXY' STO+
            IF XY CHKP
            THEN DROP 1 1
            ELSE NEG 'DXY' STO+ 0
            END
          END
        UNTIL
        END 3 ROLLD DROP2
      \>>
    \>>
  ROWOB GROB 30 3 FFFFFFF3D6BD6BD2FFFFFFF3
  SCORE
    \<< CLLCD GOVER 1 DISP "Your score: " PT + 3 DISP TEXT 5 WAIT
    \>>
  SETFLGS
    \<< RCLF 'FLGS' STO { # 4030000050FF0h # 0h } STOF
    \>>
  TETRIS
    \<< SETFLGS INTRO
      DO INITT
        IFERR
          WHILE 1
          REPEAT
            DO MOVACT
            UNTIL KEY
            END
            DO KEYACT
            UNTIL KEY NOT
            END
          END
        THEN
          IF ERRM GOVER \=/
          THEN RESETFLGS ERRN DOERR
          END
        END SCORE
      UNTIL NEWG?
      END RESETFLGS
    \>>
  UNPASTE
    \<< PIC XY DXY + OB GXOR 'PIC' STO
    \>>
  UPD
    \<< NPIC 'PIC' STO NXY 'XY' STO 10 PTPLUS
    \>>
  VASILIJ
    \<<
      IF 'MOVIE' VTYPE 15 SAME
      THEN { MOVIE REDSQ } RCL { # 2Fh # 0h } { # 53h # 37h } SUB
      ELSE BLROW
      END
    \>>
  VL (0;-1)
  XY (0;18)
END
!++
! Lennart Boerjeson, System Manager
! School of Electrical Engineering
! Royal Institute of Technology
! S-100 44 Stockholm, Sweden
! tel: int+46-8-7907814
! Internet: lennartb@lne.kth.se
!--

jn163051@longs.LANCE.ColoState.Edu (Joel Nevison) (08/09/90)

In article <0093AE41.AB3A5320@lne.kth.se> lennartb@lne.kth.se (Lennart Boerjeson @ KTH/LNE, The Royal Inst. of Tech.) writes:
>This is Tetris for the HP48. The program is quite big.
>
>Before loading this program, be sure to pack all GROBs on one line.

Wonderful!   I couldn't wait to try this out.....but...I can't
get the big grob packed into one line.  My text editor crashes because
the line is too long.   My sysadm says I'm out of luck unless I write
some shell script or c code to remove the CR's.  Yikes!  is c code
anything like RPL? :)   But seriously now can someone out there offer
any suggestions.   Is it possible for someone to uuencode programs
with massive grobs in them, I can deal with that.
Thanks to any who can help.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Substitution mass confusion   /           Joel Nevison                  |
|    Clouds inside my head     /  jn163051@longs.lance.colostate.edu      |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

jdege@ (Jeff Dege) (08/09/90)

In article <8394@ccncsu.ColoState.EDU> jn163051@longs.LANCE.ColoState.Edu (Joel Nevison) writes:
>In article <0093AE41.AB3A5320@lne.kth.se> lennartb@lne.kth.se (Lennart Boerjeson @ KTH/LNE, The Royal Inst. of Tech.) writes:
>>This is Tetris for the HP48. The program is quite big.
>>
>>Before loading this program, be sure to pack all GROBs on one line.
>
>Wonderful!   I couldn't wait to try this out.....but...I can't
>get the big grob packed into one line.  My text editor crashes because
>the line is too long.   My sysadm says I'm out of luck unless I write
>some shell script or c code to remove the CR's.  Yikes!  is c code

   I had teh same problem.  I ended up stripping the leading spaces,
deleting the terminal linefeed, and replacing the last character with
a control character - i.e. 000F became 000^F.  Fortunately, my editor
splits lines on most control characters, so the result didn't excede
the max linelength.  Then I just called up a hex editor and replaced
the control characters with the appropriate character (since my
hex editor won't insert characters).  0F I replaced with 46.
 
   Another approach would be to split the file into pre-grob, grob,
and post-grob (since there was only one grob that wouldn't fit on my
maxline, this would work.  Then strip everything but the linefeeds from
the grob file with your editor, then pass it through a line-feed stripper.
Building this would be 5 minutes work, max.  Finally join everything 
back together.
 
   You don't need a large, special program, just appropriate use of
the usual small utilities.

frechett@snoopy.Colorado.EDU (Mac the Ripper/ / / /) (08/09/90)

Great game.  Alot must have gone into this.  A bit slow but there are ways
to make it interesting.  One thing though.  I am getting a bad shape.  I have
no idea how to find it either.  As was mentioned, this IS a big program.
The shape is:
*
***   
where these would be boxes.  The shape is fine in any other orientation
but it appears as one little "-" when it is in this orientation and is 
totally indestructable.  I have managed to avoid it by just not rotating it
to that, but I would like to fix it.  Has anyone else had this problem?
Does anyone know how to fix it?

	As for the prob with that BIG GROB in the middle.  I know that
certain versions of vi won't handle these big lines at all and ones like
mine will crash when it can't display one line on one screen.  BUT I did
manage to fool vi.  I combined one screen's worth of that GROB and then 
I moved down and combined the rest so that I end up with two very large 
lines.  If you then move to the very last character of the first one and 
type J it will join the two and then pop you into the
:    promt because it can no longer display it right.  YOu know have one BIG
line with a space in the middle.  All you have to do know is look at the 
characrters before and after the space; take 00007B 444500 for instance
and then go to the top of the file again and type
:%s/00007B\ 444500/00007B444500
and it will do a global substitution.  It will then crash of course
but back to the : prompt where you can save it.    When you are all done
with this horrible kludge it will be all right.  This will only work on 
certain machines so don't get on my case if it doesn't on yours.

	OR if anyone would like me to post a uuencoded version, I could do
that too.  

	ian frechett         frechett@snoopy.colorado.edu

lennartb@lne.kth.se (Lennart Boerjeson @ KTH/LNE, The Royal Inst. of Tech.) (08/09/90)

In article <24514@boulder.Colorado.EDU>, frechett@snoopy.Colorado.EDU (Mac the Ripper/ / / /) writes:
>Great game.  Alot must have gone into this.  A bit slow but there are ways
>to make it interesting.  One thing though.  I am getting a bad shape.  I have
>no idea how to find it either.  As was mentioned, this IS a big program.
>The shape is:
>*
>***   
>where these would be boxes.  The shape is fine in any other orientation
>but it appears as one little "-" when it is in this orientation and is 
>totally indestructable.  I have managed to avoid it by just not rotating it
>to that, but I would like to fix it.  Has anyone else had this problem?
>Does anyone know how to fix it?
>
All shapes are stored in the OBLIST list. That particular name is called
L1OBJ (the names are not used anywhere in the program). Here is the entire
OBLIST (result of 'OBLIST' BYTES : #8634h 657).

---------------------
%%HP: T(3)A(R)F(,);
{ :L2OBJ: {
GROB 6 9 705070705070F3D2F3
GROB 9 6 0C1004100C10FF10D610FF10
GROB 6 9 F3D2F3838283838283
GROB 9 6 FF10D610FF10700050007000
} :L1OBJ: {
GROB 6 9 838283838283F3D2F3
GROB 9 6 FF10D610FF100C1004100C10
GROB 6 9 F3D2F3705070705070
GROB 9 6 700050007000FF10D610FF10
} :Z1OBJ: {
GROB 9 6 8F1086108F10F300D200F300
GROB 6 9 705070F3D2F3838283
GROB 9 6 8F1086108F10F300D200F300
GROB 6 9 705070F3D2F3838283
} :Z2OBJ: {
GROB 9 6 F300D200F3008F1086108F10
GROB 6 9 838283F3D2F3705070
GROB 9 6 F300D200F3008F1086108F10
GROB 6 9 838283F3D2F3705070
} :TOBJ: {
GROB 9 6 830082008300FF10D610FF10
GROB 6 9 838283F3D2F3838283
GROB 9 6 FF10D610FF10830082008300
GROB 6 9 705070F3D2F3705070
} :ROBJ: {
GROB 12 3 FFF0D6B0FFF0
GROB 3 12 705070705070705070705070
GROB 12 3 FFF0D6B0FFF0
GROB 3 12 705070705070705070705070
} :SOBJ: {
GROB 6 6 F3D2F3F3D2F3
GROB 6 6 F3D2F3F3D2F3
GROB 6 6 F3D2F3F3D2F3
GROB 6 6 F3D2F3F3D2F3
} }
------------------------------------------------

I have made a work-around for the big GROBs: 
Load these files into your 48 ( INSTR, TXGR and CONVGROBS should be in
the same directory as TETRIS; REDSQ, PLANE and NPLANE in the MOVIE directory).
Then execute CONVGROBS.

INSTR, 'INSTR' BYTES -> #F2BDh 585.5
------------------------------------
%%HP: T(3)A(R)F(,);
{
"GROB 38 50 CCD9CD10004594940000C49C9C1000459494000"
"04D949C10000000000000000000000000CF100000004210000"
"0004710000000CA1000000042100000004210000000CF10000"
"000000000008FDFDF0000845259000082525A00008FDADF000"
"082575A000084525900008FDFDF00000000000000000000000"
"00CCCD10000045551000004D4D1000004555000000C4D50000"
"000000000000000000000FFFF00000010080000005AAB04ABA"
"3DA290CA821D3190CB3115B2904B8215A2904AB21100800000"
"0FFFF0000000000000000FFFFF000001000800000199A989AE"
"098AAA4AA40DB9A94AA4098AAA49A4019AB98AB40100080000"
"0FFFFF00000" }
-------------------------------------

REDSQ, 'REDSQ' BYTES -> #C8A1h 2422.5
-------------------------------------
%%HP: T(3)A(R)F(,);
{
"GROB 131 64 00000000000000002000000000000000000000"
"0000000000002000000000000000000000000000000008F000"
"00000000000000000000000000000020000000000000000000"
"00000000000000600000000000000000000000000000000030"
"00000000000000000000000000000000200000000000000000"
"00000000000000005000000000000000000000000000000008"
"80000000000000000000000000000000040100000000000000"
"00000000000000000401000000000000000000000000000000"
"08800000000000000000000000000000000070000000000000"
"00000000000000000000500000000000000000000000000000"
"00005000000000000000000000000000000000500000000000"
"00000000000000000000007000000000000000000000000000"
"000408A000000000000000000000000000000408A000000000"
"000000000000000000000F18A0000000000000000000000000"
"00000408A080000000000000000000000000000C4421800000"
"0000000000000000000000064421E300000000000000000000"
"00000004F5218000000000000000000000000000044EF38100"
"0002000000000000000000000AC282C0000002000000000000"
"000000000A628280000007000000000000000000000542E380"
"0000CF100000000000000000000552824100008F0000000000"
"000000000084E283410000070000000000000000000042F2C2"
"A200008A00000000000000000000495182A200000200000000"
"000000000000C4518294000005000000000000000000004A53"
"4929000005000000000000000000008755C94A000088000000"
"0000000000000084556B9C0000880000000000000000000084"
"55AA290000CF10000000000000000000845555F70000CF1000"
"000000751100000088F3B6140000CA100000000015B1000000"
"880255140000CE100000000015510000008F02E3F70000C810"
"00000000151100000088022A080000CF100000000017110000"
"0088F32EFF10004710000000F700000000008404E700100040"
"10000F7008FFF30000004404140010004018FFFF7000000CFF"
"1000420808001000CFFFFFFF70333000001000CFFFFFFF1000"
"CFFFFFFF700003333B1000629429423000CFFFFFFF70000000"
"001000529429425000CFFFFFFF70000000001008FFFFFFFFF0"
"00CFFFFFFF703333333B1008000880008000CFFFFFFF700000"
"00001008000401008000CFFFFFFF700000033B100800040100"
"8000CFFFFFFF70003330001008000401008000CFFFFFFF7033"
"00000B1008000401008000CFFFFFFF70000003301008FFFFFF"
"FFF000CFFFFFFF700003300CFFFFFFFFFFFFFFFFFFFFFFFF70"
"033000E300000000000000000EFFFFFF7030008F1002DD989B"
"38BBBBC200CFFFFF70000C70000A54510900909A220000FFFF"
"7000E300000E5CD52930939B2200000EFF708F100000065445"
"3900909820000000CF707000000002544D29309398C2000000"
"00700000000000000000000000000000000000" }
-------------------------------------

NPLANE, 'NPLANE' BYTES -> #FDC7h 298,5
-------------------------------------
%%HP: T(3)A(R)F(,);
{
"GROB 83 11 00000C708FFFFFFFFFFF7008F00640400000000"
"000407C810A502FFFFFFFFFFF50D7770B5051DB5F1119D4505"
"00CFDDF65D55FBDB557509FF3000051D1BFB1B9D6509FF30CF"
"F6DD5BFBDB5DD50970CF7005D15BFB1B5565058F700002FFFF"
"FFFFFFF50DF00000040000000000040700000008FFFFFFFFFF"
"F70" }
-------------------------------------

PLANE, 'PLANE' BYTES -> #C541h 297.5
-------------------------------------
%%HP: T(3)A(R)F(,);
 {
"GROB 83 11 00000C708FFFFFFFFFFF7008F00E70CFFFFFFFF"
"FFF707CF10E70EFFFFFFFFFFF70FFF70F70FFFFFFFFFFFF70F"
"FFFFFFFFFFFFFFFFFFF70FFFFFFFFDFFFFFFFFFFF70FFFFFFF"
"FFFFFFFFFFFFF70FFFFF700FFFFFFFFFFFF70FFF70000EFFFF"
"FFFFFFF70FF000000CFFFFFFFFFFF70700000008FFFFFFFFFF"
"F70" }
-------------------------------------

TXGR, 'TXGR' BYTES -> #9A7Fh 76
-------------------------------------
%%HP: T(3)A(R)F(,);
\<< OBJ\-> 1 SWAP
  START DUP DUP RCL 0 ROT
STO "" SWAP OBJ\-> 1
SWAP
    START +
    NEXT OBJ\-> SWAP
STO
  NEXT
\>>
-------------------------------------

CONVGROBS, 'CONVGROBS' BYTES -> #1F7Ah 94.5
-------------------------------------
%%HP: T(3)A(R)F(,);
  \<< { INSTR } TXGR
   MOVIE { REDSQ PLANE
NPLANE } TXGR UPDIR
\>>


> [...deleted...]
>
>	ian frechett         frechett@snoopy.colorado.edu

!++
! Lennart Boerjeson, System Manager
! School of Electrical Engineering
! Royal Institute of Technology
! S-100 44 Stockholm, Sweden
! tel: int+46-8-7907814
! Internet: lennartb@lne.kth.se
!--

charliep@hpcvra.CV.HP.COM (Charles Patton) (08/09/90)

It's really sad when workstation editors are less forgiving than calculators
but anyway...
Perhaps the easiest way to get the GROBS into the '48 is to surround them with
quotes, as in
    "GROB 32 50 7589430909999
       .
       .
     7949859000"

They will then be stored as strings in the '48 under the appropriate names.
At this point you could either VISIT them and remove the quotes, spaces and
newlines or remove them programmatically.

...Charlie Patton

*******************************************************
** charliep@cv.hp.com     (For Internet hosts)       **
*******************************************************

math1i7@jetson.uh.edu (08/10/90)

In article <24514@boulder.Colorado.EDU>, frechett@snoopy.Colorado.EDU (Mac the Ripper/ / / /) writes:
> to make it interesting.  One thing though.  I am getting a bad shape.  I have
> no idea how to find it either.  As was mentioned, this IS a big program.
> The shape is:
> *
> ***   
> where these would be boxes.  The shape is fine in any other orientation
> but it appears as one little "-" when it is in this orientation and is 
> totally indestructable.  I have managed to avoid it by just not rotating it
> to that, but I would like to fix it.  Has anyone else had this problem?
> Does anyone know how to fix it?
> 

Ian,
   I had exactly the same problem and traced it to a GROB that wasn't 
patched correctly.  It was a short one, which is why I had overlooked it 
before.  I'm sorry, but I don't remember exactly which GROB it was.

Gordon

jmunkki@hila.hut.fi (Juri Munkki) (08/11/90)

In article <6441@helios.ee.lbl.gov> skankman@ux1.lbl.gov (David Schurig) writes:
>Am I the only one who does not know what a grob is? Can someone explain
>this to me?  Thanks.

A long, long time ago, Martians invented GROKking. To GROK a thing is to
completely understand it. On Earth, we are still stuck with an older version
of GROK, which is the GROB. GROB stands for Graphics Object and is used in
the HP48SX line of calculators from the High Priests of portable computing.

GROB will naturally be succeeded with GROC (Graphics Object in Color),
GROD (Graphics Object with Depth), GROE (Graphics Object or Entity), ...

Remember:-)


   ___________________________________________________________________________
  / Juri Munkki	    /  Helsinki University of Technology   /  Wind  /   HP S /
 / jmunkki@hut.fi  /  Computing Center Macintosh Support  /  Surf  /   48 X /
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

alonzo@microsoft.UUCP (Alonzo GARIEPY) (08/13/90)

In article <1990Aug10.193307.24460@santra.uucp> jmunkki@hila.hut.fi (Juri Munkki) writes:
> GROB will naturally be succeeded with GROC (Graphics Object in Color),
> GROD (Graphics Object with Depth), GROE (Graphics Object or Entity), ...

GROA UP.

johnt@mead.UUCP (John Townsend) (08/14/90)

In article <0093AE41.AB3A5320@lne.kth.se>, lennartb@lne.kth.se (Lennart
Boerjeson @ KTH/LNE, The Royal Inst. of Tech.) writes:
|> 
|> Flaws: I have no idea of how the original Tetris awards points. If someone
|> has, please mail me.
|> 

Tetris awards points based upon the amount of time you take to get the
object into position.  In other words, the sooner you drop the object,
the more points you make.  Great game, but have you seen "Hextris"
yet ... with hexagons instead of squares?  Still has four per object,
but there are are about ten different shapes instead of six, and it's
a lot harder to find places for them ... but lots of fun too.

brian@fog.ann-arbor.mi.us (Brian S. Schang) (08/15/90)

I must have missed Tetris along the way.  Can someone please send
me a copy?  Thanks a lot!!
-- 
Brian S. Schang   N8FOG          brian@fog.ann-arbor.mi.us
46131 Academy Drive              schang@caen.engin.umich.edu
Plymouth, MI  48170-3519

madler@piglet.caltech.edu (Mark Adler) (08/15/90)

For the convenience of others, I have posted a copy of Lennart Boerjeson's
Tetris program for the HP-48SX in the new_uploads directory on
calvin.stanford.edu (36.14.0.43). This copy has the GROB's all merged
properly and the one bad GROB from the original fixed (the one that gave
the odd "-" shape).  It is in two forms, straight as tetris.48, and
uuencoded as tetris.uue.

Mark Adler
madler@piglet.caltech.edu

peraino@gmu90x.gmu.edu (peraino) (08/31/90)

     I have received a copy of the Tetris game. Thanks to Iain Brodie
for sending it out so promptly, and thanks to anyone about to send it
out to me.


-----------------------------------------------------------------------------
       Bob Peraino                   UUCP    : uunet!pyrdc!gmu90x!peraino
 George Mason University             INTERNET: peraino@gmuvax.gmu.edu
UCIS, Thompson Hall, rm 2 <-         BITNET  : peraino@gmuvax
  4400 University Drive     \        PHONE   : (703)-323-2549
   Fairfax, VA  22030        \- Yeah, they put us in the basement, too.
-----------------------------------------------------------------------------

johankha@tz.wimsey.bc.ca (e_mou) (01/01/91)

Can someone mail me a copy of whatever latest, greatest version of Tetris 
for the HP-28s is out there?  Thanks very much.  (I have some trouble 
obtaining a good ftp.)
 

egraeler@uceng.UC.EDU (Eric S Graeler) (02/13/91)

> tell me what that number 3 on the top,center of my screen is doing there now?
> And how I get rid of it?

The HP48sx has two set of flags in it.  The are flags that are used
internally by the calculator.  They are number -1 to -64.  The do such things
as for example, if -19 is set and you do a 2D the argument on the stack in
level 1 and 2 go into a complex number.  If flag -19 is clear they go into
a two dimensional vector.  Flags 1 to 64 are for the user.  The calculator
does not used them.  So in your case if you do a 3 CF then that three will
disapear.  For flags 1 to 5 (those are user flags since they are positive)
if they are set you will see the number of the flag at the top of the screen.
All of this is documented in the manual.  I took about 3 or 4 days to read
through the manual and found out lots of good stuff that will make my
life easier later.  How many people know what the %%HP T(3)... etc. is used
for in downloading programs?

Eric Graeler
egraeler@uceng.uc.edu

lp@itrpe.UUCP (Line Printer Owner) (02/14/91)

I hate to concatenate strings!
From: mheubi@.itr.uu.ch (Heubi Matthias)
Path: !mheubi

BTW: Tetris is great!!!!!
-----------------------------------------------------------------------
Matthias Heubi      / NeXT / Atari ST / HP-48SX /    mheubi@itrpe.uu.ch
-----------------------------------------------------------------------

mjkobb@media-lab.MEDIA.MIT.EDU (Viet Anh) (02/19/91)

Greetings,

  Just a few more tidbits of info on my Tetris problems.  It seems like it
always hangs after the third piece.  I sat pressing "0" for awhile after it
hung last time, and after a few seconds, every key that was pressed caused a
funny warbling beep.  I had to ON-C the machine again to break out of it.

  Anyone know why this is happening??

  At least this time, the three pieces allowed me to clear a row....  :-)

--Mike

mjkobb@media-lab.MEDIA.MIT.EDU (Viet Anh) (02/19/91)

Well, right after I posted the last one, I got it to give me four pieces
before hanging.  Help!

--Mike

mjkobb@media-lab.MEDIA.MIT.EDU (Michael J Kobb) (02/20/91)

Greetings again,

  I downloaded the older version (no nifty side graphics, no help files, etc)
from hpcvbbs.cv.hp.com, and it does the exact same thing as the new one, which
suggests to me that there's an incompatibility somewhere.

  Has anybody else run this thing on a Rev. A machine?  If that's the problem,
this alone will provide enough excuse to upgrade.... ;-)

Thanks!

--Mike

mjkobb@media-lab.MEDIA.MIT.EDU (Michael J Kobb) (02/20/91)

Greetings,

  First, let me apologize to folks for cluttering the newsgroup with postings
on Tetris.

  Second, let me announce that Tetris fixed itself.  Specifically, as I
mentioned earlier, I had downloaded the older version from one of the HP
machines.  Since it displayed the same problems, I thought there must be some
incompatibility with my machine.  I tried setting the math modes, etc..  Then,
I tried running it with the clock on.

  Two pieces, then *BANG*.  I get "Attempt to Recover Memory?"  Yes/No.
Obviously, I pressed yes.  Upon verifying that nothing was missing (nothing
I've found yet anyway), I tried running it again.  Yep, you guessed it.  Works
fine.  Much faster now, too.

  So, I now have two questions, and I'll shut up:

  1) What the hell just happened?  Is this related to the problem of things
dying if you archive with the clock on.  (My machine's Rev. A)

  2)  Is there any way to set the keys back to the way they were in the old
version?  (Leaving the new ones like 'n', 'p', 'o', etc.)  In other words, can
I get the move, rotate, and drop keys back onto the arrows?

Thanks,
--Mike

akcs.falco@hpcvbbs.UUCP (Andrey Dolgachev) (03/02/91)

What version of Tetris do you have, when was it posted and by who?
The version that I posted, close to a month ago, works fine, and you
could try getting that one
    ---Falco