XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX TETRI XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX A small but intelligent version of the Tetris game for the HP49 TETRI differs from Windows-like versions of Tetris in that the player fights with growing complexity, not with growing speed. The result depends largely on the player's skill and to a lesser extent on a lucky chance. What makes the game fascinating is the difficulty caused by the random dice distribution in the first n lines. A good player survives as a rule level 7, a skilled player even level 9 or 10. The same game can be repeated several times with option |Same|, with precisely the same random dice distribution when starting in the same level. Thus, one can successively improve a first approach or compete with other players starting with the same dice distribution. You may load a library (TETRI.lib) or a directory (TETRI.dir). Advantage of the library is that you get its menu directly from the category GAMES on the APPS key. The directory is 200 bytes smaller. If a separate High score storage is needed for your partner playing on the same calculator, load both. TETRI uses the PICT environement. Hence, save your own graphic if necessary. --------------------------------------------------------------------------- NEW in version 2.2003 Level choose box now independent on real number display. NEW in version 1.2003 Turn-off suspension improved. When turning on, the 49 keeps waiting on a first key. In the library, |Seed| toggles store/recall. |MUTE| replaced by |SND?|. NEW in version 6.2002 The TETRI command sets the menu |NEW| |Pict| |->Seed| |Mute| |Top| |Same|. Mute/sound-switching also with +/- during the game. NEW in version 1.2002 A command |Same| has been added to repeat a lost game. ---------------------------------------------------------------------------- TETRI has a 1-page menu as follows: |New| |Pict| |Seed| |Snd?| |Top| |Same?| |New| starts a new game. |Pict| shows last graphic after a game. In the lib, |Seed| toggles recalling/storing your favourite real as a seed for the random sequence used if started with |Same|. In the directory, |Seed| is an ordinary global in which you may store any real as usual. |Top| shows the highest score. |Snd?| toggles sound/silent mode which can be done also during the game but is valid only till the game is over. |Same| repeats the last game if starting in the same level. The same dice distribution and the same dropping sequence. New or Same provide a choice of 10 start levels. To choose a level one may use a numeric key or the arrow keys. For instance, a start in Level 10 is realized by just tipping on the UParrow key. You run into the next level if the current one is successfully completed, i.e., if the number of lines displayed beneath LINES has been erased. Besides the arrow keys for moving the dropping figures and CANCEL for aborting, the following keys are active *during* a game. These are all somehow symbolized on the screen to remind on their existence. NXT interrupts the game to get time for deciding where to locate the figure, depending on the next piece shown to the left of the play box. Pressing NXT twice turns the 49 off; the game will be resumed at the next turn-on. +/- toggles sound/silent mode for the current game only. + pressed once or several times increases dropping speed. - decreases the dropping speed. The last speed will always be saved. Thus, dropping speed is readily adapted to your convenience. Do not too hasty move a figure to the left or right in the very upper part of the box - it may jump over the margin and the game is lost. A new High score is visually and acoustically announced. It is hidden and manipulation is normally impossible. Score rules for TETRI are simple. The higher the level, the higher the score after successfully completing a level. A bonus is added at the end, depending on the number c of clean lines at the moment of completion; the more lines are clean the higher the bonus. It is maximal for c=14, i.e., all dice have been removed in the very moment of completion. Exact score calculation below. When level n is lost, the game will be over. The last bonus is either 0 or n^2. ----------------------------------------------------------------------------- Wolfgang Rautenberg raut@math.fu-berlin.de www.math.fu-berlin.de/usr/raut CREDITS: Thanks to Daniel Lidström who ported TETRI from the 48 to the 49. ----------------------------------------------------------------------------- EXACT SCORE COMPUTATION IN LEVEL n: Each dropping adds n points to the score, each erased line 2n additional points. Precisely 2n+16 lines have to be erased. When successfully completing level n, a bonus of c(n+1)^2 points is added to the score where c is defined above. Hence, a completed level n contributes at least c(n+1)^2+n^2+2n(n+16)+2n(2n+16) points to the score.