Games Sampler

Products: Games Sampler
Date: 1983
Type: Cassette
Platform(s): TS 1000
Tags: Game

This collection contains four separate BASIC programs stored together: a biorhythm calculator, a side-scrolling fly-swatting game, a symmetrical pattern generator, and a freehand drawing utility. The biorhythm program computes physical (23-day), emotional (28-day), and intellectual (33-day) cycles from birth and forecast dates, plotting sine-approximated waveforms using ASCII characters across a 28-column display. The Kamikaze Fly game scrolls a fly sprite rightward across the screen while the player fires a projectile upward from a frog character using the M key, tracking separate frog and fly scores. The Navaho Rugs program generates random rectangular regions filled with block graphic characters, applying fourfold symmetry by mirroring each fill across both axes simultaneously. The Sketch Pad program implements a cursor-based drawing tool using I/M/J/K for directional movement and H/D/0 to select filled, halftone, or blank drawing characters.


Program Analysis

Program 1: Biorhythms

This program calculates and plots the classic three biorhythm cycles — physical (23 days), emotional (28 days), and intellectual (33 days) — for a given birth date and forecast date. It prompts for two dates, computes a day-count difference, then renders each cycle as a row of characters scrolling across columns 0–27.

Biorhythm Structure

The program is organized into a main body (lines 10–270) and a shared input subroutine at line 800. The subroutine is called twice: once with K=1 for the birth date and once with K=2 for the forecast date. The variable D accumulates a modified Julian-style day count used for cycle phase calculation.

The date-to-day conversion at lines 890–930 uses a compact formula. Line 890 adjusts the year for months before March (to handle the February/leap-year boundary). Line 900 computes an elapsed-day total incorporating leap-year correction via INT(T/4) - INT(T/400). The month offset table is encoded as character codes in L$=" 303232332323", where each character’s ASCII code provides a per-month day-count addend iterated in the loop at lines 910–930. This avoids a DATA/READ structure entirely.

Biorhythm Plotting

Lines 160–260 iterate over the three cycle identifiers in L$="MEP". For each cycle, the period is taken as CODE P$(J), where P$="50*" encodes the ASCII values of the characters ‘5’ (53), ‘0’ (48), and ‘*’ (42) — close approximations to 23, 28, and 33 divided by some factor… actually the values 53, 48, and 42 are used directly as cycle lengths in screen-column units, with the vertical position computed at line 230 as ABS(Y - CODE P$(J)/2) + 8 - CODE P$(J)/4, producing a triangular-wave approximation of a sinusoid mapped to screen rows 8–18.

Program 2: Kamikaze Fly

This is a real-time action game in which a fly sprite scrolls rightward across the screen and the player fires a projectile upward from a stationary frog at the right edge. The program runs in SLOW mode (line 3) and uses a tight main loop with no explicit timing delay.

Kamikaze Fly Structure

  • Lines 10–30: Erase previous fly position and advance X by 2 each iteration.
  • Lines 40–50: Check for M keypress to activate bullet (B=1).
  • Lines 60–100: Move bullet upward (decrement P) and draw it; check for off-screen.
  • Lines 110–220: Handle fly reaching right edge — increment miss counter L, reset fly to left with random row.
  • Lines 230–294: Handle hit detection when fly reaches column 28 and P=Y — animate explosion, increment frog score F, reset bullet.
  • Lines 300–350: Bullet reaches top (P=0) — clear column, reset bullet.
  • Lines 400–480: Initialization — draw frog sprite with block graphics, set counters to zero.

The fly sprite uses block graphic characters ▚▞ rendered at AT Y,X, occupying two character cells. The frog is drawn with a multi-line block graphic image at lines 400–420 using characters including , , , , , and . Hit detection at line 230 uses exact equality of P (bullet row) and Y (fly row), which is functional but requires the fly to be at exactly column 28 simultaneously.

Notable Anomaly in Kamikaze Fly

Line 470 sets P=2 (initial bullet position near top), then line 475 sets B=F where F=0 at startup, so the bullet starts inactive. This means the bullet begins at row 2 but dormant, which is intentional — it will not draw until M is pressed. The [~~] tokens in lines 260 and 270 represent inverse video characters used for the explosion effect.

Program 3: Navaho Rugs

