All pastes #416087 Raw Edit

ayan4m1

public text v1 · immutable
#416087 ·published 2007-03-30 01:36 UTC
rendered paste body
string[] oreTypes = new string[] { "Veldspar", "Scordite", "Pyroxeres", "Plagioclase", "Omber", "Kernite", "Jaspet", "Hemorphite", "Hedbergite", "Spudomain", "Gneiss", "Dark Ochre", "Crokite", "Bistot", "Arkonor", "Mercoxit" };
float[] oreSecurity = new float[] { 1.0f, 1.0f, 0.7f, 1.0f, 0.7f, 0.7f, 0.5f, 0.3f, 0.3f, 0, 0, 0, 0, 0, 0, 0 };

private void textBox1_Leave(sender object, EventArgs e)
{
        //This gets called when the user leaves the text box with the security status in it
	comboBox1.Items.Clear();
	for(int x = 0; x < oreTypes.Length; x++)
	{
		//If the security the user entered is less than the system's security (i.e the system is safer) add it
		if (float.Parse(textBox1.Text) <= oreSec[x])
		{
			comboBox1.Items.Add(oreTypes[x]);
		}
	}
}