Ad
  • Default User Avatar
  • Default User Avatar

    done

  • Default User Avatar
  • Default User Avatar

    thank you very much for the notice. I have made a change to the RTG, albeit somewhat clumsy, it works:

            ull a_b_c_d[4] = { 0 };
            while(
                a_b_c_d[0] == a_b_c_d[1] ||
                a_b_c_d[0] == a_b_c_d[2] ||
                a_b_c_d[0] == a_b_c_d[3] ||
                a_b_c_d[1] == a_b_c_d[2] ||
                a_b_c_d[1] == a_b_c_d[3] ||
                a_b_c_d[2] == a_b_c_d[3]  
            ) {
                a_b_c_d[0] = rand() % 101 + 1;
                a_b_c_d[1] = rand() % 101 + 1;
                a_b_c_d[2] = rand() % 101 + 1;
                a_b_c_d[3] = rand() % 101 + 1;
            }
            qsort(a_b_c_d, EIGHT / 2, sizeof(ull), comp_ull);
            ull a = a_b_c_d[0],
                b = a_b_c_d[1],
                c = a_b_c_d[2],
                d = a_b_c_d[3];
    
  • Custom User Avatar

    one tiny bug: rand(0...10) that's inclusive, so that's 11 outcomes where in python it's 10. I don't actually care and will approve that, would be nice if it's the same though. same with 0...5 of course

    It's not inclusive.

    I added the other cases.

  • Custom User Avatar

    There are also some extra edge case tests in JS which are probably worth adding:

    it("more fixed tests ( d < 800 )", function() {
        assert.strictEqual( alphabet([4,51,2,51,2,1,8,204]), 51 );
        assert.strictEqual( alphabet([7,9,747,7,1,63,83,83]), 83 );
        assert.strictEqual( alphabet([520,3,39,3,13,40,40,1]), 40 );
        assert.strictEqual( alphabet([1,350,15,8050,345,350,15,23]), 350 );
        assert.strictEqual( alphabet([737,639,9,71,4422,6,54,52327]), 737 );
      });
    
  • Custom User Avatar

    You're right, and thanks for the feedback. I made them distinct and followed the logic of Python snippet you provided. Check it out!

  • Custom User Avatar

    I did make a few minor changes to the add_a_randomly and then increased the size of the pile in make_deck => (12,24)

  • Custom User Avatar

    Ok, I added "from solution import pick_em_up". I did not realize that is how it worked. Yes, I didn't like the nested if either. I did know the percents were not perfect and thought about doing the math for it but as you said, they are rather arbitrary and I needed some random statements that worked.

    Thanks again for all your help.

  • Custom User Avatar

    I'm sorry, I don't see where import * is.

    I added your fresh package, thank you for that.

    I also updated the random code to do and explain the percentanges better.

    Am I on the right track?

  • Custom User Avatar

    Ok, I deleted the reference to array of strings as it should be implied like you mentioned.
    I updated the other line to
    I have "thrown" your deck of cards into a "pile" (a list with rows of varying length).

    Thanks again for the help.

  • Custom User Avatar

    Usually they're called "jagged array".

  • Custom User Avatar

    I had feedback when I posted this before that I should have all the elements in the nested lists be strings. I was trying to point that out. Will rewording it to "All elements in the nested lists will be strings" make more sense.

    Would just using "a list of random length lists" be better comminucation vs "multidimensional array"?

    Thank you for your feedback.

  • Custom User Avatar

    fixed

  • Custom User Avatar
  • Loading more items...