7 deleted 6 characters in body
source | link

Ruby 161161 145

Reads the tabstop specification on the first line of input.

i=0
t=[]i=t=[]
gets.scan(/(\+)?(\d+)/){x=$2t<<i=$2.to_i;t<<x+to_i+($1?i:0);i=x}
l=t[-1]
8081.times{|i|t<<i*l|j|t<<j*i}
while gets
$_.sub!$&," "*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

i is a temporary variable for holding the last parsed tabstop. t is the list of tabstobs, parsed from the gets.scan line. For good measure we add 80 increments81 multiples of the last parsed tabstop. the while gets loop keeps going until there is no more input. For each line of input we substitute tabs for spaces, one tab at the time because the string moves as we add the spaces and we must recalculate the correct tabstop.

Ruby 161

Reads the tabstop specification on the first line of input.

i=0
t=[]
gets.scan(/(\+)?(\d+)/){x=$2.to_i;t<<x+($1?i:0);i=x}
l=t[-1]
80.times{|i|t<<i*l}
while gets
$_.sub!$&," "*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

i is a temporary variable for holding the last parsed tabstop. t is the list of tabstobs, parsed from the gets.scan line. For good measure we add 80 increments of the last parsed tabstop. the while gets loop keeps going until there is no more input. For each line of input we substitute tabs for spaces, one tab at the time because the string moves as we add the spaces and we must recalculate the correct tabstop.

Ruby 161 145

Reads the tabstop specification on the first line of input.

i=t=[]
gets.scan(/(\+)?(\d+)/){t<<i=$2.to_i+($1?i:0)}
81.times{|j|t<<j*i}
while gets
$_.sub!$&," "*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

i is a temporary variable for holding the last parsed tabstop. t is the list of tabstobs, parsed from the gets.scan line. For good measure we add 81 multiples of the last parsed tabstop. the while gets loop keeps going until there is no more input. For each line of input we substitute tabs for spaces, one tab at the time because the string moves as we add the spaces and we must recalculate the correct tabstop.

6 again, my debug version used "." instead of space
source | link

Ruby 161

Reads the tabstop specification on the first line of input.

i=0
t=[]
gets.scan(/(\+)?(\d+)/){x=$2.to_i;t<<x+($1?i:0);i=x}
l=t[-1]
80.times{|i|t<<i*l}
while gets
$_.sub!$&,". "*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

i is a temporary variable for holding the last parsed tabstop. t is the list of tabstobs, parsed from the gets.scan line. For good measure we add 80 increments of the last parsed tabstop. the while gets loop keeps going until there is no more input. For each line of input we substitute tabs for spaces, one tab at the time because the string moves as we add the spaces and we must recalculate the correct tabstop.

Ruby 161

Reads the tabstop specification on the first line of input.

i=0
t=[]
gets.scan(/(\+)?(\d+)/){x=$2.to_i;t<<x+($1?i:0);i=x}
l=t[-1]
80.times{|i|t<<i*l}
while gets
$_.sub!$&,"."*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

i is a temporary variable for holding the last parsed tabstop. t is the list of tabstobs, parsed from the gets.scan line. For good measure we add 80 increments of the last parsed tabstop. the while gets loop keeps going until there is no more input. For each line of input we substitute tabs for spaces, one tab at the time because the string moves as we add the spaces and we must recalculate the correct tabstop.

Ruby 161

Reads the tabstop specification on the first line of input.

i=0
t=[]
gets.scan(/(\+)?(\d+)/){x=$2.to_i;t<<x+($1?i:0);i=x}
l=t[-1]
80.times{|i|t<<i*l}
while gets
$_.sub!$&," "*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

i is a temporary variable for holding the last parsed tabstop. t is the list of tabstobs, parsed from the gets.scan line. For good measure we add 80 increments of the last parsed tabstop. the while gets loop keeps going until there is no more input. For each line of input we substitute tabs for spaces, one tab at the time because the string moves as we add the spaces and we must recalculate the correct tabstop.

5 added 426 characters in body
source | link

Ruby 163161

Reads the tabstop specification on the first line of input.

i=0
t=[]
gets.scan(/(\+)?(\d+)/){x=$2.to_i;t<<x+($1?i:0);i=x}
l=t[-1]
7980.times{|i|t<<-~i*l|i|t<<i*l}
while gets
$_.sub!$&,"."*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

i is a temporary variable for holding the last parsed tabstop. t is the list of tabstobs, parsed from the gets.scan line. For good measure we add 80 increments of the last parsed tabstop. the while gets loop keeps going until there is no more input. For each line of input we substitute tabs for spaces, one tab at the time because the string moves as we add the spaces and we must recalculate the correct tabstop.

Ruby 163

Reads the tabstop specification on the first line of input.

i=0
t=[]
gets.scan(/(\+)?(\d+)/){x=$2.to_i;t<<x+($1?i:0);i=x}
l=t[-1]
79.times{|i|t<<-~i*l}
while gets
$_.sub!$&,"."*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

Ruby 161

Reads the tabstop specification on the first line of input.

i=0
t=[]
gets.scan(/(\+)?(\d+)/){x=$2.to_i;t<<x+($1?i:0);i=x}
l=t[-1]
80.times{|i|t<<i*l}
while gets
$_.sub!$&,"."*(t.find{|s|s>i=$`.size}-i)while~/\t/
print
end

edit: Added two lines that makes the last read tabstop repeat so that tabstop specifications of a single number also works correctly

i is a temporary variable for holding the last parsed tabstop. t is the list of tabstobs, parsed from the gets.scan line. For good measure we add 80 increments of the last parsed tabstop. the while gets loop keeps going until there is no more input. For each line of input we substitute tabs for spaces, one tab at the time because the string moves as we add the spaces and we must recalculate the correct tabstop.

4 added 156 characters in body
source | link
3 forgot to replace "." used for debugging
source | link
2 deleted 2 characters in body
source | link
1
source | link