Skip to content

Latest commit

 

History

History
25 lines (14 loc) · 648 Bytes

File metadata and controls

25 lines (14 loc) · 648 Bytes

Exercise #2: Strategy without classes

A. Review class-based implementation

  1. Go to exercises/strategy directory
  2. Run doctest on strategy.py to check the expected behavior:
$ python3 -m doctest strategy.py

B. Refactor strategy.py, changing concrete strategies into functions

  1. Run doctest with the -f option to stop at first error or failure:
$ python3 -m doctest strategy.py -f