Creating an amount of data that can be added to
Blitz3D Forums/Blitz3D Beginners Area/Creating an amount of data that can be added to
| ||
I'm trying to make a Koch curve in blitz3d, but in order to do that, I'll need a huge bank of data that can be added to, I need to be able to add segments to the curve ... What I want is a method of creating a mass of information with x and y co-ords and the x and y co-ords the segment is attached to. Because this is of infinite length, the group of knowledge must be able to be added to. (for anybody who doesn't know what a koch curve is, find it here) |
| ||
Use banks or types. If the bank of data doesn't need inserts/deletions and speed is important then use banks. |
| ||
how do banks work? |
| ||
A bank is created with CreateBank. It's size is given in bytes. An integer is 4 bytes. A float too.;create bank that can store 255 integers/floats bank = CreateBank(255 * 4) You can write to the bank with the Poke commands: PokeByte, PokeShort, PokeInt and PokeFloat. These commands need the bank as a parameter, followed by the writing position (in bytes) and the value that should be written: ;write first integer to bank at position (0 * 4) PokeInt bank, 0, 10 ;write second integer to bank at position (1 * 4) PokeInt bank, 4, 226 ;write second integer to bank at position (2 * 4) PokeInt bank, 8, 192 You can read from the bank with the Peek commands: PeekByte, PeekShort, PeekInt en PeekFloat: Print PeekInt(bank, 0) Print PeekInt(bank, 4) Print PeekInt(bank, 8) |
| ||
ok thanks |
| ||
However, I think -from what I understand of the wikipedia page- that Types could be more handy. I believe you need to delete data as well ? |
| ||
yes, I think so...actually, I might not do that...I'm too busy with that conversation thing you help me with :) |