D
David Balmain
Got to get back to work. 166 chars;
a=3D$<.readlines;s=3D'dchs';c=3D'AKQJT9';t=3Da.shift;u=3D(t[0]+32).chr;i=3D=
s.index(u);v=3Ds[i-2].chr;puts
t,a.sort_by{|k|(k=3D~/J[#{u+v}]/?0:50)+(s.index(k[1])-i)%4*10+c.index(k[0])=
}
a=3D$<.readlines;s=3D'dchs';c=3D'AKQJT9';t=3Da.shift;u=3D(t[0]+32).chr;i=3D=
s.index(u);v=3Ds[i-2].chr;puts
t,a.sort_by{|k|(k=3D~/J[#{u+v}]/?0:50)+(s.index(k[1])-i)%4*10+c.index(k[0])=
}
David said:Ryan, how about changing /(J#{u})|(J#{v})/ to /J[#{u}#{v}]/? That'll
save you a couple more characters.
Damn, now I can see why you did it that way. Sorry. Please disregard.
No, your idea is right: he could still save one character using
/J(#{u})|(#{v})/
Regards,
Pit
This is the last time I play golf. It's addictive and I should be working=