0

I basically need to get user input:

gets.chomp("input?")

And then to convert the given input to binary.

That's the part I don't get. :(

Adam Lear
  • 38,111
  • 12
  • 81
  • 101
Delta
  • 55
  • 1
  • 7

1 Answers1

1

Try this.

a = gets.chomp
puts a.each_byte.map {|y| sprintf "%08b", y}.join " "
Asherah
  • 18,948
  • 5
  • 53
  • 72
Jason Kim
  • 18,102
  • 13
  • 66
  • 105