3D Strategy

Products: 3D Strategy
Developer(s): F. A. Vachha
Date: 1983
Type: Program
Platform(s): TS 2068
Tags: Strategy

3D Strategy is F. A. Vachha’s three-dimensional noughts and crosses for Quicksilva: you and the computer take turns on a 4×4×4 cube, shown as four 4×4 boards labelled A–P across and 1–4 down, and the first to get four in a line in any direction wins. There are four levels from Beginner to Expert, a Tactical or Positional playing style, an auto-play mode in which the computer plays itself, a choice of who moves first, and time controls for the whole game or for each move. While it thinks, the computer shows its best move so far and its evaluation.

The instructions on this copy were edited to call it “the FIRST program for the TIMEX 2068” and the move prompt says “Timex first”, so this is a TS2068 adaptation of the Spectrum game.

Program Analysis

The BASIC loads a 600-byte block of example positions at 48988, shows the title and the instructions (with animated example lines drawn from that block at lines 8000–8040), and then loads the title screen and the 16 KB game at 32768 and starts it with RANDOMIZE USR 32768. The game copies part of itself into memory at 6300h and reads the keyboard through the ROM.

Potential Issues

  • As found, the adapted code called address 02E1h in the TS2068 ROM, which is not the keyboard scan, so no key was ever accepted at the “Level” prompt. This download changes that one call to the TS2068’s KEY-SCAN at 02B0h.

This copy came from a Larken disk. The disk prefixes were removed, the Quicksilva logo loader from the second disk runs first, and the keyboard call was corrected. Tested in ZEsarUX on a stock TS2068: setup, the computer’s replies and the clock work.

Related Products

Tic-tac-toe played on a 4x4x4 grid; four in a line needed to win.

Image Gallery

