Ad
  • Default User Avatar

    thanks for that

    the code is:

    class Integer
      def reverse(a)
       a.to_s(2) == bin_a #integer to binary
       bin_a.to_s.reverse_inplace!.to_i = bin_b #reverse order of binary
       return bin_b.to_int #new binary to integer
      end
    end
    
  • Default User Avatar

    I could use some help with this one. I've worked out what I need to do, I just can't seem to make the code work for it for some reason. I keep coming up against the error: wrong number of arguments given, expected 1, received 0.

    Unfortunately I also can't work out how to post my code in the comment boxes either so if someone could also tell me how to do that I can add the code into this.

    Thanks in advance

  • Default User Avatar

    I managed to get the static tests to work but the random tests failed as my code didn't work for random names other than the ones in the instructions and sample tests.
    I'm very new to Ruby and coding in general (completed the codeacademy course only recently and not done any other katas yet!) and I'm not sure where to start with returning any names, let alone returning the first two names then the number of other people.

    Any chance someone could point me in the right direction?