I am working on a small program that will take 3 digit number and shuffle it to all the possible outcomes. This is the code I have, and of course it works, but it seems very inefficient, and was wondering what other way can I do? As in instead of using different textbox can I use one, and shuffle the number placements?
namespace possibleoutcomes
{
public partial class Form1 : Form
{
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Add(textBox1.Text + textBox2.Text + textBox3.Text);
listBox1.Items.Add(textBox1.Text + textBox3.Text + textBox2.Text);
listBox1.Items.Add(textBox2.Text + textBox3.Text + textBox1.Text);
listBox1.Items.Add(textBox2.Text + textBox1.Text + textBox3.Text);
listBox1.Items.Add(textBox3.Text + textBox2.Text + textBox1.Text);
listBox1.Items.Add(textBox3.Text + textBox1.Text + textBox2.Text);
}
}
}