Imported from https://github.com/gaspardbe/guess_and_check