--- title: "Basic Topics" type: "article" slug: "basic-topics" url: "http://localhost/article/basic-topics/" markdown_url: "http://localhost/article/basic-topics.md" published_at: "2020-10-27T17:09:33+00:00" modified_at: "2026-06-21T23:25:54+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Is It A Number? By Fred Nachbaur The following routine contains a trap to insure that you enter a number. This is useful in math drill programs, to prevent cheating by entering an expression. The BASIC interpreter will accept the question as the answer by evaluating the expression for you. For example, in response to…" category: - name: "SyncWare News" slug: "syncware-news" taxonomy: "category" url: "http://localhost/category/periodicals/syncware-news/" post_tag: - name: "1984" slug: "year-1984" taxonomy: "post_tag" url: "http://localhost/tag/year-1984/" - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Fred Nachbaur" slug: "fred-nachbaur" taxonomy: "indiv" url: "http://localhost/indiv/fred-nachbaur/" - name: "Paul Bingham" slug: "paul-bingham" taxonomy: "indiv" url: "http://localhost/indiv/paul-bingham/" publication: "SyncWare News" publication_r: id: 10245 title: "SyncWare News" type: "periodical" url: "http://localhost/periodical/syncware-news/" authors: "Fred Nachbaur; Paul Bingham" volume: "2" issue: "1" issues_articles: - id: 26680 title: "SyncWare News v2 n1" type: "issue" url: "http://localhost/issue/syncware-news-v2-n1/" pages: "3" pubdate: "Sept-Oct 1984" archive_link: false volumeissue: "v2n1" --- # Basic Topics ### Is It A Number? By Fred Nachbaur The following routine contains a trap to insure that you enter a number. This is useful in math drill programs, to prevent cheating by entering an expression. The BASIC interpreter will accept the question as the answer by evaluating the expression for you. For example, in response to the question, “How much is 2+2?”, by INPUTing 2+2, the computer will accept it as the correct answer. This routine eliminates the chance of the + being INPUT as part of a valid response. This also holds true for any character other than numbers. Another trick in this program is the way it prints to the screen. It POKEs the display file directly. To insure proper execution, this routine needs a padded out (full) display. (PEEK 16400+256*PEEK 16401)- (PEEK 16396+256* PEEK 16397) should equal 792, If you don’t have 16K, then POKE 16389,100, to fake it. ``` 5 SLOW 10 LET B=PEEK 16396+256*PEEK 16397+762 20 LET E$="ILLEGAL ENTRY" 100 PRINT "ENTER A NUMBER" 110 INPUT D$ 120 IF D$="" THEN GOTO 170 130 FOR C=1 TO LEN D$ 140 IF D$(C)<>"." AND (CODE D$(C)<28 OR CODE$(C)>37) THEN GOTO 170 150 NEXT C 160 GOTO 300 170 POKE 16418,0 180 FOR C=1 TO LEN E$ 190 POKE B+C,CODE E$(C) 200 NEXT C 210 POKE 16418,2 220 GOTO 100 300 LET D=VAL D$ 310 PRINT ,,D,,"THANK YOU" ``` ### 2068 Felt Hat By Paul Bingham Paul sent along this little cutie. This is an excellent 3D play around program. Z is the third dimension, running along the length of the hat, setting the lines apart by a certain amount. This value can be changed by the STEP value in line 30. C is the value that gives the curvature to each Z value before it is plotted. A slight change in the .033 value in line 60, can have a dramatic effect. F holds the parameters for where each line starts and stops. Adjusting the initial and ending values of L in the loop in line 50, will dramatically adjust the size of the hat “brim”, Altering the STEP value in line 50, will give you more or less points on each line. A higher number means a quicker run and therefore less time consuming for making adjustments. Lines 70 and 80 hold the final values to be PLOTted on the screen. Changing these values will center or stretch the hat in different ways. Have fun! ``` 10 REM Felt Hat for 2068 20 BORDER 1: PAPER 1: INK 6 30 FOR Z=-142 TO 150 STEP 12 40 LET L=INT (SQR (ABS (1-(Z*Z)/22500))*176+.5) 50 FOR F=-L-3 TO L+4 STEP 4 60 LET C=SIN (.033*SQR (Z*Z+F*F))*30 70 LET X=220-(240+Z-F)/2.5 80 LET Y=Z/6+110+C 90 PLOT X,Y 100 NEXT F 110 NEXT Z ```