Darwinbots Forum

Code center => Darwinbots Program Source Code => Topic started by: Botsareus on April 26, 2009, 12:04:06 PM

Title: += -= *= /=
Post by: Botsareus on April 26, 2009, 12:04:06 PM
I want to make the following code work from case4 to case7:

Quote
Private Sub ExecuteStores(n As Integer)
   Select Case n
     Case 1 'store
       DNAstore
     Case 2 'inc
       DNAinc
     Case 3 'dec
       DNAdec
     Case 4 '+=
     Case 5 '-=
     Case 6 '*=
     Case 7 '/=
   End Select
End Sub

I will like to know two things before I get started:

1.) How much energy I should charge?
       
Quote
store charges:  - (SimOpts.Costs(COSTSTORE) * SimOpts.Costs(COSTMULTIPLIER))
         inc and dec charge: - (SimOpts.Costs(COSTSTORE) * SimOpts.Costs(COSTMULTIPLIER)) / 10


2.) This is how the /= works if I am not mistaken:
Quote
3
20
/=

is the same as:
Quote
20 *
3
div
20
store

Am I correct?
Title: += -= *= /=
Post by: Numsgil on April 26, 2009, 07:14:25 PM
At the moment those commands are no-ops.

But if you want 'em in, it looks like you have the right idea.  Charge 'em as a normal store, and treat them like you did.
Title: += -= *= /=
Post by: Botsareus on April 26, 2009, 08:01:21 PM
Sounds like a plan.  
Title: += -= *= /=
Post by: Prsn828 on April 26, 2009, 08:53:41 PM
Ooohh! Sounds like something new to play with soon!
Am I right? I hope I am
Title: += -= *= /=
Post by: Arzgarb on April 27, 2009, 02:06:08 PM
I'd change their names to something like "addstore, substore, multstore, divstore" to better fit in with the current syntax and to avoid confusion with !=, %= etc.