Darwinbots Forum

Bots and Simulations => DNA - General => Topic started by: Peksa on November 24, 2007, 09:42:31 AM

Title: A question
Post by: Peksa on November 24, 2007, 09:42:31 AM
What happens if you try to store a value in location above 1000? Is the location modded (12345 1000 mod)?

EDIT:
Can you store memory location into a memory location?
Eg.
Code: [Select]
start
blah blab >
400 *971 store
Title: A question
Post by: Numsgil on November 24, 2007, 09:48:21 AM
Memory locations are just numbers, so you can store the numbers in a memory location no problem.  Then you can dereference them with the * operator, like in your example.  So yeah, things like pointers are quite possible.

I believe Eric has implemented modding for values > 1000 and values < 0, but I'm not 100% sure on that, so you'll need to double check.
Title: A question
Post by: Peksa on November 24, 2007, 09:51:52 AM
So even 98 **.eye5 store would be possible?
Title: A question
Post by: Numsgil on November 24, 2007, 10:05:42 AM
You would have to do

98 *.eye5 * store

but yeah, that would work.  Not sure what it would do though
Title: A question
Post by: EricL on November 24, 2007, 09:32:01 PM
The memory locaiton arguement for stores, incs and decs is indeed MODed for both postive and negative values with the exception that multiples of 1000 store to location 1000.

The only exception is a store to location 0, which by design, does nothing.