home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
138.lha
/
Cycle
/
ReadMe?
< prev
next >
Wrap
Text File
|
1986-11-20
|
4KB
|
89 lines
Submitted for your approval...
In the April issue of Amiga Transactor, Rico Mariani set in motion a
contest for Amiga programmers. The purpose of the contest is to design an
algorith for a Tron-like 'light cycle' (with a third less calories than a
regular cycle) that will compete (and hopefully beat) cycle algorithms sent
in by other programmers. The cycles compete within a program called "cycle"
which sets up a screen sized arena, places the cycles in random positions
in the arena, and sets them loose. Unfortunately, the program itself is
five plus pages of code and therefore, to save typing for others and to
generate more interest in the competion (thereby decreasing my chances of
winning, smart move eh?) I am uploading these painstakingly entered pieces
of source code.
The information provided here, though extremely useful, will not substitute
for the article in the Amiga Transactor. Look there for rules, function
descriptions, and general information about the program.
The source code is a completely accurate transcription of the listings in
the article, EXCEPT that I changed all references to "int" into "long" for
reasons too technical to explain AND corrected some obvious TAB induced
typos in the include file 'cycles.h'.
Some discrepancies I have noticed in the article are the references to the
programs ability to handle six cycles at a time whereas the program itself
can clearly handle only five.
Included are:
The modules for the cycle game; cycles.c dobikes.c time.c graphic.c
The source and object code to make the cycles; play.(c|o) manager.(c|o)
A very simple shell to begin makeing your own cycle; shell.c
Eight premade cycles; MrRight Dizzy Vertigo Round Flying NotsoDizzy
LookB4 Joystick
note: Flying and LookB4 only had descriptions in the article of
algorith changes from comparable programs. I made the changes
myself to reflect these descriptions yet take no responsibility
for their performance.
If any bugs are reported or have somehow, impossibly, been typed into the
source code, the program 'cycle' can be rebuilt with the following commands:
(with Manx Aztec C)
cc cycles.c +L
cc dobikes.c +L
cc graphic.c +L
cc time.c +L
ln -o cycle cycles.o dobikes.o graphic.o time.o -lc32
Note: All compiles use the 32bit integer option +L.
"c32.lib" can be found in SYS2:lib/ .
It is not neccessary to write the cycle algorithm in C. However, to link
your cycle program in C you use the following commands:
(again with Manx Aztec C)
cc yourbike.c +L
ln yourbike.o manager.o play.o -lc32
In my opinion, this program is far from bug proof. You are likely to see
the Guru once in a while if you don't run the program within its limits.
(ie. setting the number of players more than 5 or getting too wild with
bringing in new cycles while the program is running) Make very sure to turn
the individual cycle algorithm programs off after each tournament or you will
run out of memory reeeeeal fast.
If anyone knows of corrections made to this program by Amgia Transactor,
please let the rest of us know. I, personally, will look for all references
to the word 'cycle' in the Amiga forums message bases.
I hope you all have a lot of fun with this!
-Mike [76046,1057]
P.S.
A correction was given to me which I have had trouble making work. I
include it merely for completeness.
( in 'cycles.c')
if (num_alive) {
move_cycles(&cycle_list);
Timer_Post(tr,
TIME * num_alive / 1000, /* seconds */
((num_alive * TIME) % 1000) * 1000 /* micros */
);
}
continue;
This correction was supposedly in Amiga Transactor #2. It causes my
program to freeze up the instant all the players are registered. My theory
is that there is more to this correction than the code listed. Let me know!!