6 added 12 characters in body
source | link

Ruby, 66 52 (shows only which one is longer)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143 139139 140 (also shows how much longer it is)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
d=->e{(Math.log10(e.to_i)+1).floor.next.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>

Ruby, 66 52 (shows only which one is longer)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143 139 (also shows how much longer it is)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
d=->e{(Math.log10(e.to_i)+1).floor.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>

Ruby, 66 52 (shows only which one is longer)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143 139 140 (also shows how much longer it is)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
d=->e{Math.log10(e.to_i).floor.next.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>
5 added 20 characters in body
source | link

Ruby, 66 52 (shows only which one is longer)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143 139 (also shows by how much longer it is)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
d=->e{(Math.log10(e.to_i)+1).floor.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>

Ruby, 66 52 (shows only which one)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143 139 (also shows by how much)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
d=->e{(Math.log10(e.to_i)+1).floor.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>

Ruby, 66 52 (shows only which one is longer)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143 139 (also shows how much longer it is)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
d=->e{(Math.log10(e.to_i)+1).floor.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>
4 added 12 characters in body
source | link

Ruby, 6666 52 (shows only which one)

a=getsf=->{gets.gsub(/./,?1).to_i}
b=gets.gsub(/./,?1).to_ia=f[]
b=f[]
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143143 139 (also shows by how much)

a=getsf=->{gets.gsub(/./,?1)}
b=gets.gsub(/./,?1)a=f[]
b=f[]
d=->e{(Math.log10(e.to_i)+1).floor.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>

Ruby, 66 (shows only which one)

a=gets.gsub(/./,?1).to_i
b=gets.gsub(/./,?1).to_i
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143 (also shows by how much)

a=gets.gsub(/./,?1)
b=gets.gsub(/./,?1)
d=->e{(Math.log10(e.to_i)+1).floor.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>

Ruby, 66 52 (shows only which one)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
puts'sab'[a<=>b]

Prints s for same, a for string a, and b for string b.

Ruby, 184 173 146 143 139 (also shows by how much)

f=->{gets.gsub(/./,?1)}
a=f[]
b=f[]
d=->e{(Math.log10(e.to_i)+1).floor.to_s}
puts(a==b ? ?s:(c=a.sub(b,''))!=a ? ?a+d[c]:?b+d[b.sub(a,'')])

Sample run:

c:\a\ruby>stringcmp
testing123
testing
a3

c:\a\ruby>stringcmp
codegolf.SE
code golf . stack exchange
b15

c:\a\ruby>stringcmp
test
test
s

c:\a\ruby>
3 deleted 46 characters in body
source | link
2 added 452 characters in body
source | link
1
source | link