Skip to content

Instantly share code, notes, and snippets.

@dmitrybubyakin
Created March 19, 2015 10:58
Show Gist options
  • Save dmitrybubyakin/8ca0a1fab6a572426af5 to your computer and use it in GitHub Desktop.
Save dmitrybubyakin/8ca0a1fab6a572426af5 to your computer and use it in GitHub Desktop.
Code
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < s.Length; i++) s[i] = 0;
for (int i = 0; i < tf.Length; i++) tf[i] = 0;
for (int i = 0; i < 24; i++) tf[i + 1] = Convert.ToInt32(this.groupBox1.Controls["textBox" + (i + 1)].Text);
s[0] = tf[1] + tf[3] + tf[4] + tf[5] + tf[6] + tf[7] + tf[8] + tf[9] + tf[14] - tf[15] + 2 * tf[20];
s[1] = tf[2] + tf[12] + tf[19] + tf[10] - tf[11];
s[2] = tf[1] + tf[3] + tf[4] + tf[5] + tf[6] + tf[7] + tf[8] + tf[9] + tf[14] - tf[15] + tf[20];
s[3] = tf[1] + tf[3] + tf[4] + tf[5] + tf[6] + tf[7] + tf[9] + tf[14] + tf[20];
s[4] = tf[1] + tf[3] + tf[5] + tf[9] + tf[14] + tf[16] + tf[17] + tf[18] + tf[20];
s[5] = tf[1] + tf[3] + tf[5] + tf[9] + tf[14] + tf[16] + tf[17] + tf[18] + tf[20] - tf[21] - tf[22];
s[6] = tf[1] + tf[3] + tf[5] + tf[9] + tf[14] + tf[16] + tf[17] + tf[18] + tf[20] - tf[21] - tf[22] - tf[19];
s[7] = tf[1] + tf[3] + tf[4] + tf[5] + tf[6] + tf[7] + tf[8] + tf[9] + tf[14] - tf[15] + 2 * tf[20] + tf[23] - tf[24];
s[8] = tf[20] + tf[13];
for (int i = 1; i <= 9; i++)
if ((this.groupBox1.Controls["checkBox" + i] as CheckBox).Checked)
this.groupBox2.Controls["label" + (35 + i)].Text = s[i - 1].ToString();
else this.groupBox2.Controls["label" + (35 + i)].Text = "###";
groupBox2.Visible = true;
groupBox1.Visible = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment