sqr turns a positive number into the square root of that number. it turns a negative number into 0
Ohh, silly me. I thought it was *squaring*, not square rooting.
Edit: Avoiding double-posting.
There is already an article about how to do that (entitled "Conditionless Bots"), of course, but it doesn't give good solutions for and/or/xor/not. That said, a few of the solutions in the post above are kind of pointless, too (or perhaps out of date? How old are the "new math operators"?). It says:
Connect all of the gene's conditions with boolean operations.
or -> add sgn
and -> mult
not -> 1 sub dup div
xor -> sub dup div
But when the things you're using them on are going to be only either 0 or 1, you can use these instead:
or becomes |
and becomes &
not becomes - ++
xor becomes ^
Those are just the bitwise versions of those operators, except for not, since the bitwise not operator (~, the complement operator) would (if it works like it does in asm) turn 0 into -1 (0xffffffff) and 1 into 0xfffffffe (-2).
("x - ++" is identical to "1 x sub")
For the other operators, I'm doing this:
> becomes 'sub sgn 0 floor'
< becomes 'sub sgn - 0 floor'
>= becomes 'sub 1 add sgn 0 floor'
<= becomes 'sub 1 sub sgn - 0 floor'
= becomes 'sub sgn abs - ++'
!= becomes 'sub sgn abs'
I haven't given much thought to what ~= and %= and the like could be converted to, since the wiki says that they're more or less useless.