Coder Social home page Coder Social logo

yzhhr / truthtable Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 28 KB

Generates a truth table of symbols and logical operations. A bonus hw of Discrete Mathematics in 2021 Fall.

License: GNU General Public License v3.0

C++ 97.16% Mathematica 2.84%

truthtable's Introduction

TruthTable

Generates a truth table of symbols and logical operations. A bonus hw of Discrete Mathematics in 2021 Fall.

play.cpp is a too-long cpp code, while ttable.nb provides a neat mathematica implementation. However, the latter is not expected to be accepted by the teacher.

Compile play.cpp using g++ play.cpp -o play -std=c++11. Then type expressions like (pvq>r^p)=(q=r). You'll figure out what's going on.

To use the Mathematica code, call the function using TruthTable[(p&&q)~Implies~(r||p)==(q==r), {p, q, r}].

My cpp is good because I tried to do OOP (at an unprofessional level)! And the code presents the truth in prefix notation format, which is flat but never plain!

truthtable's People

Contributors

yzhhr avatar

Watchers

 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.