Author Topic: PLEASE Need help with sintaxis  (Read 3582 times)

Offline Siegfried

  • Bot Neophyte
  • *
  • Posts: 4
    • View Profile
PLEASE Need help with sintaxis
« on: December 22, 2008, 12:03:48 AM »
Hey guys, im pretty new in here, no experience before in programing so I need help with some stuff, I need clear examples of the use of the  OR/AND/ELSE commands or whatever they are called, need examples beacuse this place lacks any tutorial or info about them, also I need some help understanding how the one gene bots work because I dont understand how they get their conditions or how do they know against what to react....if do you know what I mean

Offline Shasta

  • Administrator
  • Bot Destroyer
  • *****
  • Posts: 231
    • View Profile
PLEASE Need help with sintaxis
« Reply #1 on: December 22, 2008, 11:56:36 AM »
Quote from: Siegfried
Hey guys, im pretty new in here, no experience before in programing so I need help with some stuff, I need clear examples of the use of the  OR/AND/ELSE commands or whatever they are called, need examples beacuse this place lacks any tutorial or info about them, also I need some help understanding how the one gene bots work because I dont understand how they get their conditions or how do they know against what to react....if do you know what I mean
Alright, so first off, always check the wiki, there is some good stuff there, like this.

The AND/ect. commands are called boolean operators. This means they only perform operations on booleans, and return booleans. On the linked operator page there are some very good examples of how they work, so there is no need for me to restate them.

There are some pretty good resources in this forum about one gene bots actually. But, they work essentially just like a bot with multiple genes. As long as you don't have a cond block on your gene, the conditionals will always be evaluated, not necessarily the the non-conditionals however.
Code: [Select]
start
False
''''Code that is never run
True
''''Code is always run
stop
If you have any specific questions feel free to ask.

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
PLEASE Need help with sintaxis
« Reply #2 on: December 22, 2008, 01:29:38 PM »

Offline Siegfried

  • Bot Neophyte
  • *
  • Posts: 4
    • View Profile
PLEASE Need help with sintaxis
« Reply #3 on: December 22, 2008, 07:15:04 PM »
woow, thanks a lot! this is really useful information im surely going to carefully study all of this !tnx guys¡

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
PLEASE Need help with sintaxis
« Reply #4 on: December 25, 2008, 01:24:46 AM »
Hi, welcome!

The best way to get to grips with the syntax is to learn how how it works. Two booleans are pushed onto the boolean stack:

Quote
'Operators pop numbers from numerical stack and push values on boolean stack

 X Y !=
 A B >

Then the booleans are taken from the boolean stack and operated on:


Quote
'AND operator uses two boolean values and converts them into one value
 X Y !=
 A B >
and

The sites probably explained this much better, but a good reason to say hello, huh?  
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan