CATS
CAPITOL AREA TIMEX/SINCLAIR USERS GROUP
NEWSLETTER
$1.00 per сору Please support your computer- JOIN CATS!
4 Vol 3, No. 4 July 1986
Ф „ „ CONTENTS + „ +
Science Fair Students...........2 Du Celestial Mechanics.
From the E ditor.... Welcome our New Officers!
New officers of the club were elected at last month’s meeting. They were: Tom Bent, President; Hank Dickson, 15% VP; Harry Harrison, 2nd VP; and Ruth Fegley, Treasurer. 1/11 continue on as Editor, with Sarah Fisher and Bob Curnutt on the production end. We are still for a volunteer to supervise duplication of the club library tapes.
ble II need support from all of you to make the next year a success. 1f you have an idea for a meeting presentation, let Tom or Hank Know. If you have an idea for an article, send it in! I want to especially thank Roald Schrack and H.E. Weppler for their consistent fund of new and interesting articles.
looKing
Prepare for August!
1711 be leaving town by July 18: articles for the August issue will have to reach me at least five days before that.
Last month's Meeting, and Next:
In addition to electing officers, we had an illuminating trio of talks һу science fair contestants that had used Computers in their projects.
_ Further details оп page 2 I haben“ t talked with Tom to find out just what he’s planning for next month, but I do know one thing — our meeting hall is
C.A.T.S.
More formulas for Vu-Calc 2068..9 Input prompts with variables....9 Cr vp t ogr aun 7
AIR CONDITIONED! There^l! be a cool space for you to come and join us and keep the spirit alive!
New Product Announcements:
If you have been going around in circles trying to hook up that unknown printer, LOGICAL SOLUTIONS of Gaithersburg (301) 977-1510 may be able to help build a cable to hook it up. They have a library of 1500 pin-outs for various devices.
CURRY COMPUTER has sent further details on their line of Pyramide software, to wit, QL PEINTRE. This program allows you to obtain graphics on the QL that rival those of the other 68000 machines. Also by Pyramide, VROOM, a graphic racetrack game, and OTHELLO. Also news of TECHNIGL, a CAD package for the QL, and ASSEMBLER WORKBENCH, a m/c assembler/ disassembler/ debugger. (602) 978-2902
TAS BAM User s Group has sent out news of a major upraade of Tom Wood’s PRO FILE. With his permission, it has been adapted to the Rotronics Wafa-drive. The upgrade is available from Mr. George Fetherman, 5956 45th Ave. North, St. Petersburg FL 33709 for $11.00 incl s&h. (813) 546-4278 This is the upgrade only - full documantation is availabe from Tom Wood.
p
1 July
Science Fair Students Spark Fancy of CATS
Featured at the June CATS meeting were three area science fair participants who described to the group how they successfully used small computers in carrying out their respective science projects.
These gifted young students brought their displays, set up all their equipmnent and gave extremely well-organized presentations, just as though they were addressing a large and friendly battery of judges.
JOSHUA ENGEL, Eleanor Roosevelt HS, Greenbelt, MD *An Easier PI*
Joshua became interested last summer in the mathematical abstraction known as "PI', and decided to make it the subject of his science fair project.
He described to us the refinement of pi from its earliest biblical reference down to the work of David Bailey who, at NASA's Ames Research Center last year, calculated pi to 29,360,128 places.
1n searching through area libraries, including school, public, and U. of Maryland, he found volumes of material about pi, including some learned journals devoted to almost nothing else.
He also located 16 different "series" of pi which "converged" with varying degrees of and ease. Thus some were " er* than others, especially those he code-named "Рі-15" and 51167.
He develoj a computer program for his Osborne using the "С" language, and also implemented it using "C-Basic*, which offered up to eleven decimal places for convergence. His Osborne was calculating some of these convergences while he was speaking.
Asked what standard for pi is used in space exploration, he replied that the classic 22/7ths is often good enough. During Voyager's probe of Uranus, using pi to 6 decimal places got the craft within 5 teet of its target. Using pi to 35 decimal places will, in calculating the circumference of the solar system, be acccurate to 1 one-millionth of the diameter of a proton, he pointed out.
When queried what he liked most about his subject, Joshua replied, *Pi is an irrational number, and I identity strongly with irrationality."
Joshua will be a junior next year.
C.A.T.S.
The CATS members were fascinated.
We were also delighted to have as our guests the fathers of two of the exhibitors: Mr. AARON ENGEL and Mr. GEORGE L. WOOLEY, Sr. who, as it turns out, have been with their sons in the same Boy Scout troop for many years!
GEORGE L. WOOLEY, Jr., Kenmoor MS, Landover, MD *A Traptickovic Network"
As George explained, he happens to live in a house with a whole lot of small computers. So a natural thing to attempt for his science fair project was to try to make all of them communicate with each other
He pulled together the following machines: (1) TRS-80, (2) Apple II, (3) Timex/Sinclair, (4) Commodore PET, and (5) VIC-20.
His purpose was to try to send and receive a Simple message between all of them without using phone lines or modems.
He started digging into the the kinds of signals generated by the five computers in terms of timing, pitch and duration. He also ined these signals using an cccilliscope.
After his empirical investigations, he concluded the two best candiates for computer-to-computer communication were the PET and the VIC-20. Of the others, the next closest was the TRS-80. Не found that these three share the same general family of signals suitable for audio interfacing.
George proposed that for connecting a group of computers in the same school building, the most practical thing would be to have tape-oriented devices at each end to capture messages in a non-tended mode.
The audience was genuinely amused when George explained, for the second time, what a
"Traptickovic* network was! e cryptographic use of the letters in all the machines he used.
Next year George will be in the 8th grade.
continued on p.3
2 July
Officers & Functionaries
President Vice-President Vice-President Treasurer
N/L Editor N/L Production
Contributors
H.L. Schaaf Н.Е. Weppler George White
Hank Dickson Mark Fisher Roald Schrack
Tom Bent Hank Dickson Harry Harrison Ruth Fegley Deadlines Mark Fisher Sarah Fisher Bob Curnutt
Newsletter Meeting Date
Corresp Secy. Mike Cohen July 12 July 16 August 9? August 29 September 13 September 26 October 11 FOR SALE
1. TS1000 COMPUTER W/16K,OVERLAY KEYBOARD,MANUAL - $50 2. TS2068 COMPUTER, WIRED FOR RGB OUTPUT,MANUAL - $85 3. TS2020 ТАРЕ RECORDER + 20 TAPES - $25
4. TS2040 PRINTER + 4 ROLLS PAPER
5. TS PUBLICATIONS:
- $35
TECHNICAL MANUAL FOR TS2068 - $15
THE WORKING TS2068,DAVID LAURENCE - $7
ESSENTIAL GUIDE TO T/S HOME COMPUTERS,P.MORSE - $6 T/S COLOR GRAPHICS,NICK HAMPSHIRE - $9
TS2068 INTERM/ADVANCED GUIDE,JEFF MAZUR - $6
JACK HYSONG, PHONE (301) 774 3934
DAVID KULP, W.T. Woodson HS, Fairfax, VA "Acoustical Testing, An Engineering Experiment"
David's science fair project was inspired by the rebuilding of his school auditorium which created such bad acoustics that an acoustical engineer had to be called in to salvage it.
David is a percussionist in his school's music organizations, and is acutely aware of the absence or presence of good acoustics.
He posited it should be practical to put together @ mathematical model which could predict what a finished room (or assembly hall) would produce in terms of acoustics.
He researched what constitutes acoustical acceptability, talked with four professionals in the field who deemed his undertaking unique, and set out.
Using his Sinclair 2068 and a 2040 printer, he Created a singularly outstanding program. He found the key to the architechtual problems in this area were encapsulated in the factor called “reverberation time".
The program he developed uses environmental factors such as wall surface as well as the presence of chairs, carpeting, and people. After the 2068 operator has introduced these factors via non-hostile menus, bar charts can be produced depicting the resultant range of sound.
David also devised a LOGO-like language to produce a drawing of the room being analyzed which plots the movement and reverberation of the sound waves as though they were demonstrating fluid dynamics.
C.A.T.S.
———M—— ا ĩ
David says that after seven months, he is glad to set this project aside e and move on to other things. He doesn't know if his future portends engineering or computers, although he certainly has displayed skill at both.
David will be a senior next year.
At the conclusion of the presentations, the guests were presented small mementoes of their visit and were, by acclimation, voted into honorary membership in CATS. David Kulp, already er of CATS, will have his current
ip generously extended.
---C. D. Dickson
CRYPTOGRAM Solution : 1N3IN3^NO2 ATI 33 S.LI 108 '3310ndW02 3H1 NO 514318039 ANOA TW 3149718 01 1921H13 38 LON AYLI 11
53 July
DUEL By Mark Fisher
Prologue:
Long, long ago, in a city far away... А young nan read of an intriguing algorithm tor simulating motion on graph paper. This article was written by Martin Gardner in The Scientific American. At the time, it had been implemented on college nainfranes in the form of a race track gane, but the real interest was that anyone could implement it using nothing nore than a pencil and graph paper.
As the young man was then going to Cal, and had nothing better to do, he extended the rules to sinulate a battle between two ships in space. Unfortunately, the rules, while clear, were complex; and few people could master them well enough to see the elegance of the game. The young man soon learned that it was most interesting as a solitaire game, and gradually found other things to interest him...
In 1978, every Radio Shack in the country was displaying a computer that anyone could own. But what use was it? I couldn't think of anything that would justify $400.00...
In 1982, Timex put on its push for the TS 1000. Advertising leered out of all sorts of magazines, and real examples began to appear in local stores. It became obvious that what had seemed ridiculous claims for the 2X81 were true - and at under $100.00! І thought of that Spacewar game l'd fiddled with, and realized that if 1 programmed the rules into the computer, 1 wouldn't have to educate each person about addition of vectors before they could play the game. And so, mainly for that reason, | bought one.
Readers of this n/1 may be aware that I’ve had a few other
projects that developed after 1 got the 1000. In the meantime, 1 became confortable with BASIC and machine code. Graphics, data handling, even animation might be needed to inplement Spacewar. Slowly, as other projects waxed and waned, ! built up an idea of what I wanted to do with the game.
The result is DUEL. It’s not all 1 could wish for; 1 would like to see versions that allowed real-time movenent, or that allowed two separate computers, linked through a MODEM, to contro] the "ships" in the gane; but it’s an engrossing introduction to the basic idea.
The Progran DUEL uses a nunber of the specialized abilities of the TS
2068, and a few tricks that speed up some of the BASIC.
1. Character arrays are used to store the coordinate sequences that Keep track of the ships and missiles, This allows a single string slicing operation to shift the values to their new positions for each move, rather than a FOR-NEXT series of transfers.
2. DEF FN is used to quickly move numerical values out of the character array where they are stored.
3. ON ERR is used for two purposes: To allow the plotting of vectors that go off the screen without disrupting program flow, and later, to allow the 2068 to recover if a division by zero is encountered in calculating closest approaches.
C.A.T.S.
4. STICK is decoded in an unusual way. As the bit values returned by STICK describe the position of the joystick, I POKE the value returned by STICK into address 14384 (which just happens to be the first byte in the display tile), thus setting or resetting the first eight pixels of the d file. I then use POINT to pick up the individual pixel values,
5, Mode (NER 1 is used. This allows me to erase PLOTted lines by re-PLOTting them.
Program flow
On RUN, the ON ERR and DEF FN {lags are set, then the program juaps to the main title section (8000-8290). At this time data is initialized, and an option to view further instructions (8600-8830) is given. Following that, the operator has a choice of опе or two joysticks. 14 (1) is pressed, both ship #1 and ship #2 are controlled by stick 1. 14 (2) is pressed, stick 1 controls ship #1 and stick 2 controls ship #2. Both the initialization and instructions are in high BASIC to speed up the operation of the main loop.
The program then cycles through the main loop (1000-1120), making excursions to the various subroutines as needed. The subroutine NEARMISS (3000-3090) was developed from formulas generated by Murray Barasch. In it the motion of two bodies is examined to see if they have reached a point of closest approach or not. I don’t pretend to understand why it works.
The actual points of operation of the program are pretty well described in the REM statements. I needed them to Keep track of what I was doing as 1 developed the program. Line numbers are regular because of the renumbering routine (9000- 9120). The mc referred to in Jine 1100 and the SAVE-LOAD section (9610-) is the AERCO print driver, All functions of the program are in BASIC, and all references to the print driver can be left out.
M you get this going, let me Know. I'd like to Know how far my baby gets.
NF а з Ship Z ры Missiles = di os
— ш JA P Missiles
Ship
PttttTtPLAYER #1 SHIP | MOVES TE ttt
Damage =@ Fuel =195 Ship #2 was damaged two moves ago. As seen in the upper right corner, damage was 3. 1f damaged, a ship cannot maneuver, but it can still fire missiles. Damage is reduced one point per move. The dumbell shape records the positions of the missile and ship when the missile detonated. (Ship and missile tracks over four moves old are erased for clarity.) ;
continued . 4 July 09:5
10 ВЕН x3 ие] MIT eee 20 REM Бу Mark Fisher, (c) 1986 Math by Murray Barasch 30 ON ERR 60 TO 9500 40 DEF FN v(a,b,c)=CODE a$(a,b,c): REM Value 50 DEF FN d(c)=FN uta, b, )- v(a,b,c#2) 60 60 TO 8620 100 REM ** Get Coordinates жни 110 LET x=FN va, b,): LET y-FN v(a,b,7): LET oN va, b, 9): L ET oy-FN v(a,b,9) 120 LET dx-x-ox: LET dy=y-oy 130 RETURN 300 REM AA stick reading Haan. 310 LET px=0: LET ру=0: REM Pointer x,y 320 POKE 16384, STICK (1,r) 330 LET px=pxts#((POINT (4,175) AND px<2 AND px*x 62254) -( POINT (5,175) AND p0-2 AND x-pxd=1)) 340 LET py=py+sa((POINT (7,175) AND py(2 AND pysy (173) -CPDINT (6,175) AND py)-2 AND у-ру)=2)) 350 PLOT x,y: DRAW Bxpx/s,Bxpy/s 360 LET ex= STICK (2,7) 370 PLOT x,y: DRAW 8tpx/s,8%py/s 380 IF ex=0 THEN 60 TO 320 390 RETURN 1000 REM A i Main loop I Н+ 1010 FOR a-1 TO 2: IF q$-'2* THEN LET r=a 1020 INK аж2+3 1030 IF a$(a,1,3)=" COPY * THEN 60 SUB 2500: LET piz0: LET py=0 + 60 TO 1090: REM ship gone but missiles active 1040 IF a$(0,1,3)=" COPY * AND a$(0,2,1)=" COPY * AND a$(0,3,1)= * COPY * THEN 60 TO end: REM other Ship gone and no nissiles 1050 GO SUB 2000: REM get missile firing orders 1060 60 SUB 2500: REM nove & update missiles 1070 INK 2222 1080 60 SUB 4000; REM get ship move 1090 60 SUB 4500: REM Move ship 1100 IF INKEYS-'s" THEN RANDOMIZE USR 64628: REM Copy screen 1110 LET oca: NEXT a 1120 GO ТО 1000 2000 REM ZII izt Get Missile coords numum 2010 LET b-1: 60 SUB 100: IF a$(a,1,2)=CHRS 0 OR a$(a,1,3)=" COP Y " OR a$(0,1,3)=" COPY * THEN RETURN : REN find parent ship 2020 PRINT W1;AT 0,03")))))))>PLAYER #";a;" MISSILE bist. =" РМ Ca,, % x FN „(, 1,5), Missiles = "РМ v(a,1,2);" ° 2030 LET 31: 60 SUB 300: REM s=step size 2040 PRINT #1АТ 0,0;,, 2030 IF NOT FN v(a,1,2) OR (px-D AND ру=0) THEN RETURN : REM No missile fired 2060 LET a$(a,1,2)-CHRS (FN v(,1,2)-1) 2070 IF a$(a,2,1)-CHR$ 255 THEN GO TO 2100: REM fire 82 2080 IF a$(a,3,1) OCHR$ 255 THEN LET b-3: LET tx=0: LET ty=0: Р LOT x,y: 60 SUB abort: REM if two other, abort #3 2090 LET a$(a,3)=a$(a,2) 2100 LET a$(a,2)-CHR$ g. CE (px*3)4CHRS. (pyt3)53$(a,1,4 TO ): R EN Fuel ,xky ain, and past movement 2110 RETURN 2500 REM paniimnaiipdite missile novenentdximninnanr 2510 LET ao: LET be: 60 SUB 100: LET ac(NOT a-D41: LET sxex: LET sy=y: LET sox=ox: LET soy=oy 2520 FOR b=2 ТО 3: 80 SUB 100: IF a$(a,b,D-* COPY * THEN 60 TO
C.A.T.S.
2620: REM 1¢ missile is inactive, skip update 2530 IF NUT FN v(a,b,1) THEN LET a$(a,b,2 TO 3)CHR$ O+CHR$ 0: REM if no fuel, no accel 2540 LET tx=(FN v(a,b,2)-3)*5+dx: LET ty=(FN v(a,b,3)-3)+5+dy: L ЕТ metxtx: LET пу={узу: REM Get new points.. 2550 60 SUB nearmiss 2560 PLOT х,у: DRAM tx, ty 2570 IF t(=1 THEN GO SUB check: 60 SUB abort: 60 ТО 2620 2580 IF mx)253 OR mx<2 OR ny)173 OR my<2 THEN 60 SUB abort: 60 TO 2620: REM and check that it is not off screen 2590 IF a$(a,b,12 TO 15) Oa$(2,1,12 TO 15) THEN PLOT FN 90, b, 0 „N мба, b, 15): DRAW PN d(12),FN 013): REM If track is differe nt from ship, erase track 2600 LET a$(a,b,8 ТО )-a$(a,b,4 TO ): REN move track data 2610 LET a$(a,b,4 TO 7)-CHR$ ABS dx+CHR$ ABS dy*CHR$ mxsCHR my: IF a$ta,b, DOCHRS 0 THEN LET a$(a,b,1)=CHRS (CODE a$(a,b,1)-1) 1 REM Update fuel& nex points 2620 NEXT b 2630 LET b-1: RETURN 2800 REM жаннан abort missile +з 2810 FOR c-14 TO 8 STEP -2: REM Erase aborted missile 2820 IF a$(a,b,c-2 TO с-1))а$(а,1,с-2 TO c-) THEN PLOT FN v G,b,O ,FN v(a,b,c41): DRAW FN d(c-2),FN dtc-1) 2830 NEXT c 2840 LET a$(a,b,1)=" COPY * 2850 PLOT x,y: DRAW tx,ty 2860 RETURN 3000 REM женене nearniss inania 3010 LET meos=(tx) (SOR (bosco (ty) aC ty))) 3020 LET msin=(ty)/(SOR (Су) ty)4 (tx) tx))) 3030 LET scos=(sx-sox)/(SOR ((sox-sx)& sox-sx) 4 (soy-sy) & soy-sy) » 3040 LET ssin=(sy-soy)/(SOR ((soy-sy) &s0y-sy)4(sox-sx) i sox-ee) » 3050 LET nv-50R (txetxttyžty) 3060 LET sv-SÜR ((sox~sx)#(sox-sx)+(soy-sy)#(soy-sy)) 3070 LET t=- {x-s0x)#( (avancos) -svtscos)) (y-soy) & (nvansin)-(s v¥ssin)))/((nvanvtsvasy)-(2amvasy#(mcos#scostnsinissin))) 3080 IF te! THEN LET txetxst: LET tystyat 3090 RETURN 3200 REM жаннннненє check miss rana 3210 LET metxsx: LET myetysy 3220 LET sx=soxtt¥sviscos 3230 LET sy=soy+tžsvžssin 3240 LET dx=sx-nx: REM Dist missile to opposing ship 3290 LET dy=sy-ny: REM Dist nissile to opposing ship 3260 IF ABS @х‹8 AND ABS dy(8 THEN ORAM dx, d; CIRCLE 8178758: 60 SUB boon 3270 RETURN 3500 REM 1x88 boom Pee 3510 LET a$(0,1,3)=CHRS (FN '(о,1,3)+2+(А8$ dx<4)+(ABS dy (4)) 3520 CIRCLE nx,ny, 3: PRINT 4154T b, 00 07% SHIP 5205 HI T ,/-*?'#$Damage z";FN v(0,1,3), bist. "ИМТ dx;" x "SINT dys" : PAUSE 200 3530 LET go -f v(0,1,3): PRINT OVER O;AT 1,2:d(1) ТАВ 28 1902): IF FN v(o,1,3)44 THEN RETURN 3540 FOR i=2 TO 10 STEP 3: CIRCLE mx ny, i: NEXT i 3550 PRINT OVER O;AT 1,7;* Ship ";0;' destroyed ": IF a$(0,1,3) ¢" COPY * THEN LET k(aJ=k(a)+i
continued on р.6 5 July
3560 LET a$(0,1,3)=" COPY '
3570 IF a$(0,2,1)=" COPY * AND a$(0,3,1)-" COPY " THEN 80 TO en @: REM if no active missiles, stop.
3580 RETURN
4000 REM z Ship Move r - eee 4010 60 SUB 100: REM find parent ship
4020 PRINT #1;АТ 0,0;"*******PLAYER #";a;" SHIP MOUE*^*^*^*; FLA SH FN v(a,1,3)21;" Damage ="sFN v(a,1,3); FLASH FN vta,1,10(20:" Fuel z';FN v(a,1, D ;TAB 21;"М55] = *SFN v(3,1,2)
4030 IF a$(a,1,1)=CHR$ 0 OR 38 (a, 1,30) Cs 1 THEN PAUSE 80: LET px-0: LET py-0: RETURN : REM if damage or no fuel, no accel 4040 LET s=2: 60 SUB 300: LET px=px/2: LET py=py/2: REM coarser step than missile
4050 RETURN
4500 REM +###+#+#+++ирба!е ship movement HHHHHOHOHHOHEHEEHHHEHNGH E 4510 PLOT FN v(a, 1,14) FN оа, 1,15): DRAW FN d(12),FN 913): CIR CLE FN v(2,1,0) ,FN v(a,1,7),2: REM erase track
4520 IF a$(a,1,3)z* COPY * THEN LET a$(a,1,8 TO )za$(a,1,6 TO ) : 60 TO 4420
4530 LET nx=pxž5tdx+FN v(a,1,6): LET my=py#itdy#FN via 1,7): REM Get new points..
4540 LET a$(a,b,1)=CHR$ (CODE a$(a,b,1)-S#(ABS px) AND CODE a$(a 6,10)
4550 LET a$(a,b,1)=CHR$ (CODE a$(a,b,1)-5#(ABS py) AND CODE 230 b,1)): REM reduce fuel if burned
4560 IF FN v(a,b,3)20 THEN LET ы Q=CHR$ (CODE a$(a,b,3)-1 ): REM reduce danage
4570 IF mx)253 OR mx<3 OR пу›173 OR "m THEN LET a$(a, , 30 -CHR : 4: LET oa: 60 TO boom: REM and check that it is not off scree
im LET dx=ABS (FN уба, 1,6) -F v(0,1,600: ship
4590 LET dysABS (FN v(a, 1,7) -FN v(o,1,7): REM Dist to opposing
ship
4600 LET а%(а,1,4 TO )-CHR$ dx#CHRS dy*CHR$ mx*CHRS mysa$(a 1,6
T0»
4610 PLOT FN va, 1,8), N v(a,1,9): DRAW FN d(6) ,FN G): CIRCLE
FN vba, , FU v(,1,,2
4620 RETURN
8000 REM #ензжнивнневнвнннне Setup IPHEHEHEHOPHHRRRHHRRHE RE 8010 OVER 1: BORDER 0: PAPER 0: INK 7: CLS
8020 60 SUB 8500
8030 DIM 4$(2,3,15 : DIM k(2D
8040 DIM d(2): LET х=0: LET у=0: LET bel: REM x,y=screen coord,b zship or missile select flag
8050 LET dx=0: LET dy=0: LET o-2: REM xky movement from last pos ; o=other player
8060 RESTORE 8100: FOR a=1 TO 2: FOR c=1 TO 15
8070 READ x
8080 LET a$(a,1,c)=CHR$ x
8090 NEXT c: NEXT a
8100 DATA 250,10,0,255,255,3,87,3,87,3,87,3,87,3,87: REM ship #1 9110 DATA 250,10, 0,285,259, 252,87, 252,87, 252,87 ,252,87,252,87: R EM ship #2
8120 FOR b2 Т0 3
8130 LET a$(1,b)-CHR$ 25553$(1,1,2 TO ): LET a$(2,b)-CHR$ 255+a$ (2,1,2 T0 )
8140 NEXT b
8150 LET abort=2800
РЕН Dist to opposing
C.A.T.S.
8160 LET nearmiss=3000
8170 LET check=3200
8180 LET boon=3500
8190 LET end=9560
8200 PRINT #1;АТ 0,0; (Destruct ions, (1)-(2) Sticks";,,,: PAUSE
0: LET g$=INKEY$: LET rz1: CLS
8210 IF NOT (q$-'1' OR q$-'2') THEN 60 TO 8600
8220 CIRCLE 252,87,1: CIRCLE 3,87,1: PLOT 3,3: DRAW 249,0: DRAW
0,169: DRAW -249,0: DRAW 0,-169
8230 PRINT AT 1,23d(1);TAB 28;902): LET =1: FOR i=1 Т0 2
8240 FOR a=! Т0 2
8250 GO SUB 100: READ px: READ py
8260 DATA 1,0,-1,0,1,0,-1,0,1,-1,-1,1,1,-1,-1,1
8270 60 SUB 4500
8280 NEXT a: NEXT i
8290 60 TO 1000
8500 REM FHI titles PHHEHPRPHPEPHHEPUPÓHEHPUHHHEPHHHHURH HIGH E
8510 PRINT AT 2,10; TTT * Duel + mnn
8520 PRINT AT 5,15;*by*," Mark Fisher*,*
1985'/'* You are fighting a space duel. Each ship has 10 missi
les and equal fuel."
8530 PRINT * Missiles have proximity fuses-
f they pass within 8 units."
8540 PRINT * If damaged, you cannot change
still fire missiles."
8550 PRINT * If you go out of bounds, you
8560 RETURN
8600 REM AAA Instructions ase ROT
8610 CLS : PRINT * Joysticks“ ^ "Joysticks control direc
tion of thrust of ships and missiles."
8620 PRINT gc tua] direction is the functionof total accelerati
on applied tothe vehicle."
8630 PRINT be missiles are aimed through 1é points:“
8640 DATA 2,0,2,-1,2,-2,1,-2,0,-2,-1,-2,-2,-2,-2,-1,-2,0,-2,1,-2
52,71,2,0,2,1,2,2,2,2,1
8650 RESTORE 8640: FOR iz! TO 16: PAUSE 5: PLOT 40,60: READ x: R
EAD y: DRAM 10%x 108: NEXT i
8660 PRINT AT 18,0;"And ships are aimed through 8
8670 DATA 1,1,1,-1,0,-1,-1,-1,-1,0,-1,1,0,1,1,1
8680 RESTORE 8670: FOR iz! TO 8: PAUSE 10: PLOT 210,60: READ x:
READ у: DRAW 10%x, 107 NEXT i
8690 PRINT "Press FIRE to enter desired vet-tor.“;
8700 PAUSE 100: PRINT #1;AT 0,0;"Try it now, using STICK 1. Pres
s FIRE for more:
8710 CIRCLE 130,60,3: LET rz1: LET s=1: LET x=130: LET у=60: 60
SUB 300
8720 CLS : PRINT ’*Aiming nissiles:*^^*1) If aim vector is not p
Jotted, а nissile will not be fired. To skip missile firing
press FIRE without moving stick.”
8730 PRINT ^*2) A ship may only maintain 2
hird is fired the oldest missile will be
8740 PRINT ''3) Initial missile direction is
e ship’s notion, added to the nissile
8750 PRINT ') Missiles will be aborted when
pproach target."
8760 PRINT #1;"<P) to play, (ENTER) to continue": PAUSE 0: LET q
$=INKEY$: IF q$-'p* THEN 60 TO 8040
8770 CLS : PRINT "Ships'''"Ship speed is built up by suc- cessi
continued on p.7
they will explode i course, but you can
will be destroyed."
points:“
nissiles: lf a t aborted." determined by th ain vector," they no longer a
< July
ve foreward accelerations, If you accelerate five times — forew ard, " 8780 DATA 150, 10,0, 255, 255, 30,87, 30,87, 30,87, 30,87, 30,87: REM sh ip M
8790 RESTORE 8780: FOR c=! TO 15: READ x: LET a$(1,1,c)=CHRS x: NEXT c
8800 LET az1: LET o=2: LET bel: FOR і=1 TO 5: 60 SUB 100: LET px =1: LET py=0: 60 SUB 4500: NEXT i
8810 INPUT "Press ENTER" ;q$: PRINT ""- it will take five moves t о return to a stop."
8820 LET рх=-1: FOR i=1 Т0 5: 60 SUB 100: 80 SUB 4500; NEXT i 8830 GO TO 8040
9000 REM знн Renumber and Save OHHOBRDPHEHEHOBHEHHHHE 9010 INPUT "Start ";start
9020 INPUT "End ";end
9030 IF епд)=9000 THEN LET end-9000
9040 INPUT "Start renumber using "jn
9050 LET x=PEEK 23635+256#PEEK 23636
9060 IF PEEK x#256+PEEK (x+1)(start THEN GO TO 9110
9070 IF PEEK хж256+РЕЕК (x+1))=end THEN STOP
9080 POKE x,INT (n/256)
9090 POKE x*1,n-PEEK x#256
9100 LET п=п+10
9110 LET x=x+4+PEEK (x42) PEEK (43)
9120 60 TO 9060
9500 REM ження error handling EHPHRHERHEOHHHEHHEHRRHHR A 9510 ON ERR RESET
9520 IF PEEK 23739-21 OR PEEK 23739=9 THEN 60 TO 9560: REM гері ay?
9530 IF PEEK 23739=4 THEN LET t=1
9540 ON ERR GO TO 9500
9550 60 TO PEEK 23736+256#PEEK 23737+1
FD
9570 PRINT AT 3,8; Score is *;К(1);* to *;К(2);ТАВ 8; Play again 2 n)
9580 IF INKEY$-"y* THEN 60 TO 8040
9590 IF INKEY$-n* THEN STOP
9600 GO TO 9580
9610 REM зз start up FREE TEAR REE R EEEE EE EEEE EEEE EE EEEE OO A G 9800 CLEAR 64255: LET p=64261: POKE 26704,INT (p/256): POKE 2470 3,p-CINT (p/256)4256) : LOAD Cb
9810 RUN
9900 CLEAR : SAVE "duel" LINE 9800: SAVE 'prcode'CODE 64255,1111 9910 PRINT "rewind and verify:*^^: VERIFY "duel": VERIFY "prcode "CODE
9999 INK 7: LIST 2500
а Ship 8 destroyed 7 Shyer Hines —— Mj Я Е
71 TTT TPEHNTER H1 SHIP HOUETTTTTT Damage G Fuel =135 Мз! = 2
As shown, ship #2 has now been destroyed. Ship #1 must still evade the two missiles fired by #2, however.
Your One-stop
Hours: Mon - Fri: 9AM - 6PM Sat: 10AM - 3PM Sun: Closed
9600 Baltimore Blvd., College Park, Maryland 20740
C.A.T.S.
for the radio amateur and enthusiast. Reasonable prices.
Credit terms available for recognized companies.
ELECTRONICS PLUS
Electronic Parts Store
T Full line electronic components nk, fon "EP and test equipment. 799 nd T ax ‘Al, 00 Wa ne dt 549 nae А Sy Parts and equipment А
(301) 441-9009
7 July
CELESTIAL MECHANICS ON THE 2058
The Halley's comet code inspired me to examine celestial mechanics further. The Halley code was based on the known elliptical path of the comet. Mewton showed that this elliptical path was caused by the inverse square law of gravitational attraction. That is, the gravitational force F between any two bodies is of the form:
F= g*mi*mB/(r*r) where the m's are the masses of the two bodies, g is the gravitational constant and r is the distance between the bodies. in this code one of the masses represents the sun, ms. The other mass can represent a satellite of the sun, a planet, a comet, or an interloper from Outside our solar system. If the satellite is "captured" by the sun and cannot escape, the orbit is an ellipse; if the satellite can escape, then the orbit is a hyperbola. Other force laws will result in different orbits.
In this code you choose the starting position and velocity, and the satellite will then describe an orbit determined by the inverse square law force. When the satellite is nearest the sun the total energy is calculated. А "+" or "-" is written in the upper left-hand corner of the screen to indicate the energy of the sattelite. If "+" then the satellite will escape; if "-" it will be captured. I have written the code so that the path is only within the screen boundaries but this could be altered. The starting value of x has been made 127 but this also can be changed to suit your preference.
Note that the space between the succesive orbit positions is further apart as the satellite nears the sun showing that it travels with higher velocity. The code thus also illustrates Kepler's laws of planetary motion. Orbit calculations are very sensitive to accumulated error, so the precision of the 8068 will restrict the accuracy of the calculations. А nice repeating elliptical orbit is obtained for y=10,vx=1 but reducing vx to 0.6 will show precessing orbits due to the introduction of errors. Keeping y=10 and increasing vx to values greater than 1.42 will result in "escape" hyperbolic orbits with positive energy.
One can change line 125 to represent different force laws such as 1/r and 1/r^3. The accompanying table gives the starting parameters for some sanple cases.
Roald A. Schrack
See also "Double Sun" Sept. ^84 CATS Newsletter C.A.T.S.
КЛ & trac
t 4m cm
T s a CIE C e Ca H ia t i P FU
SAMPLE ORBIT PARAMETERS Y X VW DT M F note 10 187 1 З 100 ir^ a 10 127 .6 3 100 / b 1.13 100 1/r c 1.3 3 100 іл d 50 127 1.0 0.5 10 17 e 0.8. f 1.0 9
& 3 100 171 3 100 1/г^3
Notes: for the first two cases use the code as shown. The values of X,DT,MS,and the force law must be changed in the code.
a. is a typical ellipse b. isa precessing ellipse c. is a hyperbola d. is a circle 9. petal shaped orbits f. double loop
g. hair pin These samples are just what
1 found in a few minutes. Vary the Parameters and see what you find.
£3 July B
UVU-CALC 2868 коон : FOR HORE FORMULA |
fis it comes from TIMEX {Psion} you сап enter 1825 formuias, then “NO more room ror formulas" wiil keep you From going further.
Gniy 3 POKES are needed to get ifs formuias.
From a “coid” program with an empty spreadsheet, use йо io get out of the spreadsheet, then i to get to BASIC.
How make the Foiiowing POKES: PORE 39151, POKE 38482. 1
PĒKE 33587128
GOTO 9589 takes uou into a neu U-UHLC spreadsheet mith гоол For 108 formuias.
To salvage a spreadsheet with data and formula it possibie. Here's how I did E
guit to basic as above, and then entered everything in the immediate mode £5 a5 not to mess With anu line numbers. First nd uhere the data ends
a PRINT PEEK bfre + PSOIPEEKT resi! Hake a note af this.
ii refer to it as nnnnn, as it
formula up by each new formuia
B n TO 54825 SIEF -i: БОКЕ ii 455} ,PEEK i: NEXT
The formuis pointers aise have ia be increased bu 56 {ite so FOR i-54b525 TO 54825 STEP LET a=-55+PEEK i + 2564PEEK (isil: POKE ii213,IMTÍía/255!- POKE i,3-2554PEEK {i +31} :MEXT i
Now add 55 io the bfg pointer: а=55+РЕЕК bfre4255-PEEK ibfre+i): POKEibiredi), INT (a/256): POKE brire,a-25n5s PEEK (bfre+il
Now make the same 3 POKES that were used for the Blank UU-CHLC Spreadsheet.
SOTO gen shouid now iet you enter 28 more formula and work with your existing data.
There аге а coupie of things we can do now to “enhance” the Program by having it inform us about our formulas room when me use the #8, and some other tidy messages. Here's a Listing for tines I've changed to suit me.
= PRINT INPUT
C.A.T.S.
VARIABLES IN INPUT PROMPTS
This is not а neu discovery but, because it is not mentioned in the 2958 User Manual, I feet that it is not used as widely as 11 might be.
Variables may һе included in an Input prompt by enclosing the Prompt іп parentheses. That is, With INPUT (X)1;B the prompt wili be the value of variabie X and With INPUT iYX);B it will be the string vatue Of variable YX.
feasible to combine numeric апа string variables, along with other characters. For example, іп an accounting Program the prompt might be:
“AIN; TAB 22;
It is
(INC Poe Bini
Then, when N=4 and when N=5 the prompts would appear аз:
ta INTEREST REC. 8 HS DIVIDENDS REC. =
The amounts entered wouid be stored in 8141 and Вб) respect- ively.
H.E.WUeppier
CRYPTOGRAM YM NOT DEM PS ASHT SMZYLOR ME
PRONS ORR TECH XHEPRSNU ED MZS LENXCMSH, PCM YM'U HSORRT
LEDASDYSDH.
GRAH” TAB ET CTAB 9; INPUT
ЖЫ; CLEAR Ч zd or P RETURN те OPTION? ";а b$í{100): í “izga” хош: LE BzB-bs265: ia4B551:
EE ;PEEK XCOL+VAL "1" $200 INPUT "Press ENTER to nue"; b$: GO ТО USR S
To save it, I used: SAVE “vuiss taic" LINE 18 and SAVE "vucst t" CODE 29328 ,25555
I was able to figure this out by using HOT Z on the NY Hemoru board built at the Saturday CATS hardware sessions. That’s a powerful combination f!
Н. L. Schaar
Z July
MARYLAND HAMFEST
SÅS AND COMPUTERFEST CD
SPONSORED BY THE
BALTIMORE RADIO AMATEUR TELEVISION SOCIETY
SUNDAY, JULY 27, 1986
OPEN FOR SET-UP, SUNDAY AT 6 A.M. DEALER SET-UP BEGINS SATURDAY AT 2 P.M.
AT THE
HOWARD COUNTY FAIRGROUNDS
15 miles WEST of BALTIMORE just off 1-70 at RT. 32 on RT. 144 «Cs MS ACCESSIBLE TO THE HANDICAPPED "os
TOP PRIZES GIANT FLEA MARKET INDOOR / OUTDOOR EXHIBIT AREAS
GOOD FOOD REFRESHMENTS COMPUTERS RAIN OR SHINE ` TALK-IN: 146.16/76 TICKETS: $4 FOR INFO & RESERVATIONS, 147.63/03 TAILGATING WRITE: BRATS 146.52 TABLES AVAILABLE P.O. BOX 5915
KIDS UNDER 12 FREE! - BALTIMORE, MD 21208
Capitol Area Timex/Sinclair Users! Group .0.Box 725 Bladensbu:g, MD 20710
Nane
Address : ZIP
Phone Eone ` Office
nenbersnips - 316.00 (fanil;/individual);make checks parable tc C.A.T.S.
If faily membership, please list family members participating:
Occupation
пат Radio call sign
Equipment zx 80 RAY size iia 80 full keyboard 25 81 á Printer 73 1000 _ _ type — 25 2.00 other interface
Special interest use for computer: іе, games, han radio interface,
business, other, etc.
Languages: Basic Other
Machine
No. of years computer experience
iat committees would you like to serve on?
Comments: / near САТ. ?
Do not write below: Dt. Pd. : Ant. Membership No.
Са. Ck,
c. a. T. 8s. 1 1 July
SIN 3205 тни See 12 9091 'S4vpuns***3aN Ji (2UIS үтуо!б чзөузез SIN db^N IHW GbE'pl| few!) pero, turds 24 эм X20. TDU HIOMTIN A
4,2 land u2u*Jg UO} LLOJI) MƏN әчу +O woos биз әәш eee ou} U! “Wed Z de чучош des jo «wpunyes риозд% әчу чо Puey sue SUSIN
ec G io TONVSID SAIC э! S199 YOY чоъзэб уэтучо> 19121330 әчү
*#здәупдшоо
[euosved фо Ajiwes nelle Su èy} 3noqe evow биштә ч! péisauga)U! әле JO ‘ап UMO Oum e504) 340 $3$8Jà3U! BUI Óutosss ©} pej*o!pep doe z ir 3$8J83U0! (0128408 310 d- uõẽE е $! 8409
e124 ан 'бзсазиәреца $г24 хов °0'а i 1s: 616795 *.Jé$f| eU *éJU {O70 àu3 40 SSauppe Guipiew әчү
CATS Newsletter Р.О. Box 725 Bladensburg MD 20710
>.
X] САРО. ве. : 7]
&
E Neu Co- v ell key
5 Branch
1 Library
& Iw
= g QUINTERO ,MANUEL A. 301 4375 GREENBERRY LANE ANNANDALE VA 22003
COME TO QUR MEETING! The next meeting of с
Saturday, July 12, 1986
. T. S. will be held on:
At: New Carrollton Public Library 7414 Riverdale Road (Hwy 410), New Carrollton, MD
IF YOU ARE NOT A MEMBER OF CATS, THIS IS THE ONLY ISSUE YOU WILL RECIEVE Dues = $16.00 per year er family.
First Class