Noughts and crosses in scala