eqsolver's Introduction
solver.js By Charles Boyd <charlesboyd.me> Portions adapted from geeksforgeeks.org/expression-evaluation Can be used as a node.js script or included in a webpage. For equations, use the following: + add - subtract * multiply / divide ^ raise to a power For logcial expressions, use the following: & and | or > conditional = biconditional/equivalent ~ not ! not Parenthesis such as () may be used for grouping. A value of zero (0) is assumed to be false. All others are assumed to be true. Truthy output from this script will be represented by a value of one (1). Variables A to Z may be included for truth table printing. For solver.evaluate(expression), all variables A to Z (except T) are assumed to have a value of zero (0) unless otherwise specified. The variable T is given a default value of one (1) and the variable F is given a default value of zero (0). The solver.auto(expression) will evalute the experession provided (if it is valid) and print it, unless a variable besides T or F is provided, in which case it will print a truth table for the expression. Currently, the order of operations must be specified for all logical expressions by using parenthesis: e.g. use 1 | (~0) instead of 1 | ~0. Node.js example: node solver.js "1+1" TODO: Add public function descriptions, inputs, and outputs. TODO: Add more examples Examples: solver.printTruthTable("(B&~1)|A"); solver.printTruthTable("A | (B & C) | H|E|L|L|O");
eqsolver's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.