Ad
  • Default User Avatar

    Ha! Completely missed the fact that MORSE_CODE was defined already. Oops.

  • Default User Avatar

    Looking back, it's probably better to remove the duplicates in the foreach statement to make the function more efficient (foreach array_unique($arr) as $item) then just return the values of the merged array.

  • Default User Avatar

    Congrats on writing some PHP! You're right! I forgot array_rand() returns a random key, I should have put array_rand(array_flip(['L', 'M', 'R']) this would flip the key value pairs (eg. as a JavaScript object {0: 'L', 1: 'M', 2: 'R'} would become {L: 0, M: 1, R: 2}) then return a random key from that array, which would be the letter. This was my first translation, I appreciate the patience and help!

  • Default User Avatar

    Sorry for the radio silence! I didn't realize I had to confirm my email to comment! Tried several times on a couple of different browsers and clicking send just moved a status bar on the top but never posted the comments. There's no message that indicates you have to confirm your email first. Ended up finding the solution on a GitHub issue from 2016!

  • Default User Avatar

    I stupidly had the options of left, middle, CENTER for the piper position when generating random tests. I ran the randoms a couple of times it's strange I never came across the issue of it never picking "center". It should be fixed now though!