scala implementation of a TAW game