Giter Club home page Giter Club logo

codebreaker-javagame's Introduction

CodeBreaker-JavaGame

Codebreaker game written in Java. Uses 'javabook' library for display

Based on the Java programming language and the javabook class library. The game have a purely text based interface, no graphics.

The game starts by choosing the code patch which is a sequence of four colours from the following available colours: • red(R), • orange (O), • yellow (Y), • green (G), • blue (B), • Indigo (I), • violet (V).

The code patch is not displayed to the user. Only 4 lines are displayed ( _ _ _ _ ) and lives = 8. The user enters a string of four characters which is their guess at the sequence of 4 letters choose by the computer. The user input is compared to the code patch and the following feedback is provided: • If the two code patches match, the game says YOU WIN, do you want to play again (Y/N)? • If one or more colours between the two colour patches match, display the positions where the colours match. • If the colour is correct but the position is wrong for one or more colours give the user a clue as to how many colours there are in the in the users patch that are not in the correct position. • If the same colour is used twice in the users patch and twice in the computers patch but the positions are wrong the clue will have a value of 2. • if the colour patch has not been guessed then a life is lost and the user is asked : Enter a sequence a 4 character sequence from ROYGBIV or 0 to exit: • If the number of lives is zero following this guess and the user has not won, then display, the code patch and. YOU LOOSE, do you want to play again (Y/N)? • If instead of entering in a code sequence the user enters 0, or there are 0 in the code patch entered, exit the game (boss kill switch) • If the same sequence is entered twice or more, inform the user that duplicate patches are not allowed and ask then to re enter a new code patch. No life is lose for a duplicate entry.

codebreaker-javagame's People

Contributors

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