Z*Magazine: 15-Aug-89 #170
From: Atari SIG (xx004@cleveland.Freenet.Edu)
Date: 10/02/93-03:10:15 PM Z
- Next message by date: Atari SIG: "Z*Magazine: 22-Aug-89 #171"
- Previous message by date: Atari SIG: "Z*Magazine: 8-Aug-89 #169"
- Return to Index: Sort by: [ date ] [ author ] [ thread ] [ subject ]
From: xx004@cleveland.Freenet.Edu (Atari SIG) Subject: Z*Magazine: 15-Aug-89 #170 Date: Sat Oct 2 15:10:15 1993 | ROVAC ZMAGAZINE | | Issue #170 | | August 15, 1989 | |Copyright 1989, RII| |This week in ZMagazine| Hard Drive Fundamentals WK Whitton Ratty's Rap, August 1989 Mat*Rat Galactic Collisions on your Computer Michael D. Bjorkman Crazy-Eights #7: Big House Atari Robert Buman Z*NET Newswire 8-bit Edition Harold Brewer Galactic Collisions program listing |HARD DRIVE FUNDAMENTALS| |by WK Whitton| Reprinted from ST-ZMagazine #33 |Part 1| The hard drive you have purchased, or the mechanism you have dreamed of owning, is a wondrously ingenious device that employs some basic, and yet at the same time, some highly advanced features to offer you a device that combines substantial data storage space along with a high overall reliability factor. The next few weeks we will look into the rudiments of hard drive technology with an eye on making the novice familiar enough to make wise purchase, use, and maintenance decisions in the future. In this first installment of our hard drive series, lets take a look at some of the terminology we will need to be familiar with. CYLINDER This is a group or set of "tracks" that share a common track number. For example: all the track "1"s on your hard drive produce one cylinder, and all the track "2"s form another cylinder, and the list goes on. There is ONE set of tracks on each disk surface. On a floppy disk, a cylinder happens to refer to a particular track that appears on both side 0 and side 1 of a disk. DISK CACHE This is a common means of improving disk access performance by means of saving the most recently read disk data in the computer's memory. The very next time the computer attempts to read any data from your hard drive, the disk cache copies it from your much faster memory than from the actual hard drive. Cache programs will also work with floppy drive systems. DMA Stands for "Direct-Memory-Access". This is a high speed technique of transferring data between RAM and your hard drive or any other external device. This has been extensively used on the ST, and with some recent developments on the Amiga side by Supra. This special IC, the DMA chip, is basically a manager of sorts that handles requests for memory access from your CPU and other devices. ECC "Error Correction Code" is a system devised by IBM to deal with the problem of normal surface defects of hard drives and data integrity. Allows up to 11 contiguous bits of data, which have been scrambled during the read-back process, to be interpreted properly. ESDI "Enhanced Small Disk Interface" uses an enhanced "ST506" method, basically is serial data transference. This increased the total data transfer rate. FAT "File Allocation Table". This is a master table on your hard drive and floppy disk. Used to manage the free space on the disk along with various other pieces of information concerning the data stored on the drive. MEDIUM The material inside the hard drive that holds the magnetically stored information. Generally used coatings are iron oxide and various other alloys. Coatings can sometimes be determined by color--rust would be iron oxide and silver wold signify use of a metal oxide. MFM Modified Frequency Modulation. This is still the most common method of hard drive data encoding schemes. This allows the hard drive to store 17 sectors per track. PARTITION This is the division of a single hard drive mechanism into 2 or more logical segments that your system sees as if they were individual drives. Partitions are formatted independently, and with the ST, can even support different disk operating systems (i.e. ST-Macintosh-IBM, and now Atari 8-bit!) all on the same drive. READ/WRITE HEAD This is a piece of magnetized iron critically positioned above the magnetic media, and its function is to read or write data to your drive. RESERVED CYLINDER This is the innermost cylinder of a hard drive, and is reserved for parking the heads when you turn your hard drive off. RLL "Run-Length Limited". Allows much higher density data storage than the MFM method. Its key to success is the fact that it does limit the distance (or Run-Length) between magnetic flux reversals on the platter of your hard drive. When the hard drive head magnetizes the disk coating, it creates a small magnetic field, which has opposite poles. The head systematically reverses the direction of these fields to delineate bits. This scheme allows storage of 26 sectors per track. SCSI (Skuzzy) Stands for: "Small Computer System Interface". This is a high-speed hard drive interface that is capable of transferring data in a parallel manner (8 bits at a time normally). This means it transfers data one "byte" at a time. Although one hard drive mechanism with SCSI allows over 1 Meg per second to be transferred, it is much more common to see todays fast 3 1/2" SCSI drive mechanisms transfer over 550K a second on the ST (such as on the Seagate 157N). SECTOR This is a sub-area, or a smaller piece, of a track. Each sector begins with special addressing information, and is then followed by 4096 bits of data arranged in 512 bytes (or 2048 bits of data arranged in 256 bytes). TRACK This is one of the many rings on the surface of the hard drive platter that the read/write head passes over. |RATTY'S RAP, AUGUST 1989| |by Mat*Rat| Reprinted from the August Z*NET Here is my latest experience with the Action! programming language--the language I LOVE to HATE! Take a look at this piece of code: BYTE ARRAY StrngThing = "This is stuff" INCLUDE "D4:SYSALL.ACT" Guess what happens when you compile that? You ALWAYS get error 170. Why? Because the Action! compiler looks on drive 1 for SYSALL.ACT instead of drive 4 as specified. Change it to: BYTE ARRAY StrngThing = "This is stuff" BYTE FRED ; or other declarations that aren't ; initialized strings INCLUDE "D4:SYSALL.ACT" Voila! It works. Now, why doesn't THIS work: TYPE MyRecord = [ CARD Points BYTE POINTER X, Y ] I always get an error 6 on the BYTE POINTER! Can't a pointer be part of a record? What's the deal? A byte pointer is the same size as a CARD. So, I do this: TYPE MyRecord = [ CARD Points, X, Y ] Now, how do I use X and Y as pointers instead of cardinals? Has anyone ever noticed how poorly organized the Action! documentation is? I'm going insane here. I finally took Craig's advice and put tabs at the beginning of every important section of the manual (except for the error section--I've GOT to remedy that). Now I find things more easily, but golly--where are the examples? I'm going berzerk here. I'm about this close [] to running my Action! cartridge through the garbage disposal and whipping out MAC/65. However, the size of my current project is a bit daunting from a 6502 assembly language perspective. HELPPPPPPPPP???????? Where are you Action! gurus? Where are examples? Why isn't there an ACTION! topic in the data libraries here? Argggggggggggggggggggggggggg...... <poof> (Oops, my mind just went up in smoke) ...And so it was last week on GEnie, when I was going nuts trying to figure out how to load a large data file from disk and create an array of pointers to each record. As it turns out, CARDs can be treated as POINTERs any time you like. Action! doesn't much care. Craig S. Thom, of ICD, was very helpful in getting me up to speed in Action!, and I got my program running in just a few days. Action! is a superb, terribly underrated language. Why? First, the manual. I'm certain a lot of people purchased Action! with the intention of learning a new "high level" language, only to be intimidated and frustrated by the poorly organized and confusing documentation. There is no index. There is no ONE table of contents, but rather one for each section of the book. There is no alphabetical listing of all the functions and procedures for the language. I'm certain Action! becomes a rather harrowing experience for many newcomers. It drove me nuts, and I'm fluent in more programming languages than some software corporations! The other problem is a run time library. What's that, you ask? Exactly. The manual doesn't make it very clear that your Action! programs aren't much good to you without the Action! cartridge installed. For an extra $30 or so you can acquire a "run time library" from ICD or download a public domain version from GEnie or CompuServe. When you "INCLUDE" this file, all of the system calls made to the Action! cartridge are replaced by calls to in line assembly code. The resultant program file is no longer dependant up on the cartridge for anything. These programs may be loaded and run from DOS, without the assistance of the Action! cartridge, and may be exchanged with friends. Action! needs a new manual. Maybe I'll write one. I haven't decided, but something needs to be done. Action! is better than any disk based C or Pascal compiler for the 8-bit Ataris (though I must admit to not having tested Kyan Pascal). If you learn Action! and pursue structured programming techniques and good coding style, you will have few problems moving up to a "real" high level language such as C or Pascal when you move on to an IBM, MacIntosh, or Atari ST and more sophisticated programming assignments in the future. I will be looking at Action! more in future installments of Ratty's Rap, and may provide a few tutorials along the way. Analog doesn't think very many people are interested in the language, and does not want a column on the subject. Well, I plan to get all you latent Action! gurus fired up, and change that! I suggest that we start a revolt and REFUSE to use the exclamation point after Action!--what is a punctuation character doing in the name anyway? It seems like the language is YELLING at you. Maybe that's why so many would-be Action! programmers are intimidated? The September issue of Analog is out. You may have read the letter from the publisher Lee Pappas about merging Analog and ST-Log once again. He paints a pretty grim picture for both the 8-bit and ST. Of course Mr. Pappas is also involved in the publication of Video Games & Computer Entertainment (VG&CE) and Laptop Computers magazines, both of which are selling like wild fire in comparison to their ROOTS magazines ST-Log and Analog. So, it's understandable that he is a bit pessimistic. I guess we won't really know for sure until the Christmas buying season begins--Atari has promised a lot of pleasant surprises, but will they deliver? Will we see the Lynx (their portable game machine) by the end of September? Will the Portfolio see the light of day? Will Atari deliver SEVEN TIMES the amount of US advertising that they did last year? (Did you ever notice how Atari always mentions MULTIPLES of their advertising dollars? Ever wonder why? Well, it SOUNDS great, and any number times zero is still zero. So, Atari makes good public relations and saves money too! Ok, seriously, it probably isn't THAT bad. But, one popular inside joke is that the fastest way OUT Atari's revolving door is to say the word ADVERTISING within the hallowed walls of Atari Sunnyvale! What about the long rumored (say about 4 years or more) TT, Atari's answer to America's demand for an affordable workstation. Hewlett Packard has licensed a company in Japan to clone their popular workstation technology, for less than $5000 per copy. Can Atari's TT compete with that? (And we're talking a MEGAPIXEL, 1024x1024, resolution folks!) Atari makes a lot of noises at the shows, but consider this: if a tree falls in the woods and no one is there to hear it, no sound is made. Is anyone listening to Atari any more? Mat*Rat Ratware Softworks 32 S. Hartnett Ave. St. Louis, MO 63135 P.S. Keep those cards and letters coming. Please DON'T CALL--I seldom have time to chat on the phone with a wife, 2 kids, a dog, a cat, college study, a full time job (with overtime lately), and a backlog of article work to the ceiling. |GALACTIC COLLISIONS ON YOUR COMPUTER| |Adapted by Michael D. Bjorkman| Courtesy of S*P*A*C*E From an original program by Michael C. Schroeder and Neil F. Comins First published in Astronomy Dec. 1988 In many ways the microcomputer of the 1980s is just as capable of doing scientific calculations as the mainframe computer of the 1960s. Even though the microcomputer has a slower CPU, often the amount of wall clock time spent on a calculation is comparable to 1960s mainframe time sharing systems jugged up with many users. Even more speed advantage can be realized when comparing to batch jobs where the printed output was mailed to the user. (The mail really slows down turn around time.) The one significant difference between 1960s mainframes and microcomputers is that there currently are far more micros than there ever were mainframes in the 1960s. Furthermore, many microcomputers are in private individuals' hands while most likely none of the 1960s mainframes were. What this all means is that it is now possible for the amateur scientist to perform 1960s-type research grade numerical computations at home in his spare time. Which brings us to the topic of this article: galactic collisions on a personal computer. The DEC 1988 issue of the popular magazine, "Astronomy" had a fascinating article by Schroeder and Comins on simulating the collision of two galaxies using a microcomputer. The question the 1960s theorist desired to answer was, "How much of the observed structure of interacting galaxies is due to gravitational interaction, and how much to other sources?" SOLUTION METHOD Solving the equations of classical mechanics analytically for the motion of many stars in a galaxy would be too tedious to even contemplate starting the effort. Since an analytic solution is not available, numerical approximation procedures are used. Therefore a computer is the desired method for solving for this problem. However, if the number of stars becomes large, then even the numerical approximation procedure would be too taxing for the 1960s mainframe. To get around this difficulty a simplifying assumption is made: the stars orbiting the TARGET galaxy have vanishingly small mass with respect to the massive centers of the TARGET and the INTRUDER galaxies. Since the stars have vanishingly small mass, they do not exert gravitational forces on each other or on the centers of the galaxies. Therefore, the only gravitational forces which need be calculated are the force between the centers of the two galaxies, and the forces from the centers of the two galaxies on the stars. Listing 1 is a program which will perform this calculation. The program was originally published as GW BASIC source code for the IBM PC in the DEC 1988 issue of Astronomy. I have made a few changes to the program to make it run on the 8-bit Atari. Note that since Schroeder and Comins wrote the program in plain vanilla BASIC, it can easily be adapted to the ST by rewriting the graphical output routines. RUNNING THE PROGRAM Type in Listing 1 and save it to disk. After saving the program, check it with the Analog UNICHECK checksum program. (Those who don't have UNICHECK can get it from the S*P*A*C*E disk library, disk #15.) Listing 2 contains the UNICHECK checksum table for Listing 1. (Do not type in Listing 2. Listing 2 is used in conjunction with the output from UNICHECK to determine whether there are typing errors and the line numbers of the lines with typing errors.) When all of the typing errors have been eliminated SAVE the program to disk as GC3D.BAS. When RUN, GC3D.BAS will first prompt you for the answers to seven questions. The inputs for the program are: 1) the number of rings of stars orbiting the TARGET galaxy center, 2) the number of stars in each ring, 3) the mass of the INTRUDER galaxy center, 4) the initial coordinates of the INTRUDER galaxy center, 5) the initial velocity of the INTRUDER galaxy center, 6) the number of time steps to take, and 7) whether the inputs are correct as entered. Due to the memory constraints of the 8-bit Atari, it is not possible to have more than 100 stars orbit the center of the TARGET galaxy. (Note that with BASIC XE in EXTENDED mode on a 130XE it would be possible to have more.) I typically run the program with 5 rings of stars, with 20 stars in each ring; the maximum amount of stars possible with this program. The other inputs for two interesting examples are given in the table below: Results Mass fraction Time steps X0 Y0 Z0 VX0 VY0 VZ0 Ring 1.00 65 7.5 0 35 0 0 -1 Whirlpool 0.25 300 -30 30 0 0 -0.34 -0.34 The column labeled mass fraction is the answer to the third question on the mass of the intruder galaxy. The parameters X0, Y0, and Z0 are the initial x, y, and z coordinates of the INTRUDER galaxy, and VX0, VY0, and VZ0 are the x, y, and z components of the initial velocity of the INTRUDER galaxy. The final column labeled time steps is the maximum number of time steps necessary to show the final shape of the TARGET galaxy. The sixth prompt by the program is the request for the number of time steps to take before displaying the results on the video monitor. The smaller the number entered here, the more often the screen will be updated with the new positions of the stars. The first set of input, labeled "RING" in the above table will distort the initial disk-shaped TARGET galaxy structure into a ring shape when viewed from above. This shape is similar to the well known Cartwheel galaxy which can be viewed in many books with pictures of galaxies. The units of the equations used by this program are: one time step equals 1.2 million years, one screen pixel equals 500 parsecs (a parsec is a little more than 3 light years), a mass fraction of 1.0 equals 20 billion solar masses. Everything is big! Atari BASIC performs these calculations too slowly so I used interpreted TurboBASIC to speed things up to a tolerable pace. The ring galaxy calculation will take about 10 minutes with TurboBASIC, and the Whirlpool galaxy calculation will take about 1 hour. (I was unable to get TurboBASIC to compile GC3D.BAS. The TurboBASIC compiler refused to compile array elements which are set equal to themselves. Some time after my several hour debugging session to identify the problem, I rediscovered that this problem had been documented by Jeff Colehour and Dick Hearsey in the April 1987 PSAN on page 19.) For those using TurboBASIC the lines 2000-2040 can be replaced by the CIRCLE command following the REM in line 1990. Similarly the CIRCLE command in 2050 can replace lines 2060-2100, 2110 can replace 2120-2140 and 2150 can replace 2160-2180. (Editor's note: One may certainly follow the previous instructions to get this program up and RUNning. However, by loading this program (found at the end of this issue of ZMag) into your word processor, deleting the preceeding ZMagazine text, saving the result to disk, then ENTERing the result when in BASIC, the program should RUN. (SAVEing this already ENTERed program back to disk will result in greater initial loading speed.)) |CRAZY-EIGHTS #7: BIG HOUSE ATARI| |by Robert Buman| 8-bit librarian for SAGE Spectrum Atari Group of Erie (HEY: STICK AROUND FOR CONTEST NEWS AT THE END OF THE ARTICLE!) From the mail bag comes this month's feature story. It turns out SAGE is not the only Atari user group in Erie. The other group is a small but close-knit group that would probably join our club if it weren't for one small detail: they're all doing time at the Erie County Prison! They call themselves the Jailed Atari Information League, or JAIL for short. Here's the letter: Dear Crazy-Eights: You are probably wondering why someone in prison is writing to you. You may be surprised to know there are Atari computer users here on the inside. A while back some of us guys were getting bored with reading and watching TV and asked if maybe we could get acquainted with computers. It wasn't too long that we convinced the staff it was a good idea. I think the two weeks of banging cups against the bars at midnight is what did the trick. Just kidding, that's a little JAIL-humor. People on the outside think that we wear striped uniforms, drag a ball and chain and smash rocks all day. Not true. Prison life isn't too bad once you get used to it. The warden was a little doubtful at first over the worthiness of our request. He said "It takes too long to learn how to use computers." So I answer him "We got time!" That's a funny one, huh? So after we convince him that a computer would be the key to our rehabilitation he buys us an Atari. How about if I tell you a little about some of the members. First there's me, Jake. I'm what you'd call a permanent fixture; 15 to 20 (years that is). So they make me club president! Next there's Frankie Fast-Fingers (6 to 10) who can type 90 words a minute when he's not cracking safes, Eddie the stool-pigeon (8 to 10) whom we tolerate, and Jimmy the Brain (7 to 11). There are a few more, but their terms are too short to give them mention. Just like any outside user group, members come and go. The computer came with some games. We have Pac Man and Centipede, which are OK, but our favorite games are Escape from Epsilon, Dig Dug and Breakout. We have the computer-version of Monopoly too, but we don't play it anymore. Everybody always wants to buy the jail square and build hotels on it! Also, we like the simulation programs. The warden says they are good for our rehab program. I had a great idea for a stock broker simulation. Brain had a couple ideas too. You play a gangster in 1920's Chicago who totes a sub-machine gun, and has his own territory. I tell him, "Brain, somebody already made that game!" Ok, he says, and he comes up with another one. This time your a gangster named Clyde with a mol named Bonnie. You travel around the mid-west in the Thirties and rob banks. Hmm, somehow that sounds familiar too. I know a lot of people think of the Atari as just a game machine, but we like it for practical things too, like figuring the odds for the football pool and the daily numbers. Oh, what wonderful things we could do with this in Las Vegas! We could always use more software and equipment. If anyone would like to mail us a modem that would be nice. We could log onto the SAGE BBS or some of the other information services. The FBI has a large database that the boys and I would love to access. Well, so long for now, fellow Atari people. If your ever in our neck of the woods, stop in to visit! PS: We are having a membership drive. If you know of any likely candidates, please send then our way. 'Course if they really ARE likely candidates they will be in here soon enough... End of letter. *** L O G O C O N T E S T *** I must confess, our Crazy-Eights mail bag has been getting thinner and thinner. We have about a hundred years worth of colorful complimentary labels sitting around gathering dust. I had to lay off half my staff! BUT YOU CAN HELP! Send anything: Your computer! A lock of Keith Ledbetter's hair! A G: String autographed by Charles Johnson! A new ribbon for my Star/Gemini-10! A John Nagy wish list! Your dog! No, not your dog, please, remember my cats... If the above items are not available, consider sending these: E-MAIL. A postcard. A picture of you. A picture of your club. More E-Mail. Fan mail for Patty. Neat ideas for future articles. Funny stories about your computer club. An APAC picture of your state bird. A listing of a short program that does as little as possible. A club newsletter containing Crazy-Eights (SAGE Scroll doesn't count)! If this kind of stuff doesn't interest you, what about FIFTY BUCKS? OH, now I have your attention! Design a logo for CRAZY EIGHTS! *** IT'S A CONTEST! FOR REAL! *** The one and only Crazy Eights Logo contest! Send in your logo-entry in Koala format, Micro-illustrator format or 62 sector graphics-8 format. RULES: Anyone is eligible including members of SAGE (I'll exclude myself.) All entries become the property of SAGE. Entries will not be returned, so keep a copy for yourself. Logo must be an Atari 8-bit file in one of the formats listed above. Entries must be received/postmarked by November 1st, 1989. Entries will be judged on originality, creativity and good taste. Judging will take place at SAGE's general meeting in December 1989 by the membership of SAGE. Your entry can be F-mailed via GEnie (directed to LAKE31), entered during any SAGE general meeting or mailed to SAGE's P.O. Box: SAGE attn: CRAZY EIGHTS BOX 10562 Erie PA 16514 Grand prize--a Cashier's check for FIFTY DOLLARS! Second prize--five SAGE Public domain library disks. Third prize--three SAGE disks. Free colorful complimentary labels for every entry! That's one way to get rid of them! Any questions? You gotta write or send E-mail!!! Good luck! *** BOB *** |Z*NET NEWSWIRE 8-BIT EDITION| |by Harold Brewer| From issue #33 of ST-ZMagazine comes this excerpt found in "The Editor's Desk" by Ron Kovacs: "...Finally, there are TWO Bulletin Boards I have added to our growing list. One is 8-bit oriented having networked messages bases with Philadelphia, Illinois, and Florida. Also included in the networking is the Ask The Rat message base where you can leave messages to Matt Ratcliff. Call the Blank Page BBS at (201) 111-1111. The other system is called the Ace's High BBS at (201) 111-1111. Supports the ST with numerous message bases, auction area, on-line story base, hundreds of public domain ST software, and a complete library of ST*ZMAG online without download quotas. This is an exclusive AUA (Atari Users Association) member and BBS of the newly formed RACE Atari Users Group." From the GEnie Atari 8-bit Bulletin Board comes word from John Crosby that 130XEs which are now being sent to dealers feature an updated PCB assembly and O.S. ROM. John says the new 130XEs are using 256K DRAM chips instead of original 64K chips, and these 256K chips (only 4 are used) are divided into 64K x 4. He goes on to say this configuration is compatible with earlier 130XEs. The O.S. changes, according to John, fix an SIO problem and feature a changed memory self-test which now includes the 64K of banked RAM. John concludes his remarks with the observation that this update by Atari may fortell enduring 8-bit availability. | Rovac Industries, Incorporated | | P.O. Box 59, Middlesex, NJ 08846 | | (201) 968-8148 | |Copyright 1989 All Rights Reserved| Reprint permission is granted providing ZMagazine and the original author is credited. CompuServe: 71777,2140 GEnie: ZMAGAZINE Source: BDG793 ZMagazine Headquarters BBSes: Centurion BBS--(618)451-0165 Chaos BBS--(517)371-1106 Shadow Haven--(916)962-2566 Stairway to Heaven--(216)784-0574 1000 REM GALACTIC COLLISIONS 1010 REM BY M.C. Schroeder and N.F. Comins 1020 REM Originally published in ASTRONOMY, DEC 1988 1030 DIM X(100),Y(100),VX(100),VY(100),Z(100),VZ(100),ANS$(5) 1040 GRAPHICS 0 1050 POSITION 2,1:PRINT "# of rings of stars:_"; 1060 INPUT NRR 1070 POSITION 2,3:PRINT "# of stars per ring_"; 1080 INPUT NRS 1090 NS=NRR*NRS:DR=20/(NRR-1) 1100 POSITION 2,5:PRINT "Mass of INTRUDER galaxy in units of" 1110 PRINT "_TARGET galaxy mass:_"; 1120 INPUT M2 1130 POSITION 2,8:PRINT "Initial X,Y,Z coordinates of the" 1140 PRINT "_INTRUDER galaxy:" 1150 PRINT "_TARGET galaxy is located at 0,0,0." 1160 POSITION 20,9:INPUT X2,Y2,Z2 1170 POSITION 2,13:PRINT "Initial X,Y,Z velocities of the" 1180 PRINT "_INTRUDER galaxy:" 1190 PRINT "_TARGET galaxy is initially at rest._"; 1200 POSITION 20,14:INPUT VX2,VY2,VZ2 1210 REM 1220 POSITION 2,17:PRINT "# of time steps for this run:_"; 1230 INPUT NTSPR 1240 POSITION 2,20:PRINT "Are these inputs correct (Y or N)"; 1250 INPUT ANS$ 1260 IF ANS$(1,1)="Y" THEN 1280 1270 GOTO 1040 1280 GRAPHICS 8:COLOR 1 1290 POSITION 0,1:PRINT "______________Thinking...." 1300 M1=5:X1=150:Y1=100:VX1=0:VY1=0:Z1=0:VZ1=0:SF2=2 1310 REM Initialize star positions 1320 TSTEP=0:M2=M2*M1:X2=X2+X1:Y2=Y2+Y1:Z2=Z2+Z1 1330 REM 1340 FOR IR=1 TO NRR 1350 R=10+(IR-1)*DR 1360 V=SQR(M1/R):TH=(0.5*V/R)*(180/3.14159) 1370 IF R=10 THEN V=0.9*V 1380 FOR IT=1 TO NRS 1390 T=(IT-1)*360/NRS 1400 T1=3.14159*(T-TH)/180 1410 I=I+1 1420 REM 1430 X(I)=R*COS(T/57.2958)+150 1440 Y(I)=R*SIN(T/57.2958)+100 1450 VZ(I)=0:Z(I)=0 1460 REM Initialize star velocities 1470 VX(I)=-V*SIN(T1) 1480 VY(I)=V*COS(T1) 1490 NEXT IT 1500 NEXT IR 1510 GOSUB 1880 1520 REM Particle pusher routine 1530 FOR K=1 TO NTSPR 1540 FOR J=1 TO 1 1550 FOR I=1 TO NS 1560 REM 1570 R1=M1/((X(I)-X1)^2+(Y(I)-Y1)^2+(Z(I)-Z1)^2+SF2)^1.5 1580 R2=M2/((X(I)-X2)^2+(Y(I)-Y2)^2+(Z(I)-Z2)^2+SF2)^1.5 1590 REM 1600 AX=R1*(X1-X(I))+R2*(X2-X(I)) 1610 AY=R1*(Y1-Y(I))+R2*(Y2-Y(I)) 1620 AZ=R1*(Z1-Z(I))+R2*(Z2-Z(I)) 1630 REM 1640 VX(I)=VX(I)+AX 1650 VY(I)=VY(I)+AY 1660 VZ(I)=VZ(I)+AZ 1670 X(I)=X(I)+VX(I) 1680 Y(I)=Y(I)+VY(I) 1690 Z(I)=Z(I)+VZ(I) 1700 NEXT I 1710 REM Update positions and velocities of galactic centers. 1720 RR=((X1-X2)^2+(Y1-Y2)^2+(Z1-Z2)^2+SF2)^1.5 1730 AX=(X2-X1)/RR:AY=(Y2-Y1)/RR:AZ=(Z2-Z1)/RR 1740 VX1=VX1+M2*AX:VY1=VY1+M2*AY:VZ1=VZ1+M2*AZ 1750 VX2=VX2-M1*AX:VY2=VY2-M1*AY:VZ2=VZ2-M1*AZ 1760 X1=X1+VX1 1770 Y1=Y1+VY1:Z1=Z1+VZ1 1780 X2=X2+VX2 1790 Y2=Y2+VY2:Z2=Z2+VZ2 1800 TSTEP=TSTEP+1 1810 NEXT J 1820 GOSUB 1880 1830 NEXT K 1840 PRINT "____Continue (Y OR N)";:INPUT ANS$ 1850 IF ANS$="Y" THEN 1530 1860 GOTO 2290 1870 REM Update screen display 1880 GRAPHICS 8:SETCOLOR 2,0,0:SETCOLOR 1,0,14:POKE 77,0 1890 REM 1900 XC=(M1*X1+M2*X2)/(M1+M2) 1910 YC=(M1*Y1+M2*Y2)/(M1+M2) 1920 ZC=(M1*Z1+M2*Z2)/(M1+M2) 1930 REM 1940 PLOT 0,150:DRAWTO 319,150 1950 PLOT 160,0:DRAWTO 160,150 1960 REM 1970 XX1=(X1-XC):YY1=(Y1-YC):ZZ1=(Z1-ZC) 1980 XX2=(X2-XC):YY2=(Y2-YC):ZZ2=(Z2-ZC) 1990 REM CIRCLE (XX1+80),(YY1+75),2 2000 FOR I=-1 TO 1:PLOT XX1+80+I,YY1+75-2:NEXT I 2010 FOR I=-2 TO 2 STEP 4:PLOT XX1+80+I,YY1+75-1:NEXT I 2020 FOR I=-2 TO 2 STEP 4:PLOT XX1+80+I,YY1+75:NEXT I 2030 FOR I=-2 TO 2 STEP 4:PLOT XX1+80+I,YY1+75+1:NEXT I 2040 FOR I=-1 TO 1:PLOT XX1+80+I,YY1+75+2:NEXT I 2050 REM CIRCLE (XX1+240),(2*ZZ1+75),2 2060 FOR I=-1 TO 1:PLOT XX1+240+I,(2*ZZ1+75)-2:NEXT I 2070 FOR I=-2 TO 2 STEP 4:PLOT XX1+240+I,(2*ZZ1+75)-1:NEXT I 2080 FOR I=-2 TO 2 STEP 4:PLOT XX1+240+I,(2*ZZ1+75):NEXT I 2090 FOR I=-2 TO 2 STEP 4:PLOT XX1+240+I,(2*ZZ1+75)+1:NEXT I 2100 FOR I=-1 TO 1:PLOT XX1+240+I,(2*ZZ1+75)+2:NEXT I 2110 REM CIRCLE (XX2+80),(YY2+75),1 2120 FOR I=-1 TO 1:PLOT XX2+80+I,YY2+75-1:NEXT I 2130 FOR I=-1 TO 1 STEP 2:PLOT XX2+80+I,YY2+75:NEXT I 2140 FOR I=-1 TO 1:PLOT XX2+80+I,YY2+75+1:NEXT I 2150 REM CIRCLE (XX2+240),(2*ZZ2+75),1 2160 FOR I=-1 TO 1:PLOT XX2+240+I,(2*ZZ2+75-1):NEXT I 2170 FOR I=-1 TO 1 STEP 2:PLOT XX2+240+I,(2*ZZ2+75):NEXT I 2180 FOR I=-1 TO 1:PLOT XX2+240+I,(2*ZZ2+75)+1:NEXT I 2190 REM 2200 FOR I=1 TO NS 2210 XP=(X(I)-XC):YP=(Y(I)-YC):ZP=2*(Z(I)-ZC) 2220 PLOT (XP+80),(YP+75):PLOT (XP+240),(ZP+75) 2230 NEXT I 2240 REM 2250 POSITION 0,0 2260 PRINT "______X-Y","_______X-Z" 2270 POSITION 0,2:PRINT "time=";TSTEP; 2280 RETURN 2290 GRAPHICS 0:END LISTING2: UNICHECK Checksum Table 1000 DATA 165,671,453,15,46,429,949,193,954,778,966,229,947,665,470,7930 1150 DATA 274,517,426,474,451,135,282,332,513,953,127,888,717,987,614,7690 1300 DATA 662,423,751,287,629,427,152,343,642,604,900,515,289,702,698,8024 1450 DATA 588,443,733,420,744,736,976,941,963,148,472,296,812,826,299,9397 1600 DATA 19,32,45,296,596,603,610,573,581,589,505,318,757,122,396,6042 1750 DATA 415,757,224,766,240,639,512,986,517,458,981,749,406,25,308,7983 1900 DATA 349,355,361,305,733,699,308,460,473,170,153,90,593,86,153,5288 2050 DATA 423,434,284,382,282,429,143,157,594,155,429,438,382,438,289,5259 2200 DATA 460,767,391,495,287,208,547,449,795,537,4936
- Next message by date: Atari SIG: "Z*Magazine: 22-Aug-89 #171"
- Previous message by date: Atari SIG: "Z*Magazine: 8-Aug-89 #169"
----------------------------------------- Return to message index