12.07.2015 Views

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

page-1983-101-timex-sinclair-programming-tricks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

37 Gee Whiz I: Smart AdderThese six programs, in this section of the book, makeup our Gee Whiz series. One of the fun ways to use yourTIMEX is in wowing your friends. Next time they ask,"But, what can it do?", show them its uncanny abilities atadding, spelling, writing upside down, even crackingjokes. Try these six Gee Whiz programs on your friends.You'll love their reactions.Smart Adder is the first in the series. When yourneighbor drops in for a cup of coffee, bring out the TIMEXfor a demonstration of its lightning speed.This program adds long strings of numbers in a flash.You give the computer a number. It starts at 1 and adds allnumbers up to and including your number. For instance, ifyou give it a five, it will add 1 plus 2 plus 3 plus 4 plus 5and display the result.Ask your neighbor how fast he or she can add all thenumbers to 100. It should take several minutes. Whilehe's working on it, let your TIMEX do it in a split second.Your neighbor's reaction is bound to be, "Gee whiz!"Program Listing10 LET X=ftf20 PRINT nGIVE ME A NUMBER"30 INPUT N40 FOR L=l TO N50 LET X=X+L60 NEXT L70 PRINT80 PRINT nTHE TOTAL OF 1 TO n;N;n IS n;X90 PRINT100 CLEAR110 GOTO 1055

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!