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
    28
    Posts
    2,028
    Thanks given
    1,013
    Thanks received
    2,376
    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  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,818
    Thanks received
    1,767
    Rep Power
    2438
    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?
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  3. #23  
    Community Veteran


    Join Date
    Dec 2008
    Posts
    4,263
    Thanks given
    405
    Thanks received
    436
    Rep Power
    1674
    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  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,818
    Thanks received
    1,767
    Rep Power
    2438
    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
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  5. #25  
    Extreme Donator

    JayArrowz's Avatar
    Join Date
    Sep 2008
    Posts
    104
    Thanks given
    99
    Thanks received
    107
    Rep Power
    810
    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

    https://gist.github.com/catalinsgh/5...lidatortest-kt

    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:
       @Test
    	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,263
    Thanks given
    405
    Thanks received
    436
    Rep Power
    1674
    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  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,818
    Thanks received
    1,767
    Rep Power
    2438
    Quote Originally Posted by Gluon View Post
    Doesn't work. Add me Gluon#3992
    Adding. Prob cuz we’re on vb4 and not xenforo.
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  9. #28  
    Community Veteran


    Join Date
    Dec 2008
    Posts
    4,263
    Thanks given
    405
    Thanks received
    436
    Rep Power
    1674
    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

    https://gist.github.com/catalinsgh/5...lidatortest-kt

    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:
       @Test
    	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  
    Registered Member
    Tyluur's Avatar
    Join Date
    Jun 2010
    Age
    26
    Posts
    5,103
    Thanks given
    1,818
    Thanks received
    1,767
    Rep Power
    2438
    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.
    Quote Originally Posted by blakeman8192 View Post
    Keep trying. Quitting is the only true failure.
    Spoiler for skrrrrr:

    Attached image
    Reply With Quote  
     

  11. Thankful user:


  12. #30  
    Extreme Donator

    JayArrowz's Avatar
    Join Date
    Sep 2008
    Posts
    104
    Thanks given
    99
    Thanks received
    107
    Rep Power
    810
    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
  •