Giter VIP home page Giter VIP logo

guessing-cli-seattle-web-career-042219's Introduction

Build a Guessing Game in the CLI

Skills: user input, methods, cli, looping, gets

Instructions

Running Your Guessing Game

Packaged with this repository is a runner file bin/guessing_cli.

The "bin" directory is short for "binary", which is another way of referrering to an executable file.

The executable "bin/guessing_cli" is a Ruby file, but the ".rb" extension has been left off. The ".rb" extension is not mandatory for Ruby files, it is just a nice thing to have for the purposes of identifying the type of the file. However, it is a convention to leave the file extension off of executable files, which comes from true binary files that contain pure machine code (1's and 0's) rather than human readable source code like Ruby.

Assuming you are in the root directory of the guessing_cli project, run your guessing_cli from the command line with ruby bin/guessing_cli.

Alternatively, you can also just say bin/guessing_cli since a line of code has been added to the top of the bin/guessing_cli runner file that tells your command line shell which program to run the file with.

Building the run_guessing_game method

So your run_guessing_game method is going to be responsible for several things: - Taking in input from the command line - Comparing that input to a random number that has been generated - Printing out a statement You guessed the correct number! if the number has been guessed correctly, or The computer guessed <number>. if the number has been guessed incorrectly - Allowing the user to exit the program when exit is the input

Things to Keep in Mind

This is a challenging lab, so go through it slowly. Look at the RSpec test and see what the tests are looking for. Talk to each other and communicate your way through roadblocks.

Also, run learn in order to run your tests!

Hints...

The Curious Tale of Shrek

There was once an ogre who had no friends,
He lived out in the swamp for the longest __while__,
Living out his days in quiet contemplation,
He really didn't tolerate the presence of __rand__oms,
Until an annoying donkey once came along,
And started to __break__ his brain with madness.

Resources

View Build a Guessing Game in the CLI on Learn.co and start learning to code for free.

guessing-cli-seattle-web-career-042219's People

Contributors

irmiller22 avatar sgharms avatar vibraniumforge avatar sarogers avatar fislabstest avatar changamanda avatar maxwellbenton avatar

Watchers

James Cloos 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.