Difference between revisions of "In and Out"

From WikiManual
Jump to: navigation, search
Line 10: Line 10:
  
 
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.
 
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]]
 
[[Robot DNA]]

Revision as of 22:05, 1 March 2008

This refers to the .in1, .in2, .in3, .in4, .in5 .out1, .out2, .out3, .out4, .out5 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