Darwinbots Forum
Code center => Suggestions => Topic started by: Botsareus on October 11, 2007, 02:02:46 PM
-
Some new commands:
nl 'natural log nl(10^3) / nl(10) = 3
sin ' sin(A) * 1000
cos 'cos(A) * 1000
sin(a) / cos(a) = tan(a) , there is no need for tan.
constants:
e 'nl(e/1000) = 1 e = 2718
pi = 3142
Instead of adding desimals we can do an internal A B root that does A ^ (1/B) but I have no idea how to write that in c# thats why I need examples
The following commands worked well in my TI-83 Project called Project duel:
A is the top of stack
B is the second from top
C is the third from top
D is the fourth from top
move 'moves a set of numbers to the lower stack. A is the ammount of stack elements , B is the position to which it is moved.
mtt 'moves a set of numbers from lower stack to top. A is the ammount of stack elements, B is the position from which it is moved.
mdup 'duplicates a set of numbers on the stack. A is the ammount of stack elements, B is the number of copys
and finaly the big one called "ang"
A = x1
B = x2
C = y1
D = y2
after taking four ang retuns two elements in stack
A = angle from point(x1,y1) to point (x2,y2)
B = Distance from point(x1,y1) to point (x2,y2)
P.S.
Numsgil I found a compromize. I will post it within the next 2 weeks.
-
There is also cndmove , cndmtt , and cndmdup. The cndmtt , cndmove and cndmdup is executed independent from the condition in the gene. (It's like they have a private "conditionless" attached to them)
I propose that the condition stack and the int. stack have a limit at 200.
Therefore if you want to popint for example: you write: 201 1 move
I also propose that the int. stack loops from the end to the biggining of the dna example:
.up
50
at first it will do 0 .up after words it will do 50 .up
finaly I want to add two more commands:
tpo 'to the power of. which maxes out on 9999
tro 'to the root of, with zeros and negative values it gets tricky but I will figure this out.
-
nl 'natural log nl(10^3) / nl(10) = 3
I'd say ln, and my calculator says ln(10) = 2,3
Edit: No, you're right I misread. I is an more complicated way to just say 10log1000.
nl(10^3) / nl(10) = 3 is true.
ln=natural log
I see nl=Nederland=The Netherlands
You want to make in darwinbots some geometry. Well, okay. Why, but okay.
-
The above has been updated
There is also cndmove , cndmtt , and cndmdup. The cndmtt , cndmove and cndmdup is executed independent from the condition in the gene. (It's like they have a private "conditionless" attached to them)