Source Code

    0 REM RESET  F.A.VACHHA 1983
    1 CLS : PRINT AT 9,7; FLASH 1;"PLEASE START TAPE": PRINT AT 14,7; INK 1;"The main  Program";AT 15,7;   "takes < 2 mins to";AT 16,14;"LOAD": INK 7: LOAD "3Dlogo.C$"SCREEN$ 
    2 PRINT AT 1,0: LOAD "3Dgame.C1"CODE : RANDOMIZE USR 32768
    3 INK 0: PAPER 7: CLS : BRIGHT 0: POKE 23675,255: PRINT FLASH 1;AT 11,14;"WAIT": INK 7: LOAD "3Dstrt.C1"CODE : INK 0: POKE 23658,8: PRINT AT 11,6; FLASH 1;"STOP THE TAPE NOW!": FOR N=-35 TO 50: BEEP .03,N: NEXT N: PAUSE 50: PAPER 7: BORDER 7: CLS 
    4 PRINT AT 0,5; INK 2;"Q U I C K S I L V A": PAUSE 25: PRINT INK 2;AT 1,10;"presents...": FOR n=50 TO -30 STEP -2: BEEP .02,n: NEXT n: PRINT INK 3; FLASH 1;AT 7,10;"3D STRATEGY": PRINT INK 1;AT 10,2;"A Multidimensional Mind Game";AT 13,7;"By F A Vachha BSc"
    5 PRINT AT 21,6;"INSTRUCTIONS - Y/N ?": GO SUB 9500: CLS : IF A$="N" THEN GO TO 1
    6 PRINT AT 2,0; INK 2; FLASH 1;"3D STRATEGY"; FLASH 0;" is the FIRST program",,"for the TIMEX 2068 Microcomputer",,"that will defeat the most highly",,"intelligent of Humans in a sheer",,"Battle of Wits..."
    7 PRINT AT 12,1; INK 2;"If your ego can stand the shock",,"of being bested by a small Micro",,"in a completely fair challenge ,",,"then this is the game for you."
    8 PLOT 128,39: DRAW INK 2;30,0: PRINT AT 21,0;"scroll?": FOR N=49451 TO 49521 STEP 2: BEEP PEEK N/4,PEEK (N+1)-5: IF INKEY$="" THEN NEXT N: PAUSE 200
   10 CLS : INK 2: PRINT AT 0,9;"SPECIFICATIONS"
   15 INK 0: PRINT : GO SUB 9000: PRINT "Incredibly strong - virtually   unbeatable at EXPERT level!!"
   20 GO SUB 9000: PRINT "Hyperfast playing speed - on    average uses <1.7 sec/move!!"
   25 GO SUB 9000: PRINT "Four levels of play, from L1    (BEGINNER) to L4 (EXPERT)"
   30 GO SUB 9000: PRINT "Even at its highest level of    play, never uses >55 secs/game"
   35 GO SUB 9000: PRINT "Two choices of playing style-   Tactical & Positional"      
   40 GO SUB 9000: PRINT "Two Automatic Chess Clocks on   the screen all the time" 
   45 GO SUB 9000: PRINT "Makes >200,000 decisions/move!"
   50 GO SUB 9005: PRINT "Switchable Time Control system  - either set a time limit per   individual move (Blitz),or per  game (Tournament), or Off"
   55 GO SUB 9000: PRINT "Match system with cumulative    scores, Auto-reset & Auto-1st   Move Decider( computerised      coin toss to settle draws )"
   60 GO SUB 9000: PRINT "Defined-depth superfast alpha-  beta pruning, coupled with an   ultrarefined Static Position    Evaluator Function (EVAL) &     a ruthless Killer Heuristic"
   65 GO SUB 9000: PRINT "High speed MOVGEN subroutine    can generate >25000 moves/sec!"
   70 GO SUB 9000: PRINT "Capable of an amazing 18-ply    look-ahead, when the position   warrants such deep examination"
   75 GO SUB 9005: PRINT "The entire program, MOVGEN,     EVAL, & LOGIC are in compact,   highly-efficient Machinecode"
   80 GO SUB 9000: PRINT "Equipped with a comprehensive   Openings library - it refers    to this in YOUR time!!"
   84 GO TO 90
   85 GO SUB 9000: PRINT "Works on 16K & 48K Spectrums -  on the 16K machine, uses every  available byte, including UDG,  P.Buffer, even the Screen (!)   for the MOVGEN/EVAL scratchpad"
   90 GO SUB 9000: PRINT "The program self-starts"
   95 GO SUB 9000: PRINT "It plays only legal moves"
  100 GO SUB 9000: PRINT "It accepts only legal moves"
  105 GO SUB 9000: PRINT "Auto penalties ( level-based )  for entering non-legal moves !"
  110 GO SUB 9005: PRINT "Accepts Resignations"
  115 GO SUB 9000: PRINT "Automatically recognises &      declares both Wins & Draws for  each side"
  120 GO SUB 9000: PRINT "Graphically displays board &    coordinates in colour.Displays  moves graphically, alpha-       numerically....even audibly!"
  125 GO SUB 9000: PRINT "Also shows Score, Level, Style  Move no:, Colour to move, last  move made, Times taken ( yes,   the clocks even tick! ), Time   Control (if set), etc etc etc"
  130 GO SUB 9000: PRINT "Autoloss if the time limit is   exceeded or if the game is      unattended for > 4min 15sec"
  135 GO SUB 9000: PRINT "Control over who plays first"
  140 GO SUB 9005: PRINT "A fresh match can be initiated  at will, at any time"
  145 GO SUB 9000: PRINT "Sophisticated Randomiser which  ensures games are not repeated  There are >>1,000,000,000,000,  000,000,000,000,000,000,000,    000,000,000,000,000,000,000     different games possible, even  after excluding reflections &   rotations!!"
  150 GO SUB 9000: PRINT "Synthesised sound effects,      varying with level & outcome" 
  155 GO SUB 9000: PRINT "Can communicate very flexibly,  via 15 different messages. You  are at liberty to input moves   in either order (ie, N2 OR 2N)  Intentionally, deletion and/or  retraction of part-made moves   has been made impossible"
  156 GO SUB 9005: PRINT "Audible progression of tempo    as the time control is neared"
  157 GO SUB 9000: PRINT "A quite unique feature - while  it is thinking, the computer    displays the best move it has   found so far, & its numerical   evaluation (from +0 to +11111)  of the position. This allows    you to actually see how the     computer decides on its move    as it looks deeper & deeper!"  
  158 GO SUB 9000: PRINT "AUTO-PLAY mode - you can set    your computer to play itself,   while you sit back & watch!!    AUTO-PLAY works at all 4 skill  levels, both on Tactical & on   Positional settings. Combined   with the last feature, AUTO-    PLAY is both instructive and    loads of fun!"
  159 PRINT : PRINT : PRINT : PRINT : PRINT : PRINT 
  160 PRINT : CLS : PRINT AT 0,9; INK 2;"INSTRUCTIONS": BEEP .5,40
  165 PRINT : PRINT "  The rules of 3D-Strategy are  essentially those of Noughts &  Crosses, played in 3 dimensions on a 4*4*4 cube. To win, you    must get 4 of your symbols in a straight line (Hor/Vert/Diag)."
  170 PRINT "  Your symbol is "; INK 1; FLASH 1;"x";: PRINT "; mine  is "; INK 2; FLASH 1;"o"
  175 PRINT "  Squares are identified by     their coordinates, ie A-P & 1-4   There are 4 levels of skill:-"
  180 PRINT "L1  BEGINNER   Good for trainingL2  ADVANCED   Quite challengingL3  MASTER     VERY  challengingL4  EXPERT     The Ultimate One"
  182 PRINT "AUTO-PLAY mode switches your    computer to playing itself."
  185 PRINT "  There are 2 playing styles:-": PRINT "Tactical (TAC) plays an active, risky game. You should defend   calmly & then counterattack."
  190 PRINT : CLS : PRINT "Positional (POS) plays a deep,  strategic game, & is extremely  hard to outwit."
  195 PRINT : PRINT "  You can preset Time Controls  for a match. In response to the prompt, press:"
  200 PRINT INK 3;"T"; INK 0;", followed by the duration in   mins, to set a maximum time for you to make ALL your moves"
  205 PRINT INK 3;"I"; INK 0;", followed by the duration in   secs, to set a maximum time for each individual move (Blitz)"
  210 PRINT INK 3;"N"; INK 0;", if no time control is wanted": PRINT : PRINT " Durations must be between 1 & 9"
  215 PRINT "  To resign in mid-game, use theR key. The best move found so   far & the EVAL no: are displayedwhile the computer is thinking.": PRINT "Now for some illustrative lines.Make sure you understand them!"
 8000 PRINT : CLS : FOR C=39 TO 183 STEP 48: FOR N=23 TO 55 STEP 8: PLOT C,N: DRAW 32,0: NEXT N: FOR D=0 TO 32 STEP 8: PLOT D+C,23: DRAW 0,32: NEXT D: NEXT C
 8010 FOR N=15 TO 18: PRINT INK 3;AT N,3;N-14;AT N,28;N-14: NEXT N: PRINT INK 3;AT 20,5;"ABCD  EFGH  IJKL  MNOP"
 8015 LET Z=6*INT (48.383*ACS RND)+48988: FOR J=Z TO Z+3: LET B=PEEK J
 8020 INK J-Z+1: LET A=16*INT ((B-1)/16): LET C=B-A: LET G=INT ((C+3)/4): LET A=INT (A/4)+C+68-4*G: PRINT AT 13,7+5*(J-Z);G;CHR$ A;" -"
 8030 LET V=INT ((B-1)/16): LET X=B-16*V: LET Y=4*INT ((X-1)/4): PRINT OVER 1; FLASH 1;AT INT ((X-1)/4)+15,6*V+4+X-Y;"*": BEEP .01,40: NEXT J
 8040 INK 0: PRINT AT 13,25;" ";AT 5,5;"Another example - Y/N ?": GO SUB 9500: IF A$="Y" THEN GO TO 8000
 8070 CLS : PRINT AT 7,3; FLASH 1;"Instructions again - Y/N ?": FOR N=0 TO 50: BEEP .004,N: NEXT N: GO SUB 9500: IF A$="Y" THEN GO TO 160
 8080 GO TO 1
 9000 PRINT "  .............................."
 9005 BEEP .02,45: PRINT INK 4;"* ";: RETURN 
 9500 LET A$=INKEY$: IF A$<>"Y" THEN IF A$<>"N" THEN GO TO 9500
 9510 RETURN 
 9992 SAVE "3Dmain.B2" LINE 3
 9994 REM SAVE 3Dstrt.C1CODE 48988,600: SAVE 3DlogoCODE 32768,6912: SAVE 3DgameCODE 32768,16384
 9998 REM  was LKDOS-only

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