Giter VIP home page Giter VIP logo

mastermind's Introduction

MasterMind in COBOL

This project implements the MasterMind game in COBOL. MasterMind is a logic game in which a player must guess a sequence of numbers randomly generated by another player.

How to Play

1- Initialization: Start the program and follow the instructions to enter a sequence of 3 numbers without your opponent seeing it. 2- Guess: Then, your opponent will try to guess the sequence by also proposing a sequence of 3 numbers. 3- Feedback: The program will give you feedback on the match between the guessed numbers and the secret sequence. It will indicate the number of correctly placed numbers and the number of correct but misplaced numbers. 4- Repeat: Repeat steps 2 and 3 until you find the secret sequence or get it wrong 10 times or decide to end the game.

Example :

            1st entry: enter the number to find: 123

            2nd entry: enter a proposition: 999 => no number find
                                        

            3rd entry: enter a proposition: 199 => a good number place
                                         

            4th entry: enter a proposition: 192 => a good number placed and a figure found
                                         

            5th entry: enter a proposition: 132 => a good number placed and 2 numbers found
                                         

            6th entry: enter a proposition: 123 => You have find ! Well done !
                                         

            End of program

How to Run the Program

Make sure you have a COBOL compiler installed on your system. You can use GNU COBOL (GnuCOBOL) or another COBOL-compatible compiler. 1- Compilation: Compile the program with your COBOL compiler. For example, with GNU COBOL: 'cobc -x -free -o MasterMind MasterMind.cbl'. 2- Execution: Run the compiled program. For example, under Linux: './MasterMind'.

Notes

  • The program is designed to be played by two players, but you can also play alone by performing both sets of inputs.
  • The game allows a maximum of 10 attempts before declaring defeat.
  • To stop the game at any time, enter "FIN" when prompted to enter a sequence. Have fun !

mastermind's People

Contributors

marzakbrahim avatar

Watchers

 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.