Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( #3333=superdoc: 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):

  1. Assign a value to a variable representing an address (this value was the first address after the end of the program - I don't remember how initialization worked)
  2. Move a null command to that address
  3. Add 4 to that address
  4. Goto 2

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,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.


In reply to Re: Battle script by Ovid
in thread Battle script by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2021-08-04 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (41 votes). Check out past polls.

    Notices?