reset password
Author Message
rabbott
Posts: 1649
Posted 10:56 Nov 03, 2016 |

I've made a number of word-level substitutions in the code. This changes nothing logically.

The major change is that I've changed Move to Change. So now the History module has the line:

type Change a = a -> a

I then changed the name of the function makeMove to applyAChange to make it more informative.

Finally, because there were a number of types that include TTT -> TTT, I've changed those to Change TTT. To allow that, the TicTacToe module now imports History, which is where type Change is defined. This creates a circular import chain, but that doesn't bother Haskell. 

As I said, these changes make no logical difference in the code. But they make the overall sense a bit clearer.

Please use the latest version of the code when you demonstrate your understanding. If you understood it before the changes, you should understand it now.

To demonstrate your understanding of the TicTacToe code at the type and intention level, create a number of examples of TTT objects and explain what happens to them when you apply some of the the TicTacToe functions. It is not necessary that you explain how those changes are brought about by the code, only what results are expected.

 

Last edited by rabbott at 11:57 Nov 03, 2016.