Thanks, that's a useful tip!
But I still can't customize the messages successfully. Here's my UnlockWith function:
"The lock mechanism is stiff and unlocks with a loud CLACK, echoing around the cells. ";
// this condition is clearly not right.
reportFailure('You try to fit the key into the lock, but to no avail. ');
If I drop the check
function, then if I have the wrong key I get:
(with the bent key)
The lock mechanism is stiff and unlocks with a loud CLACK, echoing around the cells. The bent key doesn’t fit the lock.
This is why I figure that echoing a message on a bad check is the right way to prevent this. Ideally I'd want to have the key name available so I can customize the failure message too, but one step at a time...