Think about Loose Coupling | |
PerlMonks |
Re: Battle scriptby Ovid (Cardinal) |
on Jun 06, 2002 at 15:57 UTC ( [id://172263]=note: print w/replies, xml ) | Need Help?? |
That reminds me of an article I had read some time ago. I can't recall where, but I'll summarize it and if anyone wants to work with it. This was a long time ago, so my memory is probably wrong about some aspects. Essentially, the article was about a computer program that allows you to use two programs to fight. You have a series of addresses (the arena) where the last address connects to the first (like a circle) and each program "lives" in the arena. There was a very basic assembler-like language that controlled what each could do. Commands were fairly straightforward and the language was, IIRC, turing-complete. The goal of each program was to disable the other. For example, one of the most successful programs, the "imp gun", was four lines long (and addresses, the way the languages worked):
With a program that small, it was awfully tough to disable (by moving a bad instruction to it). It simply laid down a string of null commands and if any of them hit the opponent, the opponent would be disabled. Some programs would try to find the other program (maybe a binary search of an imp-gun trail, for example), others would lay decoys and move themselves, etc. This could be a fun project :) Cheers, Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In Section
Seekers of Perl Wisdom
|
|