Giter VIP home page Giter VIP logo

mastermind's Introduction

Mastermind

From Wikipedia: Mastermind or Master Mind is a code-breaking game for two players. The modern game with pegs was invented in 1970 by Mordecai Meirowitz, an Israeli postmaster and telecommunications expert.[1][2] It resembles an earlier pencil and paper game called Bulls and Cows that may date back a century or more.

Red, Yellow, Orange, Green, Blue, Purple, White

Scoring Black, White

Mastermind. (Main.java class if using Repl.it but ok)

Make a game class

gives rules at beginning (could be a method call printRules() )

Scanner class - input user prompts, etc

would make calls to methods to guess position

return for this? int[#cPcL][#cPwL]

Instructions - capture instructions (for text file and UI)\

?PvP = play1 choses secret code (swap places at keyboard)

play2 - takes turn guessing

?PvC = play1 - computer randomizes colors and location of pins

play2 - takes turn guessing

Make a board Class

Pins - Encoding colors - do we use ints or chars?

[R, G, Y, O] [R, B, Y, G] [2][1]

[R, G, Y, O] [R, O, Y, G] [2][2]

Option 2 Layous

[R, G, Y, O] [BP , WP ]

[ , , , ] [2, 2]

int - translate btwn colors

chars - individual letter

PROS CONS
Ints -simple to code
chars -less confusion for player
  • Arrays - 1-2D array for player guesses ** 1-1D array for the secret code

mastermind's People

Contributors

mtwyford avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.