generated from mwc/lab_tic_tac_toe
27 lines
660 B
Markdown
27 lines
660 B
Markdown
# Tic Tac Toe Lab Assessment
|
|
|
|
Everything's done--nice work!
|
|
|
|
## Checkpoint 1
|
|
Looks good.
|
|
|
|
## Checkpoint 2
|
|
Works! I don't think there's a much more elegant way to do this, although I
|
|
might have chosen to separate out the data (row/col/diagonal indices) from the
|
|
looping structure. If you wanted to get fancy, you could do this (prob some constructs
|
|
here you haven't seen, but might find interesting). Ask me if you can't figure out
|
|
what's going on :)
|
|
|
|
```
|
|
combos = [
|
|
[0, 3, 6],
|
|
[1, 4, 7],
|
|
...
|
|
]
|
|
is_symbol = lambda index: state['board'][index] == symbol
|
|
return any(all(map(is_symbol, combo)) for combo in combos)
|
|
```
|
|
|
|
## Checkpoint 3
|
|
Looks good.
|