Truth-Table-Generator

Truth Table Generator and Visualizer

This is a Truth Table Generator and Visualizer built with React.js. The application allows users to create truth tables based on the number of variables they specify, customize the column headers (except the output column), and input custom output values. The app also includes functionality to export the generated table to the clipboard for pasting into Google Docs.

Features

How to Run Locally

Prerequisites

Ensure you have the following installed on your machine:

How to Install Node.js and npm

  1. Install Node.js:

    • Visit the official Node.js website and download the latest LTS version for your operating system.
    • Follow the installation instructions specific to your OS.
  2. Verify the installation:

    • Once Node.js is installed, verify that both Node.js and npm are installed correctly by running the following commands in your terminal/command prompt:
     node -v
     npm -v
    

    These commands should return the versions of Node.js and npm.

Steps to Run

  1. Clone the repository to your local machine:

     git clone https://github.com/your-repo/truth-table-generator.git
    
  2. Open the project in your preferred code editor. You can use Visual Studio Code or IntelliJ IDEA:

    • In VS Code:
      • Open the project by going to File > Open Folder and selecting the folder containing the cloned repository.
    • In IntelliJ IDEA:
      • Select Open from the welcome screen and choose the project directory.
  3. Install dependencies by running the following command inside the main folder (where package.json is located):

     npm install
    
  4. Run the application using the command:

     npm start
    

    This will start the development server, and you can view the app by navigating to http://localhost:3000 in your web browser.

Exporting the Truth Table

Once you’ve generated the truth table, you can press the Export button. The table will be copied to your clipboard in a format suitable for pasting into Google Docs or any other text editor that supports CSV formatting.

Folder Structure

```plaintext truth-table-generator/ ├── node_modules/ ├── public/ ├── src/ │ ├── App.css # Styles for the app │ ├── App.js # Main React component with the logic for generating the truth table │ ├── index.js # Entry point for React ├── package.json # Project configuration and dependencies └── README.md # Information about the app and how to run it