Noughts and Crosses

Published in Programming - 1 min to read

As part of my efforts to learn Go, this week I wrote my first (exceptionally basic) program from scratch in the language. It lets you play noughts and crosses against the Go compiler on the command line, and you can read the code/setup instructions here. I didn’t code any logic for the way the computer chooses moves, it just picks randomly, so it shouldn’t present too much of a challenge.

It was pretty fun, I only wanted to get to grips with some of the most basic features of the languages. The code isn’t structured very well and isn’t particularly idiomatic either, a cardinal sin in Go, but at least it works.