Chess Validator in Ruby