December 2001
Intermediate to advanced
304 pages
6h 25m
English
Difficulty: 8
To conclude this section, this puzzle offers some fun and lighthearted code techniques, but also gives you practice building your own function objects and reusing the standard library's built-in algorithm facilities.
Write a program that plays simplified Mastermind, using only standard library containers, algorithms, and streams. Usually, this book's goal is to demonstrate strict and sound software engineering. This time, just for some fun, the challenge is a bit more lighthearted. Use as few ifs, whiles, fors, and other keywords as possible, and have the program take up as few statements as possible. For this one Item, dense code is okay.
To start the game, the program randomly chooses ...
Read now
Unlock full access