Code Monkey home page Code Monkey logo

doodledigits's Introduction

Doodle Digits

Doodle Digits is an inline calculator where you write equations into a large textbox and the answers are given to you as you type.
This approach lets you easily go back and change things in your equation and is easy and intuitive to use.

Features

  • Variables that can hold values
  • Arbitrary precision numbers allow you to calculate very large numbers, some high limits are put in for performance reasons
  • Autosaving that quickly lets you go back to where you were
  • A large library of math functions
  • Bitwise operations (keywords are bxor, bor and band to not clash with some other math notations)
  • Hex and binary numbers (0xE32C2C, 0b10)
  • Vectors and matrices (x = (1, 2), det [[3, 4], [5, 6]])

Download and Install

Downloads and installation instructions can be found on the releases page.

Doodle Digits as a library

You can use the Doodle Digits math core as a standalone math library for C#. The nuget package can be found here.

using DoodleDigits.Core;

// Create a new calculator. The default constructor will use the functions inside FunctionLibrary.Functions and ConstantLibary.Constants.
// You can implement custom functions and constants using the Calculator(IEnumerable<FunctionData> functions, IEnumerable<Constant> constants) constructor.
var calculator = new Calculator();

// Calculate the input
var result = calculator.Calculate("5 + 5");

// Find the result with a value. A calculation can return multiple results, including error messages and hints. The ResultValue is the result of a calculation.
var resultValue = result.Results.OfType<ResultValue>().LastOrDefault();

Contributing

As in most projects, make sure whatever you submit is unit tested if necessary and that all tests pass.
Commits with emoji are preferred. I try to stay on the latest version of C# and .NET because it's nice.

doodledigits's People

Contributors

antonbergaker avatar bloofirephoenix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

bloofirephoenix

doodledigits's Issues

๐Ÿ‘ฉโ€๐Ÿ’ป Hex and binary output

Right now, hex and binary literals are parsed, but doing anything with them will make the result in decimal notation. It should stay in the same format it started. Also there should be a way to move between presentations. I suggest using the keywords as/in like this:
25 in hex = 0x1B
25 - 1 as hex = 0x1A
0xB in decimal = 11
0xBA = 0xBA
4 in binary = 0b100

๐Ÿ’พ User defined functions

Example syntax:

f(x) = x + 5
f(5) = 10

Annoying bit is not colliding with existing syntax of f times x equals something.
Since
f = 5
x = 1
f(x) = x+4 -> true

I'm thinking it's parsed as a function in the AST and if the function name is defined already the calculate function will run multiplication instead.

โ„น Help page

There's a lot of behavior inside the app which is not explained anywhere. Users are unlikely to discover these by guessing, such as the keywords for bitwise operators.
It'd be good to have some sort of lexicon with all kinds of operations and functions along with a short description.

#๏ธโƒฃ Add commenting

Let me explain things to me, myself, or friends through text inside the application. It should also have a nice color. :-)
You'd presumably start a comment with a symbol not used in math. But // should be fine I guess. Otherwise, ;, # or maybe \.

โš™ Settings page

A settings page for the calculator.
Example settings:

  • Autosave Interval
  • Show grid
  • Use degrees/radians
  • Font family - size - color
    • Not sure how this would play with #2 when it comes to color.

๐Ÿ“ Vector support

Allow calculations with vectors.

Declaring a 1d vector:
vec = [0, 1]

Declaring a 2d vector:
vec = [ [0, 1], [2, 3] ]

etc.

Probably wont support any operators with them other than obvious ones. Adding norm (||) would clash with boolean or. (although technically since one is unary we can work out the order)
(might revisit it then)

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.