A javascript implementation of the 'train game'