This program generates an infinite sequence of randomly sized and positioned rectangular fills using a single block graphic character, with fourfold reflective symmetry applied to each plotted point. The effect produces kaleidoscopic rug-like patterns that continuously overwrite each other.

Navaho Rugs Technique

For each rectangle, four PRINT statements are issued per cell at lines 80–95, mapping position (Y, X) to all four quadrants via (21-Y, 31-X), (Y, 31-X), and (21-Y, X). The character set A$=" [▒]█▒█ " provides a range of density from space through halftone to solid block, and a random index J selects one per rectangle. The rectangle’s origin (A, B), width T, and height Q are all independently randomized, with T and Q scaled relative to A and B respectively, keeping rectangles partly within screen bounds on average.

Program 4: Sketch Pad

A straightforward interactive drawing program using a polling input loop. The cursor position is stored in X (column) and Y (row), and the current drawing character B$ defaults to the solid block . Each iteration redraws the current cell and polls INKEY$.

Sketch Pad Key Mapping

KeyAction
IMove cursor up (Y−1, wraps at 0→21)
MMove cursor down (Y+1, wraps at 21→0)
JMove cursor left (X−1, wraps at 0→31)
KMove cursor right (X+1, wraps at 31→0)
DSet draw character to solid block █
HSet draw character to halftone [▒]
0Set draw character to space (erase)

Line 5 waits for any active keypress to clear before entering the main loop, preventing accidental input carry-over from program startup. The main loop at lines 40–200 always prints the current character before checking input, which means the cursor leaves a trail — this is the intended drawing behavior rather than a cursor overlay.

Common Structural Patterns Across All Four Programs

  • Each program ends with a SAVE followed by RUN, allowing re-saving and immediate restart.
  • All programs avoid arrays, using string character-code tricks or direct variable reuse for data storage.
  • Screen layout is managed entirely with PRINT AT; no CLS is used during gameplay in any program.
  • Random number generation via RND is used in three of the four programs (all except Sketch Pad).

Content

Appears On

Related Products

Four games. Kamikaze Fly: A dexterity game in which Freda the Frog tries to eat dinner. Sketchpad: An easy to...

Related Articles

Related Content

Image Gallery

