Skip to content
This repository was archived by the owner on May 27, 2023. It is now read-only.

Commit 4551997

Browse files
committed
Added GUI Version
Added GUI Version Of Boolean Evaluator
1 parent 06884ba commit 4551997

File tree

13 files changed

+680
-17
lines changed

13 files changed

+680
-17
lines changed

Boolean-Expression-Solver/Boolean-Expression-Solver/Program.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,7 @@ public static void Main(string[] args)
1717
string userInput = Console.ReadLine();
1818

1919
Console.WriteLine("[TRUTH TABLE GENERATOR]");
20-
bool[] valueOfVariables = new bool[numberOfVariables];
21-
int biggestValue = Convert.ToInt32(Math.Pow(2, numberOfVariables)) - 1;
22-
int biggestDigitLength = Convert.ToString(biggestValue, 2).Length;
23-
for (int i = 0; i < Math.Pow(2, numberOfVariables); i++)
24-
{
25-
string binary = Convert.ToString(i, 2);
26-
binary = binary.PadLeft(biggestDigitLength, '0');
27-
bool[] binaryExpression = binary.Select(c => c == '1').ToArray();
28-
foreach(var b in binaryExpression)
29-
{
30-
Console.Write(b + " ");
31-
}
32-
List<string> token = Tokenize(userInput);
33-
List<string> RPN = GetRPN(token);
34-
Console.WriteLine("Output " + solver(RPN, binaryExpression));
35-
Console.WriteLine();
36-
}
20+
3721
}
3822
public static List<string> Tokenize(string input)
3923
{
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29209.62
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BooleanExpressionSolver", "BooleanExpressionSolver\BooleanExpressionSolver.csproj", "{5EF1679E-BA87-4AA4-AE26-A6292FDF7433}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{5EF1679E-BA87-4AA4-AE26-A6292FDF7433}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{5EF1679E-BA87-4AA4-AE26-A6292FDF7433}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{5EF1679E-BA87-4AA4-AE26-A6292FDF7433}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{5EF1679E-BA87-4AA4-AE26-A6292FDF7433}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {62939BAE-D199-4F6B-B1BF-88A5B3AAA113}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="BooleanExpressionSolver.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:BooleanExpressionSolver"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace BooleanExpressionSolver
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{5EF1679E-BA87-4AA4-AE26-A6292FDF7433}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>BooleanExpressionSolver</RootNamespace>
10+
<AssemblyName>BooleanExpressionSolver</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="System" />
39+
<Reference Include="System.Data" />
40+
<Reference Include="System.Xml" />
41+
<Reference Include="Microsoft.CSharp" />
42+
<Reference Include="System.Core" />
43+
<Reference Include="System.Xml.Linq" />
44+
<Reference Include="System.Data.DataSetExtensions" />
45+
<Reference Include="System.Net.Http" />
46+
<Reference Include="System.Xaml">
47+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
48+
</Reference>
49+
<Reference Include="WindowsBase" />
50+
<Reference Include="PresentationCore" />
51+
<Reference Include="PresentationFramework" />
52+
</ItemGroup>
53+
<ItemGroup>
54+
<ApplicationDefinition Include="App.xaml">
55+
<Generator>MSBuild:Compile</Generator>
56+
<SubType>Designer</SubType>
57+
</ApplicationDefinition>
58+
<Page Include="MainWindow.xaml">
59+
<Generator>MSBuild:Compile</Generator>
60+
<SubType>Designer</SubType>
61+
</Page>
62+
<Compile Include="App.xaml.cs">
63+
<DependentUpon>App.xaml</DependentUpon>
64+
<SubType>Code</SubType>
65+
</Compile>
66+
<Compile Include="MainWindow.xaml.cs">
67+
<DependentUpon>MainWindow.xaml</DependentUpon>
68+
<SubType>Code</SubType>
69+
</Compile>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<Compile Include="Properties\AssemblyInfo.cs">
73+
<SubType>Code</SubType>
74+
</Compile>
75+
<Compile Include="Properties\Resources.Designer.cs">
76+
<AutoGen>True</AutoGen>
77+
<DesignTime>True</DesignTime>
78+
<DependentUpon>Resources.resx</DependentUpon>
79+
</Compile>
80+
<Compile Include="Properties\Settings.Designer.cs">
81+
<AutoGen>True</AutoGen>
82+
<DependentUpon>Settings.settings</DependentUpon>
83+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
84+
</Compile>
85+
<EmbeddedResource Include="Properties\Resources.resx">
86+
<Generator>ResXFileCodeGenerator</Generator>
87+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
88+
</EmbeddedResource>
89+
<None Include="Properties\Settings.settings">
90+
<Generator>SettingsSingleFileGenerator</Generator>
91+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
92+
</None>
93+
</ItemGroup>
94+
<ItemGroup>
95+
<None Include="App.config" />
96+
</ItemGroup>
97+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
98+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Window x:Class="BooleanExpressionSolver.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:BooleanExpressionSolver"
7+
mc:Ignorable="d"
8+
Title="MainWindow" Height="450" Width="800">
9+
<Grid Loaded="Grid_Loaded">
10+
<Button Content="START" HorizontalAlignment="Left" Margin="274,11,0,0" VerticalAlignment="Top" Width="144" Height="48" Click="Start_Click"/>
11+
<DataGrid x:Name="TruthTable" HorizontalAlignment="Left" Height="348" Margin="10,64,0,0" VerticalAlignment="Top" Width="775" SelectionChanged="TruthTable_SelectionChanged"/>
12+
<TextBox x:Name="UserInput" HorizontalAlignment="Left" Height="22" Margin="10,37,0,0" TextWrapping="Wrap" Text="Expression" VerticalAlignment="Top" Width="259" TextChanged="UserInput_TextChanged"/>
13+
<TextBox x:Name="numberOfTerms" HorizontalAlignment="Left" Height="22" Margin="10,10,0,0" TextWrapping="Wrap" Text="Number Of Terms" VerticalAlignment="Top" Width="259" TextChanged="NumberOfTerms_TextChanged"/>
14+
15+
</Grid>
16+
</Window>

0 commit comments

Comments
 (0)