SpecialistOff.NET
/ Вопросы
/ Статьи
/ Фрагменты кода
/ Резюме
/ Метки
/ Помощь
/ Файлы
Назад
Exercises
Метки:
python
- Using the approach in Synchronization.py, create a tool that will automatically wrap all the methods in a class to provide an execution trace, so that you can see the name of the method and when it is entered and exited.
- Create a minimal Observer-Observable design in two classes. Just create the bare minimum in the two classes, then demonstrate your design by creating one Observable and many Observers, and cause the Observable to update the Observers.
- Modify BoxObserver.py to turn it into a simple game. If any of the squares surrounding the one you clicked is part of a contiguous patch of the same color, then all the squares in that patch are changed to the color you clicked on. You can configure the game for competition between players or to keep track of the number of clicks that a single player uses to turn the field into a single color. You may also want to restrict a player’s color to the first one that was chosen.