SRL Archive - OSR Help

Lists/hashmap/arraylists


slushpuppy

2012-02-28 05:12:09

Hi,

Are there any data structures in pascal that I could use for data sorting/removal/access

masterBB

2012-02-28 05:24:08

I thought we only support arrays in pascal script. not sure though.

grats

2012-02-28 05:28:32

You could use lists too, no?

flat style databases, there are a bunch used for different scripts.. MSI uses these types for your accounts and which script they're on and what settings etc


[Main]
Running=True
Changed=False
Name=MSI Pheonix

[Players]
HowMany=1
Integers=4
Strings=0
Booleans=1

[Integers]
0=Total Loads
1=Break Loads
2=Total Time
3=Break Time

[Booleans]
0=Member

[Strings]
(0)HowMany=0

[0]
User=
Pass=
Pin=
Integer0=100
Integer1=45
Integer2=300
Integer3=60
Boolean0=True
Active=True

yea this is MSI's

slushpuppy

2012-02-28 06:02:49

It's pretty much for my building detection script- I am trying to determine if I am being surrounded by white walls. Do note that while others suggested floor colors, it clashes with the road colors too often

masterBB

2012-02-28 06:11:34

From: slushpuppy
It's pretty much for my building detection script- I am trying to determine if I am being surrounded by white walls. Do note that while others suggested floor colors, it clashes with the road colors too often


That's not easy at all -_-. The problem is not storing the data, but looking for gaps. http://villavu.com/forum/showthread.php?t=75882

slushpuppy

2012-02-28 08:14:30

From: masterBB
That's not easy at all -_-. The problem is not storing the data, but looking for gaps. http://villavu.com/forum/showthread.php?t=75882


I guess i'll have to get SRL member for that D:

Daniel

2012-03-07 05:28:26

From: slushpuppy
I guess i'll have to get SRL member for that D:


There are multiple ways to sort an array. QuickSort is one (for sorting integer arrays in ascending order). And QuickTPASort, SortCircleWise, SortTPAFrom, etc, for TPAs :) See http://docs.villavu.com/simba/scriptref/tpa.html for more details and help :)

Richard

2012-03-07 11:08:43

To make a hash map you could just use a 2D array, with one dimension not having explicit bounds, and the second having 2 ([0..1]). I assume you're coming from Java? In which case, there really isn't anything as dynamic and customisable as lists, but you can have inexplicit arrays, and then add one length to the array each time you're adding a value. You could easily make a method to do that.