From 0661473603a71f16394373a28ce7f4d6dcf2fcb5 Mon Sep 17 00:00:00 2001 From: Chris Proctor Date: Sun, 3 Mar 2024 12:15:34 -0500 Subject: [PATCH] Add assessment --- assessment.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 assessment.md diff --git a/assessment.md b/assessment.md new file mode 100644 index 0000000..3478a79 --- /dev/null +++ b/assessment.md @@ -0,0 +1,33 @@ +# Tic Tac Toe Lab Assessment + +## Checkpoint 1 +Looks good. + +## Checkpoint 2 +> What I do not understand is what state is and why we need to use +> state["board"][index] to access something on the board + +I think you asked a similar question in Discord, so maybe you already have an +understanding, but state is just a dict storing what's on the board and whose +turn it is. State isn't related to syntax--python doesn't care about state at all. +Instead, state is a design feature of this program. We intentionally design the +TTTGame so that it encodes the rules of the game, but doesn't know anything about +the particular game(s) which are actually being played. That's stored within state. + +The benefit of organizing a program this way is that we can then reason about +multiple future states of the game, for example in the lookahead strategy introduced +later in the lab. We can draw an expanding chain of states out into the future, +and think about which futures are best. To see t + +## Checkpoint 3 +Actually, the current and future reward (they're added together) is 0. +This means that if both players play perfectly, the game will end in a draw every time. +You could see this using: + +``` +>>> from ttt.game import TTTGame +>>> from strategy.lookahead_strategy import LookaheadStrategy +>>> g = TTTGame() +>>> s = LookaheadStrategy(g) +>>> s.get_current_and_future_reward(g.get_initial_state()) +```