--- title: "Boolean Demonstration" id: 76351 type: "computer_media" slug: "boolean-demonstration" url: "http://localhost/computer_media/boolean-demonstration/" markdown_url: "http://localhost/computer_media/boolean-demonstration.md" published_at: "2026-11-11T08:03:08+00:00" modified_at: "2026-11-11T08:03:08+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/boolean-demonstration-1.png" excerpt: "See how the ZX81 treats true and false: enter two numbers and the program shows which comparisons are true and what AND and OR give." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "John Connell" slug: "john-connell" taxonomy: "indiv" url: "http://localhost/indiv/john-connell/" genre: - name: "Education" slug: "education" taxonomy: "genre" url: "http://localhost/type/education/" media_type: "Program" programmers: - name: "John Connell" slug: "john-connell" taxonomy: "indiv" url: "http://localhost/indiv/john-connell/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Boolean%20Demonstration%20%281982%29%28Connell%2C%20John%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1982" images: - url: "http://localhost/wp-content/uploads/2026/11/boolean-demonstration-1.png" - url: "http://localhost/wp-content/uploads/2026/11/boolean-demonstration-2.png" article_media: - id: 19366 title: "Boolean Demonstration" type: "article" url: "http://localhost/article/boolean-demonstration/" media_type_tags: "Education" license: false --- # Boolean Demonstration Enter a value for X and for Y. The program prints which of the comparisons it tries are true, and the values of X AND Y and X OR Y, which follow the ZX81’s rules (any non-zero number counts as true). Answer Y to AGAIN? to try other values; the article suggests 0, 1 and -1 in different pairs. The article explains how the 8K ROM’s AND and OR differ from other BASICs, and how to fit the program into 1K. Published in Syntax November 1982 ([Boolean Demonstration](https://timexsinclair.com/article/boolean-demonstration/)). ## Source Code ``` 5 REM "BOOLEAN DEMO" 10 PRINT "ENTER A VALUE FOR X." 20 INPUT X 30 PRINT X 35 PRINT 40 PRINT "ENTER A VALUE FOR Y." 50 INPUT Y 60 PRINT Y 70 IF X AND Y THEN GOSUB 300 80 IF X OR Y THEN GOSUB 400 90 IF NOT X THEN GOSUB 500 100 IF NOT Y THEN GOSUB 600 110 PRINT 120 PRINT "THE VALUE OF X AND Y IS . . "; 130 PRINT (X AND Y) 140 PRINT 150 PRINT "THE VALUE OF X OR Y IS . . "; 160 PRINT (X OR Y) 245 PRINT 255 PRINT "AGAIN? (Y/N)" 265 INPUT A$ 275 IF A$="N" THEN GOTO 1005 285 IF A$="Y" THEN GOTO 705 295 GOTO 70 300 PRINT 310 PRINT "X AND Y WAS TRUE." 320 RETURN 400 PRINT 410 PRINT "X OR Y WAS TRUE." 420 RETURN 500 PRINT 510 PRINT "NOT X WAS TRUE." 520 RETURN 600 PRINT 610 PRINT "NOT Y WAS TRUE." 620 RETURN 705 CLS 715 GOTO 10 1005 CLS 1015 PRINT "THE END" ```