Results 1 to 8 of 8

Thread: Compare GameIDs in list to add to arraylist VB.NET

  1. #1
    khaos64's Avatar
    Join Date
    Mar 2012
    Gender
    Location
    FL
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts


    Downloads
    12
    Uploads
    0
    Mentioned
    2 Post(s)
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    6

    Compare GameIDs in list to add to arraylist VB.NET

    Quote Originally Posted by ./m View Post
    I'd suggest grouping each gameid structure into it's own array, then shuffle those arrays, then output. That seems like the simplest way IMO
    @./m
    Thanks for the suggestion - I have been able to get all games into their own individual array, but haven't figured out a way to compare one to the next to see if they match to put them in array list together. I did at one point try and delete the "GameID: " portion so the array started right at the ID number, but still didn't know where to go from there. Any suggestions, Thanks.

  2. #2
    Saiyan Race





    Infamous Joe's Avatar
    Join Date
    Dec 2011
    Gender
    Location
    Hyperbolic Time Chamber
    Age
    26
    Posts
    9,758
    Thanks
    2,780
    Thanked 16,247 Times in 4,239 Posts


    Downloads
    23
    Uploads
    36
    Mentioned
    2987 Post(s)
    Time Online
    294 d 4 m
    Avg. Time Online
    3 h 44 m
    Rep Power
    10
    Gamer IDs

    Gamertag: Infam0us Joe Steam ID: infamousjoe
    Err like you said, but instead of removing "GameID:", why not extract the game ID value and the index of the array (to know where you're at) and then compare that way?

  3. #3
    khaos64's Avatar
    Join Date
    Mar 2012
    Gender
    Location
    FL
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts


    Downloads
    12
    Uploads
    0
    Mentioned
    2 Post(s)
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    6
    Quote Originally Posted by Infamous Joe View Post
    Err like you said, but instead of removing "GameID:", why not extract the game ID value and the index of the array (to know where you're at) and then compare that way?
    Thanks for the reply Joe,

    That was my original idea.

    I was trying something like this to extract the ID's, Worked outside the loop but inside gave me an error and wasn't sure how to fix it/going about it a different way .



    Fiddled a little more and found something that works at extracting the IDs, now just need to figure out the hard part.
    Last edited by khaos64; 03-09-2012 at 03:08 AM. Reason: Able to extract ID

  4. #4
    Banned
    Join Date
    Dec 2011
    Gender
    Age
    25
    Posts
    490
    Thanks
    304
    Thanked 549 Times in 260 Posts


    Downloads
    13
    Uploads
    4
    Mentioned
    34 Post(s)
    Time Online
    1 h 58 m
    Avg. Time Online
    N/A
    Rep Power
    0
    I'm assuming you have lists somewhat like this:

    +-------+-----+-----+------+------+---+
    |gameID|time1|time2|score1|score2|mod|
    +-------+-----+-----+------+------+---+
    |1 |10
    +-------+-----+-----+------+------+---+
    |1 |13
    +-------+-----+-----+------+------+---+
    |2 |44
    +-------+-----+-----+------+------+---+

    etc...

    Basically what I was suggesting was looping through your list, putting each one with a certain gameID into an array of sorts, then sorting THAT array

    I.E. (php-esque psudocode)



    You'd end up with an array of multiple list items. Sort this however you see fit. Custom data structures might be useful for it as well, depending on your language

  5. #5
    khaos64's Avatar
    Join Date
    Mar 2012
    Gender
    Location
    FL
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts


    Downloads
    12
    Uploads
    0
    Mentioned
    2 Post(s)
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    6
    Quote Originally Posted by ./m View Post
    I'm assuming you have lists somewhat like this:

    +-------+-----+-----+------+------+---+
    |gameID|time1|time2|score1|score2|mod|
    +-------+-----+-----+------+------+---+
    |1 |10
    +-------+-----+-----+------+------+---+
    |1 |13
    +-------+-----+-----+------+------+---+
    |2 |44
    +-------+-----+-----+------+------+---+

    etc...

    Basically what I was suggesting was looping through your list, putting each one with a certain gameID into an array of sorts, then sorting THAT array

    I.E. (php-esque psudocode)



    You'd end up with an array of multiple list items. Sort this however you see fit. Custom data structures might be useful for it as well, depending on your language

    Kinda went over my head with that one a little, I don't see how in VB.NET I could do it that way. Since the gameid's could always be changing from 3-4 characters and I don't know of a way to tell the program to recognize that the numbers after "GameID: " is to take identical IDs and make their own array. Not unless it is done someway as Joe had said by extracting the IDs and index to make an array.

  6. #6
    Banned
    Join Date
    Dec 2011
    Gender
    Age
    25
    Posts
    490
    Thanks
    304
    Thanked 549 Times in 260 Posts


    Downloads
    13
    Uploads
    4
    Mentioned
    34 Post(s)
    Time Online
    1 h 58 m
    Avg. Time Online
    N/A
    Rep Power
    0
    Not sure if VB.NET has associative arrays or maps, maybe Joe can explain it better

  7. #7
    khaos64's Avatar
    Join Date
    Mar 2012
    Gender
    Location
    FL
    Posts
    5
    Thanks
    2
    Thanked 0 Times in 0 Posts


    Downloads
    12
    Uploads
    0
    Mentioned
    2 Post(s)
    Time Online
    N/A
    Avg. Time Online
    N/A
    Rep Power
    6
    Yea, I don't know.

    But I think I may have found a way to do it, with something called a Bubble Sort, I just cant figure out what kind of IF will allow me to add each matching ID to an array and then start a new array once there isn't a match and start adding the IDs of matching to it until a nonmatching and and etc etc



    Do you think this maybe be able to do it or am I wasting my time?

  8. #8
    Little Brother


    Zachafer's Avatar
    Join Date
    Dec 2011
    Gender
    Posts
    1,206
    Thanks
    723
    Thanked 1,392 Times in 651 Posts


    Downloads
    81
    Uploads
    17
    Mentioned
    497 Post(s)
    Time Online
    21 d 17 h 35 m
    Avg. Time Online
    16 m
    Rep Power
    15
    If you elaborated on your question and included example before and after data, I could help you.

Tags for this Thread

Posting Permissions

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