The history is built by prepending, so reverse it when displaying chronological moves:Thus a reverse-stored history
override def toString: String =
game.mkString("[", ", ", "]") +
" history of flips: " + flips.reverse.toString[3,2,4] is displayed as List(4, 2, 3). The initial empty history remains List(). Neither traversal mutates the game or the immutable history. Displaying the stored list without reversing it would describe the moves backwards. Articles by others on the same topic
There are currently no matching articles.