Post date: Dec 02, 2011 12:1:18 AM
Announcements
New (added after lecture): There will be a section leader led final exam review session Monday 13-Dec 6-8pm in 906 Gould Simpson (down the hall from lab)
Next Monday is our last lab. Please attend...
Next Tuesday is our last lecture. Please attend...
Get practice final
Final exam: Tuesday 13-Dec 3:30 pm in our usual lecture hall
Would you like to have a section leader led final exam review session? Sunday night was suggested
Homework
Work on Connect 4 Project
Optional: Read about dictionaries in Section 11-6. pages 368..377
Take D2L quiz: Chapter 11B: Dictionaries
This is now a bonus quiz
No dictionaries on the final
Lecture Outline:More List processing
Consider current project. Suggestion *Do the easier method first, the the win methods, one at a time!
First Complete __init__, __str__, and makeMove(self, player, column) first
run a main program that plays several times with 2 different players, print the changing game to see X and O
Complete columnIsFull(self, column)
run a main program that fills one column
Complete boardIsFull(self)
Test with nested loops to fill the board or run Connect4Test.py or use Connect4Test.py with all tests for wins commented out
Complete checkWinHorizontal(self)
Use nested for loops
For each row 0 through 5, see if you can find four consecutive X's or O's beginning at columns 0, 1, 2, and 3
Run this code
for row in range(6):
for col in range(4):
print(row, col, ' | ', row, col+1, ' | ', row, col+2,' | ', row, col+3)
Complete checkWinVertical(self)
Use nested for loops
For each column see if you can find four consecutive X's or O's beginning at rows 0.,1, and 2
Complete checkWinDiagonal(self)
Use nested loops twice
From upper left to lower right:
Check diagonals beginning from rows 0, 1, and 2 in columns 0, 1, 2, and 3
From lower left to upper right:
Check diagonals beginning from rows 3, 4, and 5 in columns 0, 1, 2, and 3
Complete checkWin(self)
Could be a one liner, no loops at all. Use the other three functions to do the work
Write the program for a console based game
Add two methods to class Matrix (on the quiz you will be asked to add one more)
Quiz #8: 2D arrays