CMU 15-112 Fall 2015 Quiz7 Practice
(Due never)
- Edit how you wish (add imports, helper functions, etc), except:
- Do not use recursion, lambdas, or non-local variables this week.
- Do not edit the test code.
- Do not hardcode the test cases in your solutions.
- Quiz6 will include a subset of the problems here.
- Code Tracing
- events-example3
- drawLinePattern(canvas, x0, y0, x1, y1)
- drawGrid(canvas, left, top, right, bottom)
- Connect4
-
Code Tracing
See here.
- events-example3
Be sure you thoroughly understand and can easily derive everything
except the run() function in
events-example3.py.
- drawLinePattern(canvas, x0, y0, x1, y1)
Write drawLinePattern from
here (see question 2.3),
which draws this:
- drawGrid(canvas, left, top, right, bottom)
Write drawGrid from
here,
which draws this:
- Connect4
Write a graphical version of Connect4, which works like the one we
wrote this week in recitation.
You should support both mouse-based and key-based moves. Furthermore,
you should include a timer such that each player only has up to 3 seconds to play their turn. If a player runs out of those 3 seconds, the turn swaps immediately to the other player. As we did before, you should use wordSearch to do the actual
checking for a win. While you are required to be able to write wordSearch
from scratch, we are reall focusing on the graphics and animation portion
in quiz7.