Path: news1.icaen!news.uiowa.edu!NewsNG.Chicago.Qual.Net!128.174.5.49!vixen.cso.uiuc.edu!news-peer1.sprintlink.net!news.sprintlink.net!iad-peer.news.verio.net!uunet!ffx.uu.net!in3.uu.net!news.mel.aone.net.au!newsfeed-in.aone.net.au!news.netspace.net.au!not-for-mail From: trout@netspace.net.au (SE) Newsgroups: comp.sys.apple2 Subject: Re: The "Robotwar" assembler? Date: Thu, 22 Apr 1999 12:32:14 GMT Organization: A customer of Netspace Internet Lines: 95 Message-ID: <371f1633.10716948@news.netspace.net.au> References: NNTP-Posting-Host: dialup-m1-7.hobart.netspace.net.au X-Trace: otis.netspace.net.au 924783892 15369 210.15.253.7 (22 Apr 1999 12:24:52 GMT) X-Complaints-To: abuse@netspace.net.au NNTP-Posting-Date: 22 Apr 1999 12:24:52 GMT X-Newsreader: Forte Free Agent 1.11/32.235 Xref: news1.icaen comp.sys.apple2:147152 On 21 Apr 1999 16:04:02 GMT, Nele Abels-Ludwig wrote: > >Hello, you good people :) > > With much interest, I have looked at the ancient Apple ][ game >"Robotwars", where you had to write an efficient control program for a >virtual fighting robot. The commands include moving, scanning and >firing. I have studied the source examples and the "assembler" seems to >be pretty straightforward, but does anybody have a concise manual for >the robot-commands? Or *gosh* a game manual? Yep. I've still got the Robot War manual, but this quick summary is probably all you'll need: The valid commands are: TO stores a value in a register (eg: 240 TO A or 240 TO A TO B) IF compare 2 values and alter program sequence (eg: IF RADAR<0 GOSUB FIRE) GOTO Go to a label (eg: GOTO SCAN) GOSUB Execute a subroutine ENDSUB Return from a subroutine + - * / arithmetic functions (eg: 240-A*2 TO B) Numbers can only be integers between -1024 and 1024. The allowed conditions signs are: = < > The registers are: A through W and Z - General memory registers X - Stores horizontal position of robot (0-256) Y - Stores vertical position of robot (0-256) AIM - Angle of gun in degrees (0-359) 0 is North RADAR Storing a number here (0-359) sends a beam out in the given direction. The register then returns either a positive value (distance to a wall) or negative value (distance to an enemy robot). SHOT Fires the gun in the direction AIMed. Setting a value in the SHOT register sets a timer for the distance the shell will travel. The gun takes a while to cool down and can not be fired until the value of SHOT returns to 0. DAMAGE Registers damage your robot has taken. DAMAGE starts at 100 and reduces to 0 (dead). SPEEDX Controls and monitors the speed in the X direction. Values can be between -255 and 255. SPEEDY Controls and monitors the speed in the Y direction. (-255 to 255) RANDOM Generates a random number between 0 and the number stored each time the register is accessed. INDEX/DATA Storing a number from 0 to 34 in the INDEX register causes the corresponding register to be used whenever the DATA register is referenced. The code lines must be indented. Labels are not indented. Some examples of illegal instructions: A*(B+C) TO D No parentheses are allowed. 20.35 TO E Only integers can be used. -A TO B You must use 0 - A TO B IF A+B=C*3 GOTO LABEL No arithmetic allowed after = sign That's about it. I can send you a disk image of some of my old creations if you'd like to see some more code examples. I'm also keen to pit some of my old "bots" against some that someone else has created. So I'd be very interested in seeing any robots you come up with. Cheers, Steve Evans