I'm trying to write a Lottery system with C#. What I want it to do is allow me to enter people names and the number of tickets then have it draw 1. But I've ended up hardcoded in the people and going with one ticket per person. See below...:
Can anyone help me with turning this ^ into what I want?
Code:
Â
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
Â
namespace CSR
{
  public partial class CSR_Lottery_Main : Form
  {
    public CSR_Lottery_Main()
    {
      InitializeComponent();
    }
    public static Int16[] times = new Int16[19];
Â
Â
    private void button1_Click(object sender, EventArgs e)
    {
      string[] emp_name;
      emp_name = new string[] {
      "{CSR}Fire Raven Keshik",
      "101st Raven unit",
      "10th Raven Guard Cluster",
      "13th Assault Cluster (The  Howling Coyotes)",
      "1st Raven Elite Keshik",
      "21st Raven Rangers",
      "63rd Raven Brigade",
      "6th Raven Battle Cluster",
      "97th Raven Strike Cluster (The Soaring Ravens)",
      "9th Raven Striker",
      "DADI",
      "Druid",
      "Enac",
      "Final light",
      "Metallic Ministry",
      "Pyro Empire",
      "Ravenloft Cluster",
      "Shinbusen",
      "SRT Corp.",
      "The Lords of Chaos",
      "The Shark Empire",
      "The WolfPack Mercenary Company",
      "Wraith Galaxy:  The Rangers"};
Â
Â
      Random random = new Random();
Â
      int w = random.Next();
      w = w % 23;
      winner.Text = emp_name[w];
      string cur = Convert.ToString(w + 1);
      currnum.Text = cur;
     Â
     Â
Â
    }
Â
  }
}
Can anyone help me with turning this ^ into what I want?