Naive implementation of connect 4 in JavaScript