CS-MIC is a .NET library written in C# designed to give developers easy access to expression parsing. For many developers, there is no need to involve complicated settings and formats. With few exposed methods and objects, CS-MIC makes basic expression solving as simple as possible with as little logic required from developers as possible. In fact, one can pull a value with only one line of code.
CS-MIC is available as a package on [nuget.org](/https://nuget.org/packages/csmic) for ease and convenience. You can follow the instructions listed on the package site, or use the nuget package manager to search the nuget repository for cs-mic and install it from there.
CS-MIC follows a few basic rules when interpreting user input, but should prove to be fairly straightforward for most developers. While CS-MIC tries to ensure that the order of operations as far as it knows them (parentheses – powers, multiplication, division – addition, subtraction), there may be instances where formatting fails. If this should be noticed, please [report it](https://github.com/wagesj45/cs-mic/issues).
`->` - Assigns a comma delimited array of numbers to an array variable.
#### Comparison
`==` - Returns ‘True’ if two values are equal to each other.
`>` - Returns ‘True’ if a value is greater than another value.
`<` - Returns ‘True’ if a value is less than another value.
`>=` - Returns ‘True’ if a value is greater than or equal to another value.
`<=` - Returns ‘True’ if a value is greater than or equal to another value.
#### Base Conversion
* Decimal
* All numbers are interpreted as decimal by default.
* Binary
* Binary numbers are succeeded by a B, non case sensative.
* Hexadecimal
* Hexadecimal numbers are preceded by 0x, non case sensative.
#### Example Input and Output
**Input**|**Output**
:-----:|:-----:
`5 + 5` | `10`
`5 * 2` | `10`
`1 + 2 * 3` | `7`
`(1 + 2) * 3` | `9`
`5 / 2` | `2.5`
`5 / 0` | `Attempted to divide by zero.`
`2 ^ 32` | `4294967296`
`x :: 4` | `4`
`x :: 6 + 4` | `10`
`y := 2^x` | `(2^x)`
### Scripting
#### Rules
* Any valid expression can be computed.
* All computation counts towards the script’s history. This means that once a variable is set inside a script, the variable will remain set until execution of the script is complete.
* Only one command can be executed per line. No token is required to end the command.
* Every code block must be opened and closed with a bracket ( { } ). The only exception is the main code block.
#### Loops
`while` - Executes a code block as long as a given condition evaluates to true.
`for` - After executing an initial condition, a code block is executed while a condition is met. A final statement is executed at the end of each iteration.
`if` - Executes a code block if a given condition evaluates to true. An optional else block can follow the if block for execution if the statement evaluates as false.
[![Donate with Trans Pay](https://support.jordanwages.com/static/donate-with-transpay-en.png)](https://support.jordanwages.com?project=2)
If you would like to donate to the development of **cs-mic**, please direct you donation to my [patron page](https://support.jordanwages.com) (powered by Stripe) or directly via my [PayPal.Me](https://www.paypal.me/wagesj45) page. You can also donate Ethereum [to my wallet](https://etherscan.io/address/0x917f3d67e2a7ec8884d241118ee829af57cc4afd).