CCExtractor Development

Rust: Mastermind: A guessing game for clever people (task 1: The code maker)

Rust: Mastermind: A guessing game for clever people (task 1: The code maker)

Mastermind in a a classic guessing game and works like this: You have to guess a 6 digits number in the minimum amount of tries possible. For each try, the reply will be how many digits you got right and in the correct position and how many you got right but in the wrong position.

Your job is to implement a small program that will first generate a random number, then ask the user for guesses and reply according to the rule above.

When the user guesses the number, congratulate him/her, and exit.

To get started take a look at this other guessing game, which is not the same one but has the same mechanics for a lot of things:

https://nostarch.com/Rust2018

You can check the mastermind rules here:

https://www.wikihow.com/Play-Mastermind

Task tags

  • rust

Students who completed this task

Pokemod97, ChrisT, Lux, takitsuse, Danelegend, deuteriumoxide, Tantan4321

Task type

  • code Code

Level

Beginner
close

2019