Skip to main content
added 4 characters in body
Source Link

Ruby, 4850 bytes

p (0..~/$/).any?{|n|$_[n,2].to_i.chr=~/\p{Alnum}/}

Reads from standard input; requires the Ruby interpreter be invoked with the -n option (implicit while gets loop).

Could be reduced to 4143 bytes if it were allowed to match underscores.

p (0..~/$/).any?{|n|$_[n,2].to_i.chr=~/\w/}

Ruby, 48 bytes

(0..~/$/).any?{|n|$_[n,2].to_i.chr=~/\p{Alnum}/}

Reads from standard input; requires the Ruby interpreter be invoked with the -n option (implicit while gets loop).

Could be reduced to 41 bytes if it were allowed to match underscores.

(0..~/$/).any?{|n|$_[n,2].to_i.chr=~/\w/}

Ruby, 50 bytes

p (0..~/$/).any?{|n|$_[n,2].to_i.chr=~/\p{Alnum}/}

Reads from standard input; requires the Ruby interpreter be invoked with the -n option (implicit while gets loop).

Could be reduced to 43 bytes if it were allowed to match underscores.

p (0..~/$/).any?{|n|$_[n,2].to_i.chr=~/\w/}
Source Link

Ruby, 48 bytes

(0..~/$/).any?{|n|$_[n,2].to_i.chr=~/\p{Alnum}/}

Reads from standard input; requires the Ruby interpreter be invoked with the -n option (implicit while gets loop).

Could be reduced to 41 bytes if it were allowed to match underscores.

(0..~/$/).any?{|n|$_[n,2].to_i.chr=~/\w/}