Giter Site home page Giter Site logo

calculator.rs's Introduction

Calculator.rs Logo

Calculator.rs

English | 简体中文

An simple command-line calculator program writen with Rust.

Features

  • Variable support
> a = 1
= 1
> a
= 1
  • Fraction support
> f1 = fraction(1, 2)
= (1 / 2)
> f1 + 1
= (3 / 2)
  • Math functions support
> Math.sin(1) 
= 0.84147098
  • Lazy-Expression support
> a = 10
= 10
> b = 20
= 20
> sum = {a + b}
= <Lazy-Expression>
> sum()
= 30
> a += 1
= 11
> sum()
= 31
  • Comment support
> 1 + 1 # plus
= 2
  • Array support
> arr = new Array([1, 2, 3])
= {
  v: [
    1, 2, 3, 
  ]
  ...
}
> arr.push(4)
> arr
= {
  v: [
    1, 2, 3, 4,
  ]
  ...
}
  • Function defining support
> plus1 = fn(i $Numb) {i + 1} 
> plus1(1) 
= 2
  • Script execute support
calculator.exe script
  • OOP support
> Person = cl {age $Numb, name $Str}
= {
  age: Number
  name: String
}
> inst = new Person(10, "test") 
= {
  age: 10
  name: "test"
}

Installation

Windows || GNU/Linux || MacOS (x86_64)

Please go to the release page and download the latest released appropriate executable file,

Then just execuse it.

Other OS && Platform

You need to install the Rust (version >= 1.60).

Clone this repository

git clone https://github.com/BHznJNs/Calculator.rs
cd Calculator.rs

Then, use Cargo to compile

cargo build --release

The release executable file will be at: Calculator.rs/target/release

Tutorial

See here: Tutorials

calculator.rs's People

Contributors

bhznjns avatar bluemangoo avatar shenjackyuanjie 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.