home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chestnut's Multimedia Mania
/
MM_MANIA.ISO
/
games
/
stars
/
stars.doc
< prev
next >
Wrap
Text File
|
1991-09-26
|
11KB
|
266 lines
Are the Stars Random?
The original author is;
Philip McLaughlin
712 Roberts Street
Denton, TX 76201
and the original program and article appeared in Hot CoCo
Magazine, May 1984. Philip may no longer live at this address in
the event anyone writes to him.
I have converted the program to the PC with EGA 640x350
resolution graphics. The original program for the Color Computer
allowed the change from a text screen to a graphics screen
without clearing the graphic screen so you could view the
activity. On the PC to change from SCREEN 0 (text) to SCREEN 2
(high resolution graphics and 80 column text) the screens are
first cleared. The program runs okay but the current display is
erase and the program picks up at the right place but it only
shows new stars.
There are EGA and VGA screens one of which is then EGA
640x350 SCREEN 9. It is possible to use up to seven (7) pages per
screen using SCREEN ,,0,0 to view SCREEN 9,,,0 and to write to
SCREEN 9,,0 and to change to SCREEN 9,,1,1. You can move, write
back and forth, all without destroying anything on the two, or
more, screens.
It is not possible to BSAVE and BLOAD EGA screens, or at
least I do not know a way around this limitation, and the
original program allowed this. You could save the screens every
so many generations (FOR .. NEXT loop to 1000=1 generation) and
then show it as a slide show loading each screen in succession
and covering many hours, even days, worth of displays. So this
option has been changed to save the graphic locations in a file
that is about 85,000 bytes long and is displayed using the
program VIEW.EXE.
Since the original program was written for a 255x192 screen
and 1000 stars (48.96 ratio), I converted the current version to
640x350 and 4575 stars (48.96 ratio). On my 12mhz turbo 80286 AT
this is about 1.5 minutes per generation. On a PC at 4.77 mhz it
would be somewhere around fifteen minutes per generations. The
CoCo version, poked to a higher processing speed, took about
eight minutes per slide.
It is my suggestion to let this program run over a couple of
days or something just to see what it produces. Of course this
depends on the running time of your system and the amount of free
disk space. I did this several times with when I had my Color
Computer. I let it run until my three drives were full of slides
(no hard drive) and the program terminated. I had it programed to
check for free space and switch drives as needed and terminate
when the last one was full.
The programs runs just like the original program, no
modifications were made but to the screen locations and the
number of stars.
When the program starts you are prompted for <1> Pure
random, <2> Weighted or Prejudiced or <3> Exit Program. Pressing
<1> fills the screen with random stars. I altered this option so
that the PSET is 1 to 25 for PRESET. In other words I turn off
twenty-five random positions (pixels, on or off) while turning on
only one position (pixel). The author just turned on pixels until
the screen went all white without doing any dying stars. Pressing
any key exits this option. If you press <2> you advance to the
next prompt.
You are prompted for <1> Change parameters or press <ENTER>
to continue. If you are going to use the defaults just press the
enter or return key. If you press <1> see the "Change Options."
The next prompt is <1> Formation of clusters from random
distribution or <2> Growth from fixed points. Press <1> and the
program loads 4,575 random screen locations and the program
begins. If you press <2> the program pick location 220,90 and
400,220 for the two starting points.
The program starts the display, either two fixed points or
4,575 random screen positions. If using the random option at this
point it might not be 4,575 actual stars since some choices with
be for positions already chosen, turning on the same pixel more
than one time.
Change Options
Turning the program you can press any key to change to the
interrupt screen showing the current state of the program. You
are prompted for <1> Change options, <2> Continue program as is,
and <3> Exit the program. If you press <2> the screen changes
back to the graphic display and the program proceeds as before.
Time of all calculations and the time of each generation is
displayed. This time may or may not be 100% correct. The timer on
the Color Computer could be set to any value and rolled over
every 18 minutes. The timer on the PC can not be altered. I can
handle the time with good results except when the timer rolls
over at midnight. This can happen anytime on the PC since people
do or do not set the time, set wrong time, system clocks are set
to the wrong time, etc. So whenever the timer rolls over empty my
current variable so the most that could be lost is the length of
time that it take to create one generation or if you are in the
"Change Options" display screen when roll over takes place and
adjusted time for the interrupt is lost.
Pressing <1> and you are prompted for "Change interaction
radius. Change to." You then type in a new value. The program's
default is "2" and pressing <ENTER> without a value keeps the
default. I did not see any suggestions from the author on
suggested values of RG. "Line 1420, where RG is used,
approximates Newton's Inverse Square Law in a probabilistic
manner. Note too that there are many ways to weight the distance
that do not involve extracting a square root."
Next you are prompted to "Input 1 to unplot `dying' stars
(pixels). Otherwise they remain on the screen." I have no idea
why this option was presented and wonder why anyone would want to
leave dead stars looking like lives ones and still on the screen?
I might consider making them a different color so that you could
tell them from live stars and am not even sure about that. If you
stepped back and looked at the universe from infinity, your eye
would not be able to see dead stars.
Next you are prompted "Press <1> for automatic storage to
disk or <ANY OTHER KEY> to continue. If you press <1> you are
then prompted for "Save to disk every how many generations." You
can have it save every generation but at 40,000 bytes per file
this can add up. Every 5 or ten are good figures. If you input
nothing the default is not to save the screens or not to change
the previous data if this is a change option.
Next you are prompted "Normally input "1". This causes new
points to be calculated as a probability function of the whole
buffer." I always use "1" myself.
Now you are back to the <1> Formation of clusters from
random distribution or <2> Growth from fixed points. Press <1>
and the program loads 4,575 random screen locations and the
program begins. If you press <2> the program pick location 220,90
and 400,220 for the two starting points.
.... and the program proceeds ....
VIEW SLIDES
Run the program, VIEW.EXE. You are prompted for <1> Slides
or <2> Exit program. Pressing <1> you are prompted for the number
of generations. This value must no exceed the number of
generations produced by the program STARS.EXE.
Next you are prompted for every how many generations. If you
saved every 5th generation then you must type in "5" and press
<ENTER>. The program cannot display every 2nd generation if
STARS.EXE saved every 5th generation. The VIEW program has an
error handler in it that loops back to the main screen on errors
in the even you typed in the wrong number of slides or the step
rate.
There is no timer in the viewer and each slide is loaded in
and replaces the current screen. On my PC-AT, 12 mhz and 40 ms
hard drive it takes about 15 seconds to load in a slide from the
disk file. You system may be faster or slower so please be
prepared for some delay which is avoidable considering the way I
had to save the screens. There is a single, short, tone at the
end of each slide and a multiple, longer, tone when the slides
are finished. Pressing any key returns you to the main screen.
If you have access to the magazine you can see all the
guidelines and if I had a page scanner I would have included it
in this documentation. I have included the basic and compiled
versions. Without a compiler the program will not run since Basic
gives me an illegal function call on SCREEN 9. It is at least
there for you to look at and see what math is used in the
program.
James Huckabey
3621-A Fraser Street
Bellingham, WA 98226