Giter Site home page Giter Site logo

moreneecoder / love-calculator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 32 KB

A simple ruby program for randomly grading the affection level between two partners. This project is part of the programming tasks for beginners.

License: MIT License

Ruby 100.00%

love-calculator's Introduction

love-calculator

A simple ruby program for randomly grading the affection level between two partners. This project is part of the programming tasks for beginners series.

About The Program

The program is a game of chance that takes the names of two partner's and assign them a random love grade. It then displays an accompanying message based on the assigned grade. For instance, in the image above, the user enters their name and their partner's name, they got a love grade of 90% and their display is as follow: Jackie Chan and Angie Jolie, your love is 90% strong. Awwwn... You both seem to always be in each other's thoughts. Never let go!

The program also has a cheat feature that let's a user put their names and their partner's in two separate arrays. It then returns 100% whenever two names from these arrays are paired for a grading.

Built With

  • Ruby programming language
  • RSpec

Getting Started

To set up a local version of this project, a collection of steps have been put together to help guide you from installations to usage. Simply follow the guide below and you'll be up and running in no time.

Set up

  • Install git
  • Install the Ruby programming language, if you haven't already.
  • Open Terminal
  • Navigate to the preferred location/folder you want the game on your local machine. Use cd <file-path> for this.
  • Run git clone https://github.com/Moreneecoder/love-calculator.git to download the game source file.

Dependencies

  • Rubocop: This is a tool for checking code quality and ensuring they meet the requirements. Don’t worry about this if you’re not a developer. Microverse provides a wonderful setup guide for rubocop here.

  • RSpec: This is a tool for testing the effectiveness of the program's logic at every step. Again, don’t worry about this if you’re not a developer. To set up RSpec:

    • run gem install rspec in your terminal. This should install rspec globally on your local machine.
    • run rspec --version. This should display your rspec version if successfully installed.
    • run rspec to see passing and failing tests.

Usage

At this point, you now have everything you need to properly run the program (source code, ruby, rspec, rubocop). If not, refer back to the setup section of this documentation.

To get the game running, follow the instructions below:

  • run bin/main.rb in the terminal. You should make sure your terminal is navigated to the current directory of the program. Now you should see a message that says Love Calculator and a prompt to enter your name.

NOTE: You may have been used to using the ruby main.rb bash command - where main.rb is your file name - to run ruby codes. But we use the bin/main.rb command here because our file has been made executable.

  • Enter your name and hit enter. You should now get a second prompt requesting your partner's name.

  • Enter your partner's name and hit enter as well.

  • You should now get a random grade and an accompanying message for you and your partner's love or whatever the program think it is, haha.

  • To use the program's cheat feature:

    • open the projects calculator.rb file (you can find this in the lib folder).

    • Go to the #assign_score method and replace the names in the cheat_usernames array with some of your names. Replace the names in the cheat_partner_names with your partner's as well.

    • run bin/main.rb again.
    • Enter one of your names as is in the array and one of your partner's name too.
    • This time it should always give a grade of 100% whenever either of your names in the arrays are paired.

  • That's it! Happy Testing!

Author(s)

👤 ** Morenikeji Fuad Bello**

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

📝 License

This project is MIT licensed.

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.