AndreA
AndreA

Reputation: 789

Netlogo - Origin in the corner with code

I need to have a martix of patches which axis are long a power of 2 ( 2^n ) for example 16.

I thought this can be done or having the corner but i need to do this with a line of code because i want it to be set with the setup button.

Upvotes: 3

Views: 159

Answers (1)

Bryan Head
Bryan Head

Reputation: 12580

You can do this with resize-world:

resize-world 0 (2 ^ n - 1) 0 (2 ^ n - 1)

You may also want to set the patch size with set-patch-size so that the view remains stays the same size no matter how many patches you have:

set-patch-size 400 / (2 ^ n)

Upvotes: 3

Related Questions