Git Product home page Git Product logo

bulls-and-cows's Introduction

Bulls-and-Cows

Description Some players need a challenge, so let's make the secret code in the game harder to guess. Add support for more than 10 symbols by adding letters. Now, the secret code can contain numbers 0-9 and lowercase Latin characters a-z. The new maximum length for the code is 36. Note that the length of the secret word may not match the size of possible characters in the secret code, so you should make two separate inputs for the secret code length and for the size of possible characters.

Also, since a secret code is not a number anymore, the symbol 0 should be allowed as the first character in a secret code.

Objectives In this step, your program should:

Ask for the length of the secret code. Ask for the range of possible characters in the secret code. Generate a secret code using numbers and characters. This time, you should also print the secret code using * characters and print which characters were used to generate the secret code. Function as a fully playable game.

Example The greater-than symbol followed by a space > represents the user input. Note that it's not part of the input.

Input the length of the secret code:

4 Input the number of possible symbols in the code: 16 The secret is prepared: **** (0-9, a-f). Okay, let's start a game! Turn 1: 1a34 Grade: 1 bull and 1 cow Turn 2: b354 Grade: 2 bulls and 1 cow Turn 3: 93b4 Grade: 4 bulls Congratulations! You guessed the secret code.

bulls-and-cows's People

Contributors

edg4rv 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.