Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
telnorp authored Aug 27, 2024
0 parents commit 9a3311d
Show file tree
Hide file tree
Showing 6 changed files with 606 additions and 0 deletions.
279 changes: 279 additions & 0 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
namespace binary
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void updateOut()
{
int sum = 0;

if (bool128.Checked)
sum += 128;
if (bool64.Checked)
sum += 64;
if (bool32.Checked)
sum += 32;
if (bool16.Checked)
sum += 16;
if (bool8.Checked)
sum += 8;
if (bool4.Checked)
sum += 4;
if (bool2.Checked)
sum += 2;
if (bool1.Checked)
sum += 1;

outputBits.Text = sum.ToString();
}

private void bool128_CheckedChanged(object sender, EventArgs e)
{
updateOut();
}

private void bool64_CheckedChanged(object sender, EventArgs e)
{
updateOut();
}

private void bool32_CheckedChanged(object sender, EventArgs e)
{
updateOut();
}

private void bool16_CheckedChanged(object sender, EventArgs e)
{
updateOut();
}

private void bool8_CheckedChanged(object sender, EventArgs e)
{
updateOut();
}

private void bool4_CheckedChanged(object sender, EventArgs e)
{
updateOut();
}

private void bool2_CheckedChanged(object sender, EventArgs e)
{
updateOut();
}

private void bool1_CheckedChanged(object sender, EventArgs e)
{
updateOut();
}

private void outputBits_TextChanged(object sender, EventArgs e)
{
//TODO: make a stable in/out system.
}
}
}
Loading

0 comments on commit 9a3311d

Please sign in to comment.