--- title: "Tic Tac Toe (LISTing)" id: 79509 type: "computer_media" slug: "tic-tac-toe-listing" url: "http://localhost/computer_media/tic-tac-toe-listing/" markdown_url: "http://localhost/computer_media/tic-tac-toe-listing.md" published_at: "2026-11-22T14:40:54+00:00" modified_at: "2026-11-22T14:40:54+00:00" featured_image: url: "http://localhost/wp-content/uploads/2026/11/tic-tac-toe-1.png" excerpt: "Tic-tac-toe against the TS2068." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Paul Erickson" slug: "paul-erickson" taxonomy: "indiv" url: "http://localhost/indiv/paul-erickson/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Program" programmers: - name: "Paul Erickson" slug: "paul-erickson" taxonomy: "indiv" url: "http://localhost/indiv/paul-erickson/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Tic%20Tac%20Toe%20%28LISTing%29%20%281990%29%28Erickson%2C%20Paul%20T.%29%28TS2068%29%28Program%29.zip" tsrun_member: "Tic Tac Toe (LISTing) (1990)(Erickson, Paul T.)(TS2068)(Program)/Tic Tac Toe (LISTing) (1990)(Erickson, Paul T.)(TS2068)(Program).tap" mediadate: "1990" images: - url: "http://localhost/wp-content/uploads/2026/11/tic-tac-toe-1.png" - url: "http://localhost/wp-content/uploads/2026/11/tic-tac-toe-2.png" - url: "http://localhost/wp-content/uploads/2026/11/tic-tac-toe-3.png" - url: "http://localhost/wp-content/uploads/2026/11/tic-tac-toe-4.png" article_media: - id: 46118 title: "Tic Tac Toe" type: "article" url: "http://localhost/article/tic-tac-toe/" media_type_tags: "Game" license: false --- # Tic Tac Toe (LISTing) Tic-tac-toe against the computer, which plays X and always takes the first square. It looks for a winning move, then blocks, then plays its own pattern. It can be beaten. RUN it and type a square number from 1 to 9 at the cursor, then ENTER: 1, 2, 3 across the top row, 4, 5, 6 in the middle and 7, 8, 9 along the bottom. The game ends with I win, You Win or Draw; RUN plays again. Two punctuation marks that did not print properly in the newsletter are corrected in this copy: the colon in line 15, and a semicolon in line 40 that could also be read as a comma. Published in LISTing November 1990 ([Tic Tac Toe](https://timexsinclair.com/article/tic-tac-toe/)). ## Source Code ``` 10 REM Tic tac toe 13 GO SUB 1090 15 LET w=0: LET z=0: LET o=0: LET y=0: LET t=0: DIM d(3): LET k=1000 20 LET a$="X " 35 LET o=0: LET b$="X": PRINT AT 6,12;a$(1);AT 6,16;a$(2);AT 6,20;a$(3) 40 PRINT AT 9,12;a$(4);AT 9,16;a$(5);AT 9,20;a$(6) 50 PRINT AT 12,12;a$(7);AT 12,16;a$(8);AT 12,20;a$(9) 51 FOR x=1 TO 9: IF a$(x)<>" " AND w=0 THEN NEXT x: PRINT "Draw": STOP 55 IF w=1 THEN PRINT "I win": STOP 57 IF z=1 THEN LET z=0: GO TO 82 60 INPUT a 70 IF a<1 OR a>9 THEN GO TO 60 80 IF a$(a)<>" " THEN GO TO 60 81 LET a$(a)="O": IF z=0 THEN LET z=1: GO TO 35 85 IF t=1 AND a$(3)=" " THEN LET a$(3)="X": LET w=1: GO TO 30 86 IF a$(2)="O" AND a$(5)="O" AND a$(8)="O" THEN PRINT "You Win": STOP 87 FOR g=1 TO 20: IF g=10 THEN LET b$="O": LET k=1000 88 LET k=k+10: GO SUB k-10 90 FOR x=1 TO 3: IF a$(d(X))=b$ THEN LET o=o+1: NEXT x 95 IF x>3 THEN GO TO 105 100 LET s=d(x): NEXT x 110 IF o=2 AND b$="X" AND a$(s)=" " THEN LET w=1: LET a$(s)="X": GO TO 30 115 IF b$="O" AND o=2 AND a$(s)=" " THEN LET a$(s)="X": GO TO 30 120 LET o=0: NEXT g 130 IF a$(7)=" " THEN LET a$(7)="X": GO TO 30 132 IF a$(9)=" " THEN LET a$(9)="X": GO TO 30 135 IF a$(3)=" " THEN LET a$(3)="X": GO TO 30 140 LET h=INT (RND*9)+1: IF a$(h)<>" " THEN LET a$(X)="X": GO TO 30 150 GO TO 140 1000 LET d(1)=1: LET d(2)=2: LET d(3)=3: RETURN 1010 LET d(1)=4: LET d(2)=5: LET d(3)=6: RETURN 1020 LET d(1)=7: LET d(2)=8: LET d(3)=9: RETURN 1030 LET d(1)=1: LET d(2)=4: LET d(3)=7: RETURN 1040 LET d(1)=2: LET d(2)=5: LET d(3)=8: RETURN 1050 LET d(1)=3: LET d(2)=6: LET d(3)=9: RETURN 1060 LET d(1)=3: LET d(2)=5: LET d(3)=7: RETURN 1070 LET d(1)=1: LET d(2)=5: LET d(3)=9: RETURN 1075 LET d(1)=1: LET d(2)=5: LET d(3)=9: RETURN 1076 LET d(1)=3: LET d(2)=5: LET d(3)=7: RETURN 1080 LET k=1000: NEXT g: GO TO 125 1090 PRINT AT 2,11;"Tic tac toe" 1100 PLOT 87,111: DRAW 88,0 1110 PLOT 87,87: DRAW 88,0 1120 PLOT 116,64: DRAW 0,71 1125 PLOT 148,64: DRAW 0,71 1126 PRINT AT 16,8;"PAUL T. ERICKSON" 1130 RETURN ```