Source Code

   1 REM BIORHYTHMS
   2 REM COPR. [1][9][8][2] EMERSON AND STERN
  10 LET D$=" DATE:"
  20 LET A$="BIRTH   FORECAST"
  30 LET Y$="MONTH:DAY:  YEAR: "
  40 LET L$=" 303232332323"
  50 LET K=1
  60 GOSUB 800
  70 LET N=D
  90 LET K=K+K
 100 GOSUB 800
 110 LET N=D-N
 125 PRINT AT 8,0;"[1][2][3][4][5][6][7][1][2][3][4][5][6][7][1][2][3][4][5][6][7][1][2][3][4][5][6][7]"
 130 LET P$="50*"
 132 FOR Y=19 TO 21
 134 PRINT AT Y,0;"        "
 136 NEXT Y
 160 LET L$="MEP"
 170 FOR J=1 TO 3
 180 LET Y=INT (N+CODE P$(J)/4-1)
 190 LET Y=Y-CODE P$(J)*INT (Y/CODE P$(J))
 200 FOR D=0 TO 27
 210 LET Y=Y+1
 220 IF Y>=CODE P$(J) THEN LET Y=0
 230 LET K=ABS (Y-CODE P$(J)/2)+8-CODE P$(J)/4
 240 PRINT AT K,D;L$(J)
 250 NEXT D
 260 NEXT J
 270 STOP
 800 PRINT AT 19,0;A$(8*K-7 TO 8*K)
 810 PRINT AT 20,0;D$
 820 PRINT AT 21,0;"MONTH:"
 830 INPUT M
 840 PRINT AT 21,0;"DAY:  "
 850 INPUT D
 860 PRINT AT 21,0;"YEAR: "
 870 INPUT Y
 875 LET Y=Y+(Y<100)*1900
 880 IF K=1 THEN LET Z=Y
 885 PRINT AT 19+K,8;A$(8*K-7 TO 8*K);D$;M;"/";D;"/";Y
 890 LET T=Y-(M<3)
 900 LET D=(Y-Z)*365+INT (T/4)-INT (T/400)+D
 910 FOR J=1 TO M
 920 LET D=D+CODE L$(J)
 930 NEXT J
 940 RETURN
 1000 SAVE "BI[O]"
 1010 RUN 
 
   1 REM KAMIKAZE FLY [C][O][P][R][.]1982 EMESON AND STERN
   3 SLOW
   5 GOTO 400
  10 PRINT AT Y,X;" ▚▞"
  20 PRINT AT Y,X;"  ▚▞"
  30 LET X=X+2
  40 IF INKEY$ ="M" THEN LET B=1
  50 IF B=0 THEN GOTO 110
  60 LET P=P-2
  70 IF P=0 THEN GOTO 300
  80 PRINT AT P,28;"[▒]"
  90 PRINT AT P-1,28;"[▒]"
 100 IF X=28 THEN GOTO 230
 110 IF X<>30 THEN GOTO 10
 120 LET L=L+1
 130 PRINT AT 20,6;L
 200 LET X=0
 210 LET Y=2*INT (1+7*RND)
 220 GOTO 10
 230 IF P<>Y THEN GOTO 110
 240 FOR J=P-1 TO 18
 250 PRINT AT J,28;" "
 260 PRINT AT J+1,28;"[~~]"
 270 NEXT J
 275 PRINT AT Y,29;" "
 280 LET F=F+1
 285 PRINT AT 19,6;F
 290 LET P=20
 292 LET B=0
 294 GOTO 200
 300 FOR J=0 TO 18
 310 PRINT AT J,28;" "
 320 NEXT J
 330 LET P=20
 340 LET B=0
 350 GOTO 110
 400 PRINT AT 19,26;" ▟[~~]▙"
 410 PRINT AT 20,26;"▗▟█▙▖"
 420 PRINT AT 21,26;"▀   ▀"
 430 PRINT AT 19,0;"[F][R][O][G]: 0"
 440 PRINT AT 20,0;"█[F][L][Y]: 0"
 445 PRINT AT 21,5;"PRESS  M  TO FLICK"
 450 LET F=0
 460 LET L=F
 470 LET P=2
 475 LET B=F
 480 GOTO 200
 500 SAVE "FL[Y]"
 510 RUN 
 
   5 REM NAVAHO RUGS:[C][O][P][R][.]1982             EMERSON AND STERN
  10 LET A$=" [▒]█▒█ "
  20 LET A=15*RND
  30 LET B=10*RND
  40 LET T=A*8*RND/15
  45 LET J=1+4.5*RND
  50 LET C$=A$(J)
  55 LET Q=B*8*RND/10
  60 FOR X=A TO A+T
  70 FOR Y=B TO B+Q
  80 PRINT AT Y,X;C$
  85 PRINT AT 21-Y,31-X;C$
  90 PRINT AT Y,31-X;C$
  95 PRINT AT 21-Y,X;C$
 100 NEXT Y
 110 NEXT X
 120 GOTO 20
 200 SAVE "RUG[S]"
 210 RUN 
 
   1 REM SKETCH PAD:[C][O][P][R][.]1982           EMERSON AND STERN
   3 PRINT AT 20,0;"D:DARK H:LIGHT 0:BLANK"
   4 PRINT AT 21,0;"I:UP M:DN J:LFT K:RGHT"
   5 IF INKEY$ <>"" THEN GOTO 5
  10 LET X=15
  20 LET Y=10
  30 LET B$="█"
  40 PRINT AT Y,X;B$
  50 LET C$=INKEY$ 
  60 IF C$="" THEN GOTO 50
  70 IF C$="H" THEN LET B$="[▒]"
  80 IF C$="D" THEN LET B$="█"
  90 IF C$="0" THEN LET B$=" "
 100 IF C$="I" THEN LET Y=Y-1
 110 IF Y<0 THEN LET Y=21
 120 IF C$="M" THEN LET Y=Y+1
 130 IF Y>21 THEN LET Y=0
 140 IF C$="J" THEN LET X=X-1
 150 IF X<0 THEN LET X=31
 160 IF C$="K" THEN LET X=X+1
 170 IF X>31 THEN LET X=0
 200 GOTO 40
 300 SAVE "PA[D]"
 310 RUN 

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

People

No people associated with this content.

Scroll to Top