Thread: [Kotlin] Random Permutation

Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 52
  1. #21  
    Registered Member
    Velocity's Avatar
    Join Date
    Jan 2009
    Age
    25
    Posts
    2,029
    Thanks given
    1,013
    Thanks received
    2,373
    Rep Power
    4112
    Quote Originally Posted by Gluon View Post
    To ensure that its actually generating a unique set of random indices that cover the entire scope of the array/collection you're using them on. That no indices are missing/duplicated/wrong.
    it's illegal to steal my message and wrap it in a burrito shell and claim it as your own
    xxxxxxx
    Reply With Quote  
     

  2. #22  
    touched like seafood
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    23
    Posts
    4,837
    Thanks given
    1,676
    Thanks received
    1,567
    Discord
    View profile
    Rep Power
    1390
    Quote Originally Posted by Gluon View Post
    To ensure that its actually generating a unique set of random indices that cover the entire scope of the array/collection you're using them on. That no indices are missing/duplicated/wrong.
    Why did you stop at 1000?
    [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] (official dog of rune-server)
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Reply With Quote  
     

  3. #23  
    Community Veteran


    Join Date
    Dec 2008
    Posts
    4,264
    Thanks given
    405
    Thanks received
    432
    Discord
    View profile
    Rep Power
    1684
    Quote Originally Posted by Tyluur View Post
    Why did you stop at 1000?
    I can invite you to the repo so you can cover each test 1->2^31-1 for me
    Reply With Quote  
     

  4. #24  
    touched like seafood
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    23
    Posts
    4,837
    Thanks given
    1,676
    Thanks received
    1,567
    Discord
    View profile
    Rep Power
    1390
    Quote Originally Posted by Gluon View Post
    I can invite you to the repo so you can cover each test 1->2^31-1 for me
    My discord is in my postbit thing
    [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] (official dog of rune-server)
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Reply With Quote  
     

  5. #25  
    Registered Member
    JayArrowz's Avatar
    Join Date
    Sep 2008
    Posts
    67
    Thanks given
    60
    Thanks received
    64
    Discord
    View profile
    Rep Power
    392
    You could most likely parametrize the tests so you dont have 10 different test cases instead a single test case with multiple params. Other than that seems cool

    [Only registered and activated users can see links. ]

    Edit:

    Why are you testing constants lol? Unit tests are meant to test a single unit of your OWN functionality not if kotlin adheres to keeping a constant a constant :\:

    Code:
       @[Only registered and activated users can see links. ]
    	fun testConstants() {
    		assertEquals(1_0_1_3_9_0_4_2_2_3, RandomPermutation.c)
    		assertEquals(1_6_6_4_5_2_5, RandomPermutation.a)
    	}
    Reply With Quote  
     

  6. Thankful user:


  7. #26  
    Community Veteran


    Join Date
    Dec 2008
    Posts
    4,264
    Thanks given
    405
    Thanks received
    432
    Discord
    View profile
    Rep Power
    1684
    Quote Originally Posted by Tyluur View Post
    My discord is in my postbit thing
    Doesn't work. Add me Gluon#3992
    Reply With Quote  
     

  8. #27  
    touched like seafood
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    23
    Posts
    4,837
    Thanks given
    1,676
    Thanks received
    1,567
    Discord
    View profile
    Rep Power
    1390
    Quote Originally Posted by Gluon View Post
    Doesn't work. Add me Gluon#3992
    Adding. Prob cuz we’re on vb4 and not xenforo.
    [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] (official dog of rune-server)
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Reply With Quote  
     

  9. #28  
    Community Veteran


    Join Date
    Dec 2008
    Posts
    4,264
    Thanks given
    405
    Thanks received
    432
    Discord
    View profile
    Rep Power
    1684
    Quote Originally Posted by JayArrowz View Post
    You could most likely parametrize the tests so you dont have 10 different test cases instead a single test case with multiple params. Other than that seems cool

    [Only registered and activated users can see links. ]

    Edit:

    Why are you testing constants lol? Unit tests are meant to test a single unit of your OWN functionality not if kotlin adheres to keeping a constant a constant :\:

    Code:
       @[Only registered and activated users can see links. ]
    	fun testConstants() {
    		assertEquals(1_0_1_3_9_0_4_2_2_3, RandomPermutation.c)
    		assertEquals(1_6_6_4_5_2_5, RandomPermutation.a)
    	}
    Because I accidentally replaced them once when doing a server wide Ctrl + Shift + R to replace some hardcoded packet id and couldn't figure out why my pid wasn't shuffling properly lmfao. Those values need to be those exact values so doesn't hurt to test them to ensure they haven't changed.
    Reply With Quote  
     

  10. #29  
    touched like seafood
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    23
    Posts
    4,837
    Thanks given
    1,676
    Thanks received
    1,567
    Discord
    View profile
    Rep Power
    1390
    Quote Originally Posted by Gluon View Post
    Because I accidentally replaced them once when doing a server wide Ctrl + Shift + R to replace some hardcoded packet id and couldn't figure out why my pid wasn't shuffling properly lmfao. Those values need to be those exact values so doesn't hurt to test them to ensure they haven't changed.
    This is the same energy that started project insanity.
    [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] | [Only registered and activated users can see links. ] (official dog of rune-server)
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Reply With Quote  
     

  11. Thankful user:


  12. #30  
    Registered Member
    JayArrowz's Avatar
    Join Date
    Sep 2008
    Posts
    67
    Thanks given
    60
    Thanks received
    64
    Discord
    View profile
    Rep Power
    392
    Quote Originally Posted by Gluon View Post
    Because I accidentally replaced once them when doing a server wide Ctrl + Shift + R to replace some hardcoded packet id and couldn't figure out why my pid wasn't shuffling properly lmfao. Those values need to be those exact values so doesn't hurt to test them to ensure they haven't changed.
    Fair I guess its a benefit then, for example, if someone's CI stops a person from committing a PR due to the testConstants unit test failing then atleast the dev knows that they changed a value they shouldn't have.
    Reply With Quote  
     

Page 3 of 6 FirstFirst 12345 ... LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Some Random Events
    By Eleclion in forum Tutorials
    Replies: 4
    Last Post: 05-15-2007, 11:38 PM
  2. Guardian Random Events
    By Eleclion in forum Tutorials
    Replies: 3
    Last Post: 05-12-2007, 08:21 PM
  3. Some Random S**t
    By Darklordants Evil Bro in forum Showcase
    Replies: 2
    Last Post: 04-13-2007, 09:42 PM
  4. A few Random Renders...
    By oblak10 in forum General
    Replies: 2
    Last Post: 04-02-2007, 04:31 AM
  5. my latest sigs :D and random GFX
    By Oblak Lol in forum Showcase
    Replies: 10
    Last Post: 03-31-2007, 10:41 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •