generated from mwc/lab_tic_tac_toe
Add assessment
This commit is contained in:
parent
9d0c6174ec
commit
a4a9c495f8
|
@ -0,0 +1,26 @@
|
|||
# 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.
|
Loading…
Reference in New Issue