Skip to content

CheapNightbot/calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cheap Calculator ~

A simple and stumid command-line calculator to perform basic arithmetic operations such as addition, subtraction, multiplication, and division. ♡(>ᴗ•)

Demo

TABLE OF CONTENTS

Features

  • Supports the following basic operations:
    • +: Addition
    • -: Subtraction
    • *: Multiplication
    • /: Division
    • //: Integer division (round to nearest integer)
  • Colorful output.
  • Python REPL inspired prompt and feel.

Installation

Note

This project uses gcc & make for building. Ensure you have them installed on your system.

  1. Clone this repository:

    git clone https://github.com/CheapNightbot/calc.git
  2. Navigate into the project directory:

    cd calc
  3. Build the project:

    make

    OR

    make calc
  4. Run the calculator:

    ./build/calc

Cleaning Up:

Warning

"This will delete the 'build' directory and the executable!"

To clean up the build files:

make clean

Usage

Commands:

  • clear or clean: Clears the terminal screen.
  • exit or quit: Exits the calculator.
  • help: Displays the help/usage message.

Example:

>>> 3 + 4
7
>>> 10 - 4
6
>>> 5 * 5
25
>>> 7 / 3
2.33
>>> 7 // 3
2

Contributing

If you want to contribute, feel free to fork this repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.