Pontoon

This file is part of and Miscellaneous Programs. Download the collection to get this file.
Date: 198x
Type: Program
Platform(s): TS 2068
Tags: Game

Pontoon card game (a variation of vingt-un) for the TS2068 with graphically rendered playing cards built from 11 custom UDGs — four suit symbols, a checkerboard card back, and a set of rounded box-drawing corners and edges assembled into a 5×7 card frame. The player starts with $50 and antes $10 per round, choosing to Twist or Stick against a randomly generated dealer score rather than a dealt hand. Suit symbols are selected randomly from the four UDG slots on each deal, and twisted cards scroll across the screen with column wrapping. A decorative cash-balance box is drawn on the right side of the screen using the same box-drawing UDGs.

Analysis

Platform: TS2068. Uses PAPER/INK/BORDER, UDGs, and SAVE "PONTOON" LINE 1. The UDG range USR "a" to USR "k"+7 (11 UDGs) is TS2068/Spectrum standard.

What it is: A Pontoon (British Blackjack/21) card game with graphically rendered playing cards built from UDGs, and a running cash balance.


UDG Definitions (Lines 570–700)

The setup subroutine at line 570 loads 11 UDGs (\a–\k) from DATA. Their shapes:

UDGDATA bytesShapeRole
\a24,60,126,255,255,126,60,24Solid symmetric diamond♥ Hearts
\b24,60,90,255,255,90,24,60Diamond with internal cutouts♣ Clubs
\c16,56,124,254,254,124,16,56Asymmetric offset diamond♦ Diamonds
\d68,238,254,254,254,124,56,16Wide top, tapering point♠ Spades
\e204,204,51,51,204,204,51,51CheckerboardCard back
\f0,0,0,7,15,12,24,24Curve descending right╭ top-left corner
\g0,0,0,192,240,48,24,24Curve descending left╮ top-right corner
\h24,24,12,15,7,0,0,0Curve ascending right╰ bottom-left corner
\i24,24,48,240,192,0,0,0Curve ascending left╯ bottom-right corner
\j0,0,0,255,255,0,0,0Horizontal bar (mid-cell)─ horizontal edge
\k24,24,24,24,24,24,24,24Vertical bar (mid-cell)│ vertical side

The NOT PI trick in the DATA (lines 650–690) evaluates to 0 at runtime, since PI is non-zero and NOT of any non-zero value is 0 in Sinclair BASIC — a readable way to embed literal zeros without typing them.

The card frame assembled from these:

\f\j\j\j\g
\k suit \k
\k \k
\k val \k
\k \k
\k suit \k
\h\j\j\j\i

Rounded corners with suit symbol at top and bottom, face value in the middle — a neat compact playing card graphic.


Program Structure

LinesSection
10Load UDGs
20Set starting money ($50)
30Deal subroutine (screen setup, ante, deal prompt)
40–50Generate two random cards (value 1–10, random suit)
60–120Draw two initial cards side-by-side
130–320Twist/Stick input loop; draw additional twisted cards
340–430Dealer resolution and win/loss logic
440–460Broke screen
470–560Deal setup subroutine (screen, ante deduction, cash display, wait for D)
570–590UDG loader subroutine
600–700UDG DATA
710REM labeling the UDGs visually
1000SAVE

Game Logic

Each round costs $10 (line 480). Player starts with $50 — five rounds before going broke. Two cards are dealt; the player chooses Twist (take another card) or Stick. Additional twisted cards are drawn across the screen at column offsets tracked by p, wrapping if p>26. A bust (total > 21) is an immediate loss.

On Stick (line 340), the dealer’s “hand” is a single random number between 10 and 22 (INT(RND*13)+10) — not actual drawn cards. Dealer > 21 = dealer bust (player wins), dealer = 21 = “PONTOON!”, dealer > player total = dealer wins, otherwise player wins $50.

The cash display (lines 490–530) draws a decorative box in INK 1 (blue) on the right side of the screen showing the current balance.

Content

Related Products

Related Articles

Related Content

Image Gallery

Pontoon

