Code center > Darwinbots3

enginering a compromize

(1/2) > >>

Botsareus:
Numsgil  can you show me how div , mult and sqrt commands look like in c#?

Also: what is the natural log command , what is the absolute value command and round to 0 desimal places command of c#?


--- Quote ---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"
--- End quote ---

also is 0 or 999 the top of stack? In my TI83+ I have 1 as the bottom of stack and 50 as the top. I will post the TI83+ source code convirted to mach your stack for move mdup mtt and ang. (Just remember ":5-->E" means E=5 , also, ":End" means "End For" or "End IF")

Peter:

--- Quote ---Numsgil can you show me how div , mult and sqrt commands look like in c#?

Also: what is the natural log command , what is the absolute value command and round to 0 desimal places command of c#?
--- End quote ---
If you wanted to see the code, didn't numsgil had a code reposery.(or anything but then spelled correct)

If else, I suppose there's a manuel somewhere,

And they are seem as pretty simple commands, I could say what I am guesing the code would be.  .But that wouldn't be right, havn't seen any C# code ever jet.


I gues you mean something more difficult then.

V=v*v <----is sqrt, I gues.

Numsgil:

--- Quote from: Botsareus ---Numsgil  can you show me how div , mult and sqrt commands look like in c#?

Also: what is the natural log command , what is the absolute value command and round to 0 desimal places command of c#?
--- End quote ---

Div: a / b;
Mult: a * b;
Sqrt: System.Math.Sqrt(a);

Most other math commands are also in the System.Math class/namespace, including absolute value and rounding.  C# is a stone's throw from C++ or Java in syntax.  It's probably going to be a bit of a shock if you've only ever coded in basic-derived languages.

As Peter pointed out, you can browse the source here.


--- Quote ---
--- Quote ---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"
--- End quote ---

also is 0 or 999 the top of stack? In my TI83+ I have 1 as the bottom of stack and 50 as the top. I will post the TI83+ source code convirted to mach your stack for move mdup mtt and ang. (Just remember ":5-->E" means E=5 , also, ":End" means "End For" or "End IF")
--- End quote ---

Apologies, but you lost me.  What are you quoting?  Where did move, mtt, mdup, and ang come from?  And why are we using a TI83+?

Botsareus:
I am using a TI-83 because I can't use anything more advanced in the hospital. move , mtt , mdup and ang are some commands I wanted you to add to DB. I thought It will be easyer for you to add them If I gave you the source code. (I wrote a small evo. program on my TI-83 thats uses the above commans) here is the link to the post were I explain them: Here

--- Quote ---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
--- End quote ---

P.S.
 It was raining here tuday so I could not bring my paper work over, I'll do it next week.
--- Quote ---also is 0 or 999 the top of stack?
--- End quote ---
  Sorry, I mixed the memory up with stack. What are the robot stack dimentions, that is were is the start of stack, the end of stack and the length of stack. By stack I mean:

3
4
mult

will be

--- Quote ---0 3
--- End quote ---

--- Quote ---3 4
--- End quote ---

--- Quote ---0 12
--- End quote ---

Numsgil:
Ah, okay.

If you can provide a theoretical example where existing DNA controls are inadequate, I'll try to address them and add to the language.  However, I'm generally trying to keep the command list short but sweet.

Navigation

[0] Message Index

[#] Next page

Go to full version