Lockpicking Tutorial - raeleus/Hashtag-DnD GitHub Wiki

Introduction

Mastermind is a popular puzzle game dating back to the 1970's. It's a great way to simulate the difficulty of lockpicking, hacking, or whatever task that requires skill in your adventures. I have implemented a simple rendition of it as a minigame for Hashtag DnD. It's much more immersive than just doing a roll.

The Scenario

Charles has come upon an exceptionally devious lock. It is the only obstacle between him and the beating heart of his zombified girlfriend. Let's help him restore personhood to his beloved! #lockpick easy The default is easy, but you can specify any difficulty you desire. In order of easiest to most difficult: automatic, effortless, easy, medium, hard, impossible.

The game of Mastermind is played by guessing the right combination of colors in the correct order. You can tell that there are 4 colors that must be guessed and the only possible colors are red, yellow, white, green, orange, and blue. Colors can be repeated. To make a guess, you must type the first letter of each color you wish to try and in the order they are supposed to be. wwrr The game responds with the following: Correct: 0. Wrong positions: 1. 11 tries left. That means that you got one of the colors right, but it's not in the right position. It could be a white or a red.

To solve the puzzle, you must use logical reasoning to determine the position and colors of each slot. rrrr The game responds with: Correct: 0. Wrong positions: 0. 10 tries left.

So that indicates that the correct color is white (at least for one of the slots). But where is the white supposed to be? It's certainly not in positions 1 and 2 because the game said so in the first round. You can narrow it down now that you know that red is not a correct color. rrwr The game responds with: Correct: 0. Wrong positions: 1. 9 tries left. You can try one more time to be sure, but through deductive reasoning, you can determine that white is in position 4. No need to waste a try since you only have so many left.

Now to determine the other colors: yyoo Correct: 0. Wrong positions: 0. 8 tries left. bbgg Correct: 1. Wrong positions: 2. 7 tries left.

You're pretty lucky now that you've narrowed down the remaining colors to some combination of blue and green. You can do the same test like you did with white before, however you're really close to solving it. You might as well just start guessing the final combination. ggbw Correct: 2. Wrong positions: 2. 6 tries left. bggw Correct: 2. Wrong positions: 2. 5 tries left. gbgw You solved the combination with 8 guesses!

At this point you should erase all the messages from the minigame so that the context is not used up from all of this text. Since you solved the puzzle, add a "do" action confirming that you were successful. You successfully unlocked the difficult door.

Unfortunately for you, opening this door only revealed that there are 10 more locks that need to be picked. It is then you decided that your girlfriend is much happier as a zombie and this was for the best.

Additional Thoughts

There should be consequences for not beating the puzzle within the prescribed number of guesses. Consider breaking your lockpicking toolkit or permanently sealing the door.

Make sure to review your previous guesses to narrow down the possible combinations.

The Mastermind game has been generalized to fit any sort of need. Futuristic scenarios might focus on hacking instead of lockpicking. This actually could be a stand in for any sort of skill based test. It does well thematically with anything that involves logic or reasoning.

There are various strategies you can take to resolve the puzzle. This video goes over some of the basic ones: https://www.youtube.com/watch?v=XX5TlB6xT3M