Source Code

   10 GO SUB 570
   20 LET money=50
   30 GO SUB 470
   40 LET c1=INT (RND*10)+1: LET b$=CHR$ (144+(INT (RND*4)))
   50 LET c2=INT (RND*10)+1: LET c$=CHR$ (144+(INT (RND*4)))
   60 PRINT AT 11,2;"\f\j\j\j\g \f\j\j\j\g"
   70 PRINT "  \k";b$;"  \k \k";c$;"  \k"
   80 PRINT "  \k   \k \k   \k"
   90 PRINT "  \k ";(CHR$ 8 AND c1=10);c1;" \k \k ";(CHR$ 8 AND c2=10);c2;" \k"
  100 PRINT "  \k   \k \k   \k"
  110 PRINT "  \k  ";b$;"\k \k  ";c$;"\k"
  120 PRINT "  \h\j\j\j\i \h\j\j\j\i"
  130 LET tot=c1+c2: LET c3=INT (RND*10)+1
  140 PRINT AT 5,5;"T - Twist"
  150 PRINT AT 7,5;"S - Stick"
  160 IF INKEY$="t" OR INKEY$="s" THEN GO TO 180
  170 GO TO 160
  180 IF INKEY$="s" THEN GO TO 340
  190 LET tot=tot+c3
  200 LET b$=CHR$ (144+(INT (RND*4)))
  210 IF p>26 THEN LET p=2: CLS 
  220 PRINT AT 11,p;"\f\j\j\j\g"
  230 PRINT AT 12,p;"\k";b$;"  \k"
  240 PRINT AT 13,p;"\k   \k"
  250 PRINT AT 14,p;"\k ";(CHR$ 8 AND c3=10);c3;" \k"
  260 PRINT AT 15,p;"\k   \k"
  270 PRINT AT 16,p;"\k  ";b$;"\k"
  280 PRINT AT 17,p;"\h\j\j\j\i"
  290 IF tot>21 THEN PRINT AT 1,1;"BUST": GO TO 420
  300 LET p=p+6
  310 LET c3=INT (RND*10)+1
  320 GO TO 160
  330 STOP 
  340 LET cs=INT (RND*13)+10
  350 CLS 
  360 PRINT '"I have ";cs''"You have ";tot''
  370 IF cs>21 THEN PRINT "I have bust, You Win ": GO TO 410
  380 IF cs=21 THEN PRINT "PONTOON! ": GO TO 410
  390 IF cs>tot THEN PRINT "I win ": GO TO 410
  400 PRINT "You win $50!": LET money=money+50
  410 FOR k=1 TO 60: BEEP .008,k: BEEP .008,-k: NEXT k: GO TO 30
  420 PRINT "I win that game!"
  430 GO TO 410
  440 CLS 
  450 PRINT AT 10,7;"You're out of money"
  460 INPUT "press enter to play again "; LINE a$: RUN 
  470 BORDER 0: PAPER 4: INK 9: CLS 
  480 LET p=14: LET money=money-10: IF money<0 THEN GO TO 440
  490 PRINT AT 1,24; INK 1;"\f\j\j\j\g"
  500 FOR a=1 TO 6
  510 PRINT TAB 24; INK 1;"\k\e\e\e\k"
  520 NEXT a
  530 PRINT TAB 24; INK 1;"\h\j\j\j\i";AT 9,23;"Cash ";money
  540 PRINT AT PI,5;"D - Deal"
  550 IF INKEY$<>"d" THEN GO TO 550
  560 RETURN 
  570 FOR a=USR "a" TO USR "k"+7
  580 READ user: POKE a,user
  590 NEXT a: RETURN 
  600 DATA 24,60,126,255,255,126,60,24
  610 DATA 24,60,90,255,255,90,24,60
  620 DATA 16,56,124,254,254,124,16,56
  630 DATA 68,238,254,254,254,124,56,16
  640 DATA 204,204,51,51,204,204,51,51
  650 DATA 0,NOT PI,NOT PI,7,15,12,24,24
  660 DATA 0,NOT PI,NOT PI,192,240,48,24,24
  670 DATA 24,24,12,15,7,NOT PI,NOT PI,0
  680 DATA 24,24,48,240,192,NOT PI,NOT PI,0
  690 DATA 0,NOT PI,NOT PI,255,255,NOT PI,NOT PI,0
  700 DATA 24,24,24,24,24,24,24,24
  710 REM a\ab\bc\cd\de\ef\fh\gi\hj\ij\jk\k
 1000 SAVE "PONTOON" LINE 1

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

People

No people associated with this content.

Scroll to Top