Skip to content

riscygeek/cmdcalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Commandline-Calculator

A simple command line calculator

Dependencies

  • GNU Readline
  • getopt.h

How to install

Windows:
Compile with Visual Studio

Arch Linux/Manjaro:
Install cmdcalc with package manager

Linux:
Compile with CMake

Using cmdcalc

  • Expressions (1 + 2 - 3 * a ** f(42 / 2))
  • Variables (a=99)
  • Functions (func f(x)=x*2)
  • Arrays (arr=append(arr, 32, "Hello World", ["another array"]))

Operators

  • + Addition
  • - Subtraction
  • * Multiplication
  • ** Power
  • / Division
  • = Assignment
  • condition ? true : false

Interpreter-specific commands

  • vars (list variable names)
  • funcs (list function names)
  • CTRL+D exit
  • CTRL+C discard command
  • func name(param1, param2)="definition"

TODO

  • Implement file execution
  • Add useful command-line options
  • Add Documentation/Wiki
  • Find and fix bugs
  • Add more functions
  • Add complex statements (like if, for)