--- title: "Hangman (Syntax)" id: 76451 type: "computer_media" slug: "hangman-syntax" url: "http://localhost/computer_media/hangman-syntax/" markdown_url: "http://localhost/computer_media/hangman-syntax.md" published_at: "2026-11-11T08:02:38+00:00" modified_at: "2026-11-11T08:02:38+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/hangman-syntax-1.png" excerpt: "Classic Hangman for the ZX80: one player types a secret word, the other guesses letters while the gallows go up." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "ZX80" slug: "zx80" taxonomy: "post_tag" url: "http://localhost/tag/zx80/" model: - name: "Sinclair ZX80" slug: "zx80" taxonomy: "model" url: "http://localhost/model/zx80/" indiv: - name: "Richard Van Workum" slug: "richard-van-workum" taxonomy: "indiv" url: "http://localhost/indiv/richard-van-workum/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Program" programmers: - name: "Richard Van Workum" slug: "richard-van-workum" taxonomy: "indiv" url: "http://localhost/indiv/richard-van-workum/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Hangman%20%281981%29%28Van%20Workum%2C%20Richard%29%28ZX80%29%28US%29%28Program%29.zip" mediadate: "1981" images: - url: "http://localhost/wp-content/uploads/2026/11/hangman-syntax-1.png" - url: "http://localhost/wp-content/uploads/2026/11/hangman-syntax-2.png" - url: "http://localhost/wp-content/uploads/2026/11/hangman-syntax-3.png" article_media: - id: 19760 title: "Hangman" type: "article" url: "http://localhost/article/hangman-2/" media_type_tags: "Game" license: false --- # Hangman (Syntax) RUN and type the secret word at WORD?; the screen then shows a dash for each letter. The other player answers LETTER? one guess at a time. Right letters are filled in; each wrong letter is listed and adds a part to the gallows and the hanging figure. Guess the whole word and the program prints WINNER. On the eleventh wrong guess the figure is complete and the program shows the word and stops. Words of up to 14 letters fit comfortably. Published in Syntax May 1981 ([Hangman](https://timexsinclair.com/article/hangman-2/)). ## Source Code ``` 10 PRINT "WORD?" 15 INPUT A$ 40 LET Z=0 50 DIM T(25) 55 DIM D(11) 60 FOR X=0 TO 25 65 LET T(X)=220 70 NEXT X 80 LET G$="▌" 100 CLS 104 LET A=0 105 LET Q=0 106 LET N=0 110 LET T$=A$ 115 LET X=CODE(T$) 120 LET N=N+1 122 IF NOT CODE(T$)=CODE(G$) THEN LET A=A+1 125 IF X<30 OR X>63 THEN GO TO 170 130 PRINT CHR$(T(X-38)); 135 IF T(X-38)=220 THEN LET Q=Q+1 140 LET T$=TL$(T$) 160 GO TO 115 170 IF X=1 THEN GO TO 190 175 PRINT CHR$(X); 180 GO TO 140 190 PRINT 191 IF Q=0 THEN GO TO 520 195 IF A=N THEN GO SUB 250 196 GO TO 301 200 PRINT "LETTER?" 210 INPUT G$ 220 LET T(CODE(G$)-38)=CODE(G$) 230 GO TO 100 250 LET Z=Z+1 251 LET D(Z-1)=CODE(G$) 252 RETURN 301 PRINT "▄▄▄▄▄▖" 303 LET R=0 304 FOR K=1 TO Z 305 GO SUB 400+R 306 LET R=R+2 307 NEXT K 308 PRINT 310 FOR L=1 TO Z 311 PRINT CHR$(D(L)); 312 NEXT L 313 PRINT 315 GO TO 200 400 PRINT " ▌" 401 RETURN 402 PRINT " )"; 403 RETURN 404 PRINT "O"; 405 RETURN 406 PRINT "(" 407 RETURN 408 PRINT " +" 409 RETURN 410 PRINT " V"; 411 RETURN 412 PRINT "▒"; 413 RETURN 414 PRINT "V" 415 RETURN 416 PRINT " ▒" 417 RETURN 418 PRINT " X "; 419 RETURN 420 PRINT "X" 421 PRINT 500 PRINT A$ 501 STOP 520 PRINT "WINNER" 521 STOP ```