Results 1 to 8 of 8

Thread: Lists/hashmap/arraylists

  1. #1
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default Lists/hashmap/arraylists

    Hi,

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

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    I thought we only support arrays in pascal script. not sure though.
    Working on: Tithe Farmer

  3. #3
    Join Date
    Feb 2007
    Location
    Colorado, USA
    Posts
    3,716
    Mentioned
    51 Post(s)
    Quoted
    624 Post(s)

    Default

    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


    Code:
    [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
    The only true authority stems from knowledge, not from position.

    You can contact me via matrix protocol: @grats:grats.win or you can email me at the same domain, any user/email address.

  4. #4
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default

    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

  5. #5
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Quote Originally Posted by slushpuppy View Post
    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
    Working on: Tithe Farmer

  6. #6
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default

    Quote Originally Posted by masterBB View Post
    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:

  7. #7
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by slushpuppy View Post
    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
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  8. #8
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •