Rust-implemented master mind game solver

Overview

master_mind_rust

A Rust-implemented solver for the master mind game.

You can play the master mind game online here → https://webgamesonline.com/mastermind/ .

Usage

A master mind solver implemented by Rust.

Usage: master_mind_rust [OPTIONS] [COLOR_NUM] [PIN_NUM]

Arguments:
  [COLOR_NUM]  number of colors [default: 6]
  [PIN_NUM]    number of pins [default: 4]

Options:
  -n, --non-duplicate    codes do not have duplicate colors
  -p, --policy <POLICY>  policy for choosing guess [default: minmax] [possible values: firstpick, minmax]
  -m, --mode <MODE>      mode of execution [default: guess] [possible values: guess, mktree, benchmark]
  -h, --help             Print help

Guess mode

In this mode, the solver attempts to find the user's secret code. The user must provide feedback for the solver's guesses. Feedback consists of a pair of the number of hits and blows.

  • hit: The number of pins that are correctly matched in both number(color) and position to the secret code.
  • blow: The number of pins that match the secret code in number(color) but are positioned differently.

Example: If secret code is [1, 2, 3, 4] and guess code is [0, 1, 2, 3], then the feedback: (hit, blow) is (0, 3).

Example: If secret code is [1, 2, 3, 4] and guess code is [0, 0, 3, 3], then the feedback: (hit, blow) is (1, 0).

Mktree mode

Generates trial paths for all possible secret codes. This mode is useful for evaluating the efficiency of policies. It is also used in benchmark mode.

Benchmark mode

Measures the time required to make trial paths for various configurations. It is usefull for profiling the performance of this solver.

You might also like...
Victorem - easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust.

Victorem Easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust. Example Cargo.toml [dependencies] vict

2-player game made with Rust and
2-player game made with Rust and "ggez" engine, based on "Conway's Game of Life"

fight-for-your-life A 2-player game based on the "Conway's Game of Life", made with Rust and the game engine "ggez". Create shapes on the grid that wi

A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it techinically works
A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it techinically works

rustetris A tetris game I wrote in rust using ncurses. I'm sure that there's a better way to write a tetris game, and the code may be sus, but it tech

A game of snake written in Rust using the Bevy game engine, targeting WebGL2

Snake using the Bevy Game Engine Prerequisites cargo install cargo-make Build and serve WASM version Set your local ip address in Makefile.toml (loca

Wasm game of life - A Rust and WebAssembly tutorial implementing the Game of Life

wasm_game_of_life Conway's Game of Life in Rust and WebAssembly Contributing | Chat Built with 🦀 🕸 by The Rust and WebAssembly Working Group About T

2d Endless Runner Game made with Bevy Game Engine
2d Endless Runner Game made with Bevy Game Engine

Cute-runner A 2d Endless Runner Game made with Bevy Game Engine. Table of contents Project Infos Usage Screenshots Disclaimer Project Infos Date: Sept

A game for the game jam
A game for the game jam "1-Button Jam 2021"

One click ninja A game for the game jam "1-Button Jam 2021" written in Rust with the Bevy engine. A rhythm game, where you play a soldier that can def

My first attempt at game programming. This is a simple target shooting game built in macroquad.

sergio My first attempt at game programming. This is a simple target shooting game built in macroquad. Rules Hit a target to increase score by 1 Score

A game made in one week for the Bevy engine's first game jam

¿Quien es el MechaBurro? An entry for the first Bevy game jam following the theme of "Unfair Advantage." It was made in one week using the wonderful B

Releases(part9)
Owner
Nariaki Tateiwa
Nariaki Tateiwa
Rust solver for color-sort puzzle game

Color-Sort Puzzle Solver Optimal solver for color-sort game (see example and game explanation sections below). This project (written in Rust) efficien

Amr Saber 4 May 30, 2023
Conway's Game of Life implemented for Game Boy Advance in Rust

game-of-life An implementation of a Conway's Game of Life environment on GBA. The ultimate game should have two modes: Edit and Run mode which can be

Shane Snover 1 Feb 16, 2022
Simple Sudoku solver written in Rust.

Simple Sudoku solver written in Rust. Method is inspired by a method briefly outlined in a CS lecture I had that I decided to try and implement based only on my understanding from the lecture.

Peter Hebden 5 Nov 18, 2022
A simple Verlet integration solver written using the Rust SDL2 bindings.

Rust Verlet Solver A simple Verlet integration solver written using the Rust SDL2 bindings. Where's the friction?! Building cargo-vcpkg is required in

Will 8 Jun 6, 2022
A simple Verlet integration solver written using the Rust SDL2 bindings.

Rust Verlet Solver A simple Verlet integration solver written using the Rust SDL2 bindings. Where's the friction?! Building cargo-vcpkg is required in

Will 8 Jun 6, 2022
An interactive, universal Wordle solver

Eldrow (Wordle in reverse) is an interactive, universal Wordle solver that attempts to achieve near to mathematically perfect performance without rely

agubelu 3 Sep 2, 2022
Claim probot daily credits, reChaptca solver

Probot, claim you daily credits it's a simple code that emulate to claim probot daily credits by using headless_chrome crate with rust language How to

Mr.Kasper 9 Dec 20, 2022
Solana Game Server is a decentralized game server running on Solana, designed for game developers

Solana Game Server* is the first decentralized Game Server (aka web3 game server) designed for game devs. (Think web3 SDK for game developers as a ser

Tardigrade Life Sciences, Inc 16 Dec 1, 2022
Game examples implemented in rust console applications primarily for educational purposes.

rust-console-games A collection of game examples implemented as rust console applications primarily for providing education and inspiration. :) Game *

Zachary Patten 2 Oct 11, 2022
An Onchain Game Engine implemented in Cairo 1.0

Dōjō Dojo is a full stack toolchain for developing onchain games in Cairo. Dojo leverages the afforadances provided by the Cairo language to offer an

Dojo 25 Feb 2, 2023