Skip to main content
deleted 110 characters in body
Source Link
daniero
  • 18.8k
  • 5
  • 52
  • 79

Ruby 2.0, 42 chars30 bytes

gets.chars.each_slicegsub!(2){|c,n|$><<c*n.to_i} 

Ruby 2.0, 41 chars

/(a=gets.chars)(.each)/){c,n,*a=a;$><<c*n$1*$2.to_i} 

Shows an error after the string has been printed; Run27 bytes code + 3 bytes to run it with something likethe ruby runlength.rb 2>/dev/null-p if you mind.flag:

$ ruby -p rld.rb <<< ":144,1'1" :4444,' 

Ruby 2.0, 42 chars

gets.chars.each_slice(2){|c,n|$><<c*n.to_i} 

Ruby 2.0, 41 chars

(a=gets.chars).each{c,n,*a=a;$><<c*n.to_i} 

Shows an error after the string has been printed; Run it with something like ruby runlength.rb 2>/dev/null if you mind.

Ruby, 30 bytes

gsub!(/(.)(.)/){$1*$2.to_i} 

27 bytes code + 3 bytes to run it with the -p flag:

$ ruby -p rld.rb <<< ":144,1'1" :4444,' 
added 199 characters in body
Source Link
daniero
  • 18.8k
  • 5
  • 52
  • 79

Ruby 2.0, 42 chars

gets.chars.each_slice(2){|c,n|$><<c*n.to_i} 

Ruby 2.0, 41 chars

(a=gets.chars).each{c,n,*a=a;$><<c*n.to_i} 

Shows an error after the string has been printed; Run it with something like ruby runlength.rb 2>/dev/null if you mind.

Ruby 2.0, 42 chars

gets.chars.each_slice(2){|c,n|$><<c*n.to_i} 

Ruby 2.0, 42 chars

gets.chars.each_slice(2){|c,n|$><<c*n.to_i} 

Ruby 2.0, 41 chars

(a=gets.chars).each{c,n,*a=a;$><<c*n.to_i} 

Shows an error after the string has been printed; Run it with something like ruby runlength.rb 2>/dev/null if you mind.

added 4 characters in body
Source Link
daniero
  • 18.8k
  • 5
  • 52
  • 79

Ruby 2.0, 42 chars

gets.chars.each_slice(2){|c,n|$><<c*n.to_i} 

Ruby, 42 chars

gets.chars.each_slice(2){|c,n|$><<c*n.to_i} 

Ruby 2.0, 42 chars

gets.chars.each_slice(2){|c,n|$><<c*n.to_i} 
Source Link
daniero
  • 18.8k
  • 5
  • 52
  • 79
Loading