In and Out

From WikiManual
Revision as of 18:02, 6 July 2008 by Jarbon (talk | contribs) (Removed circular links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This refers to the 10 in and out sysvar locations. The number stored at .out1, .out2 or another out can be read by any robot viewing the bot, with the value arriving at .in1, .in2 or another in respectively. These were in the past used for identification, and more recently in unique bot species not intended for battle.

ID'ing non family with in/out:

*.in1 *.out1 !=

A problem similar to the one facing bots using memloc/memval for identification is that with the simple code:

*.in1 .out1 store

An enemy bot can seem like family. Of course with randomly(rnd) changing their value via inc/dec an enemy bot will waste Energy storing these.

But, you can ID bots by talking to them:

' if you see something, ask "Can I eat you?"
cond
 *.eye5 0 >
start
 1 .out1 store
stop

' If they don't say No,
' eat em
cond
 *.eye5 0 >
 *.out1 1 =
 *.in2 2 !=
start
 -1 .shoot store
stop

' If Someone asks to eat you,
' just say "No"
cond
 *.eye5 0 >
 *.in1 1 =
start
 2 .out2 store
stop

This DNA tells the bot: see something, put out1 1. If that thing doesn't put out 2, then eat it. And when something says 1, say 2.

Robot DNA