Path: utzoo!attcan!uunet!tank!mimsy!haven!udel!toffee!gray From: gray@toffee.it.udel.edu (Scott Gray) Newsgroups: comp.edu Subject: Re: Class Use of Corewars Message-ID: <12948@nigel.udel.EDU> Date: 5 Mar 90 19:37:10 GMT References: <6709@cps3xx.UUCP> <6{+#C1+@rpi.edu> <25F16C01.B50@deimos.cis.ksu.edu> Sender: usenet@udel.EDU Reply-To: gray@freezer.it.udel.edu (Scott Gray) Followup-To: gray@freezer.it.udel.edu Distribution: comp.edu Organization: University of Delaware -- 040 Smith Sun Lab Lines: 52 bdn@phobos.cis.ksu.edu (Bryan D. Nehl) writes >In article <6{+#C1+@rpi.edu> hiebeler@cs.rpi.edu (Dave Hiebeler) writes: >>In article <6709@cps3xx.UUCP> reid@cpswh.cps.msu.edu (Dr Richard J. Reid) writes: >>> Have you used Corewars (Scientific American thread) or >>> anything like it in your classes? That is, a competition >>> among the students where their programs compete one-on-one. >> There was another program called "C-bots" where you write C programs >>that control little "robots" moving around in 2 dimensions (so you can >>watch them on the screen). (By "robots" I don't mean physical robots, >>just simulated robots). You write your program to control movement of >>these robots, and monitor their sensors; the objective is to have your >>robot "kill" (by shooting at) other robots moving around. >>Dave Hiebeler / Computer Science Dept. / Amos Eaton Bldg. / >>Internet (preferred): hiebeler@turing.cs.rpi.edu Bitnet: userF3JL@rpitsmts >Now my question is: "How would one go about writing such a program?" >Would you have to write each one as a tsr? Then they could possibly >interact through the registers...saving positions of robots and "bullets" >in the registers? If anyone has source please let me know, or if it is >small enough post it. There are two such programs that do just such a thing in public domain. COREWAR simulates multiple assembly laguage programs in and 8000 byte memory space using an assembly interpreter. The robots idea is also released under the name of CROBOTS for C Robots. To implement a robot you write a pseudo C code program to control the individual robots. You are given commands to scan the screen for the nearest robot, detect the speed of the robot and the direction of movement, and similar commands for controlling your own robot. Your robot has real acceleration, in otherwords you have to accelerate and decelerate instead of instantanious stop and go. So your program has to take into account all of these actions with the other robots AND must be efficient because speed counts too. Strategy algorithms aren't that easy to write. As for how you go about implementing this, what CROBOTS does is compile each of the programs for the seperate robots (up to 5) into its own executable code, then acts as the schedular for all of the robot's programs, keeping a seperate program pointer for each robot and executing each line of code in lockstep. If you are interested in any of these programs, I think they are both available through, of course, simtel. Scott Gray -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + SCOTT - gray@freezer.it.udel.edu | "I'm, BORED BORED BORED BORED!" + + or god@vax1.acs.udel.edu | - Vivian + -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-