Coder Social home page Coder Social logo

vano-maisuradze / chemical-equation-balancer Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 11 KB

This code lets you balance chemical reaction equations

C# 100.00%
chemistry chemical-equations chemical-reaction chemical-reaction-balancing csharp dotnet-core

chemical-equation-balancer's Introduction

chemical-equation-balancer

This code lets you balance chemical reaction equations.

Usage example
var input = "H2 + O2 = H2O";
var balancer = new Balancer();
balancer.Solve(input);
Console.WriteLine($" Input: {input}");
Console.WriteLine($"Output: {balancer.EquationText}");
Console.WriteLine($"  HTML: {balancer.EquationHtml}");
Demo results:
 Input: H2 + O2 = H2O
Output: 2H2 + O2 = 2H2O

 Input: O2 + FeS2 = SO2 + Fe2O3
Output: 11O2 + 4FeS2 = 8SO2 + 2Fe2O3

 Input: H2O2 + Cr2O7^2- = Cr^3+ + O2 + OH^-
Output: 8H2O2 + 2Cr2O7^2- = 4Cr^3+ + 7O2 + 16OH-

 Input: K4Fe(CN)6 + KMnO4 + H2SO4 = KHSO4 + Fe2(SO4)3 + MnSO4 + HNO3 + CO2 + H2O
Output: 10K4Fe(CN)6 + 122KMnO4 + 299H2SO4 = 162KHSO4 + 5Fe2(SO4)3 + 122MnSO4 + 60HNO3 + 60CO2 + 188H2O

This code was translated from Typescript to C#. You can find original code here.

chemical-equation-balancer's People

Contributors

vano-maisuradze avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

0000duck

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.