"StreamReader sr = new StreamReader(@"C:\Users\Technology\Desktop\cashfivelotto.txt");".
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace OhioRollingCash5App
{
public partial class frmMain : Form
{
private TextBox tbmain = new TextBox();
private Button bgen = new Button();
private Button bclear = new Button();
private Label lblpickone = new Label();
private Label lblpicktwo = new Label();
private Label lblpickthree = new Label();
private Label lblpickfour = new Label();
private Label lblpickfive = new Label();
private Label lblone = new Label();
private Label lbltwo = new Label();
private Label lblthree = new Label();
private Label lblfour = new Label();
private Label lblfive = new Label();
private RadioButton rMon = new RadioButton();
private RadioButton rTue = new RadioButton();
private RadioButton rWed = new RadioButton();
private RadioButton rThu = new RadioButton();
private RadioButton rFri = new RadioButton();
private RadioButton rSat = new RadioButton();
private RadioButton rSun = new RadioButton();
//vars for each actual number
//these are used to hold the numbers
//actual value and other data about
//the number
List<Number> allnumobjs = new List<Number>();
//number priority lists
List<int> hotnums = new List<int>();
List<int> midnum = new List<int>();
List<int> coldnums = new List<int>();
//list to hold the picks
List<int> allpicks = new List<int>();
//List<int> poolone = new List<int>();
//List<int> pooltwo = new List<int>();
public frmMain()
{
#region properties
//size of the form
Size = new Size(638, 645);
//form title
this.Text = "Rolling Cash 5";
//button properties
bgen.Location = new Point(262, 45);
bgen.Width = 88;
bgen.Height = 41;
bgen.Text = "Generate";
bclear.Location = new Point(382, 45);
bclear.Width = 88;
bclear.Height = 41;
bclear.Text = "Clear";
//textbox properties
tbmain.Width = 202;
tbmain.Height = 513;
tbmain.Location = new Point(29, 45);
tbmain.Multiline = true;
tbmain.ReadOnly = true;
tbmain.ScrollBars = ScrollBars.Vertical;
tbmain.BackColor = Color.White;
//label locations
//label sizes, generic
Size lblSize = new Size(61, 21);
lblone. Location = new Point(258, 113);
lblone.Size = lblSize;
lblone.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lblone.Text = "Pick 1:";
lbltwo.Location = new Point(258, 163);
lbltwo.Size = lblSize;
lbltwo.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lbltwo.Text = "Pick 2:";
lblthree.Location = new Point(258, 213);
lblthree.Size = lblSize;
lblthree.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lblthree.Text = "Pick 3:";
lblfour.Location = new Point(258, 263);
lblfour.Size = lblSize;
lblfour.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lblfour.Text = "Pick 4:";
lblfive.Location = new Point(258, 313);
lblfive.Size = lblSize;
lblfive.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lblfive.Text = "Pick 5:";
//display labels
lblpickone.Location = new Point(350, 113);
lblpickone.Size = lblSize;
lblpickone.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lblpicktwo.Location = new Point(350, 163);
lblpicktwo.Size = lblSize;
lblpicktwo.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lblpickthree.Location = new Point(350, 213);
lblpickthree.Size = lblSize;
lblpickthree.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lblpickfour.Location = new Point(350, 263);
lblpickfour.Size = lblSize;
lblpickfour.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
lblpickfive.Location = new Point(350, 313);
lblpickfive.Size = lblSize;
lblpickfive.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
//radio button size generic
Size rsize = new Size(120, 26);
//radio button properties
rMon.Location = new Point(252, 403);
rMon.Size = rsize;
rMon.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
rMon.Text = "Monday";
rTue.Location = new Point(373, 403);
rTue.Size = rsize;
rTue.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
rTue.Text = "Tuesday";
rWed.Location = new Point(494, 403);
rWed.Size = rsize;
rWed.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
rWed.Text = "Wednesday";
rThu.Location = new Point(252, 469);
rThu.Size = rsize;
rThu.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
rThu.Text = "Thursday";
rFri.Location = new Point(373, 469);
rFri.Size = rsize;
rFri.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
rFri.Text = "Friday";
rSat.Location = new Point(494, 469);
rSat.Size = rsize;
rSat.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
rSat.Text = "Saturday";
rSun.Location = new Point(373, 535);
rSun.Size = rsize;
rSun.Font = new Font("Times New Roman", 10.8f, FontStyle.Regular);
rSun.Text = "Sunday";
#endregion
#region events
//register event handles
bgen.Click += new EventHandler(bgen_Click);
bclear.Click += new EventHandler(bclear_Click);
#endregion
#region numobjs
// DateTime dt = new DateTime();
Number n1 = new Number();
Number n2 = new Number();
Number n3 = new Number();
Number n4 = new Number();
Number n5 = new Number();
Number n6 = new Number();
Number n7 = new Number();
Number n8 = new Number();
Number n9 = new Number();
Number n10 = new Number();
Number n11 = new Number();
Number n12 = new Number();
Number n13 = new Number();
Number n14 = new Number();
Number n15 = new Number();
Number n16 = new Number();
Number n17 = new Number();
Number n18 = new Number();
Number n19 = new Number();
Number n20 = new Number();
Number n21 = new Number();
Number n22 = new Number();
Number n23 = new Number();
Number n24 = new Number();
Number n25 = new Number();
Number n26 = new Number();
Number n27 = new Number();
Number n28 = new Number();
Number n29 = new Number();
Number n30 = new Number();
Number n31 = new Number();
Number n32 = new Number();
Number n33 = new Number();
Number n34 = new Number();
Number n35 = new Number();
Number n36 = new Number();
Number n37 = new Number();
Number n38 = new Number();
Number n39 = new Number();
//put all num objects into a list for help
//with processing
allnumobjs.Add(n1);
allnumobjs.Add(n2);
allnumobjs.Add(n3);
allnumobjs.Add(n4);
allnumobjs.Add(n5);
allnumobjs.Add(n6);
allnumobjs.Add(n7);
allnumobjs.Add(n8);
allnumobjs.Add(n9);
allnumobjs.Add(n10);
allnumobjs.Add(n11);
allnumobjs.Add(n12);
allnumobjs.Add(n13);
allnumobjs.Add(n14);
allnumobjs.Add(n15);
allnumobjs.Add(n16);
allnumobjs.Add(n17);
allnumobjs.Add(n18);
allnumobjs.Add(n19);
allnumobjs.Add(n20);
allnumobjs.Add(n21);
allnumobjs.Add(n22);
allnumobjs.Add(n23);
allnumobjs.Add(n24);
allnumobjs.Add(n25);
allnumobjs.Add(n26);
allnumobjs.Add(n27);
allnumobjs.Add(n28);
allnumobjs.Add(n29);
allnumobjs.Add(n30);
allnumobjs.Add(n31);
allnumobjs.Add(n32);
allnumobjs.Add(n33);
allnumobjs.Add(n34);
allnumobjs.Add(n35);
allnumobjs.Add(n36);
allnumobjs.Add(n37);
allnumobjs.Add(n38);
allnumobjs.Add(n39);
//absolute values for each number
//or...its own value
n1.A_Val = 1;
n2.A_Val = 2;
n3.A_Val = 3;
n4.A_Val = 4;
n5.A_Val = 5;
n6.A_Val = 6;
n7.A_Val = 7;
n8.A_Val = 8;
n9.A_Val = 9;
n10.A_Val = 10;
n11.A_Val = 11;
n12.A_Val = 12;
n13.A_Val = 13;
n14.A_Val = 14;
n15.A_Val = 15;
n16.A_Val = 16;
n17.A_Val = 17;
n18.A_Val = 18;
n19.A_Val = 19;
n20.A_Val = 20;
n21.A_Val = 21;
n22.A_Val = 22;
n23.A_Val = 23;
n24.A_Val = 24;
n25.A_Val = 25;
n26.A_Val = 26;
n27.A_Val = 27;
n28.A_Val = 28;
n29.A_Val = 29;
n30.A_Val = 30;
n31.A_Val = 31;
n32.A_Val = 32;
n33.A_Val = 33;
n34.A_Val = 34;
n35.A_Val = 35;
n36.A_Val = 36;
n37.A_Val = 37;
n38.A_Val = 38;
n39.A_Val = 39;
//odd/even values
n1.Is_Odd = true;
n1.Is_Even = false;
n2.Is_Odd = false;
n2.Is_Even = true;
n3.Is_Odd = true;
n3.Is_Even = false;
n4.Is_Odd = false;
n4.Is_Even = true;
n5.Is_Odd = true;
n5.Is_Even = false;
n6.Is_Odd = false;
n6.Is_Even = true;
n7.Is_Odd = true;
n7.Is_Even = false;
n8.Is_Odd = false;
n8.Is_Even = true;
n9.Is_Odd = true;
n9.Is_Even = false;
n10.Is_Odd = false;
n10.Is_Even = true;
n11.Is_Odd = true;
n11.Is_Even = false;
n12.Is_Odd = false;
n12.Is_Even = true;
n13.Is_Odd = true;
n13.Is_Even = false;
n14.Is_Odd = false;
n14.Is_Even = true;
n15.Is_Odd = true;
n15.Is_Even = false;
n16.Is_Odd = false;
n16.Is_Even = true;
n17.Is_Odd = true;
n17.Is_Even = false;
n18.Is_Odd = false;
n18.Is_Even = true;
n19.Is_Odd = true;
n19.Is_Even = false;
n20.Is_Odd = false;
n20.Is_Even = true;
n21.Is_Odd = true;
n21.Is_Even = false;
n22.Is_Odd = false;
n22.Is_Even = true;
n23.Is_Odd = true;
n23.Is_Even = false;
n24.Is_Odd = false;
n24.Is_Even = true;
n25.Is_Odd = true;
n25.Is_Even = false;
n26.Is_Odd = false;
n26.Is_Even = true;
n27.Is_Odd = true;
n27.Is_Even = false;
n28.Is_Odd = false;
n28.Is_Even = true;
n29.Is_Odd = true;
n29.Is_Even = false;
n30.Is_Odd = false;
n30.Is_Even = true;
n31.Is_Odd = true;
n31.Is_Even = false;
n32.Is_Odd = false;
n32.Is_Even = true;
n33.Is_Odd = true;
n33.Is_Even = false;
n34.Is_Odd = false;
n34.Is_Even = true;
n35.Is_Odd = true;
n35.Is_Even = false;
n36.Is_Odd = false;
n36.Is_Even = true;
n37.Is_Odd = true;
n37.Is_Even = false;
n38.Is_Odd = false;
n38.Is_Even = true;
n39.Is_Odd = true;
n39.Is_Even = false;
#endregion
#region readintext
//reading in the file
int counter = 0;
string line;
//list to add the results to
List<string> ipicks = new List<string>();
//read in results
StreamReader sr = new StreamReader(@"C:\Users\Technology\Desktop\cashfivelotto.txt");
//iterate through the text file, until we reach the end
while ((line = sr.ReadLine()) != null)
{
//remove the comma's from the file and store the numbers in numset
char[] delimiters = new char[] { ',' };
string[] numset = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < numset.Length; i++)
{
//counter for line numbers and formatting
counter++;
if (counter % 6 == 0)
{
//add the text
tbmain.Text += line + System.Environment.NewLine;
//enumerate values for each number
//based on netvalues and day values
for (int j = 1; j < numset.Length; j++)
{
foreach(Number n in allnumobjs)
{
if(n.A_Val == int.Parse(numset[j]))
{
n.Net_Val += 1;
if (numset[0] == "MON")
{
n.Monday += 1;
}
else if (numset[0] == "TUE")
{
n.Tuesday += 1;
}
else if (numset[0] == "WED")
{
n.Wednesday += 1;
}
else if (numset[0] == "THU")
{
n.Thursday += 1;
}
else if (numset[0] == "FRI")
{
n.Friday += 1;
}
else if (numset[0] == "SAT")
{
n.Saturday += 1;
}
else
{
n.Sunday += 1;
}
}
}
}
}
ipicks.Add(numset[i]);
}
//sr.Close();
}
//close streamreader
sr.Close();
#endregion
#region lists
int average = 0;
foreach (Number n in allnumobjs)
{
average += n.A_Val;
if (n.Net_Val >= 23)
{
hotnums.Add(n.A_Val);
}
else if (n.Net_Val <= 22)
{
coldnums.Add(n.A_Val);
}
}
average = average / allnumobjs.Count;
//eliminate doubles from the lists
foreach (int i in coldnums)
{
for (int x = 0; x < hotnums.Count; x++)
{
if (i == hotnums[x])
{
hotnums.Remove(x);
}
}
}
// lblpickone.Text = hotnums.Count.ToString();
// lblpickfive.Text = coldnums.Count.ToString();
#endregion
#region addcontrols
//add the controls to the form
Controls.Add(tbmain);
Controls.Add(bgen);
Controls.Add(bclear);
Controls.Add(lblone);
Controls.Add(lbltwo);
Controls.Add(lblthree);
Controls.Add(lblfour);
Controls.Add(lblfive);
Controls.Add(lblpickone);
Controls.Add(lblpicktwo);
Controls.Add(lblpickthree);
Controls.Add(lblpickfour);
Controls.Add(lblpickfive);
Controls.Add(rMon);
Controls.Add(rTue);
Controls.Add(rWed);
Controls.Add(rThu);
Controls.Add(rFri);
Controls.Add(rSat);
Controls.Add(rSun);
#endregion
//InitializeComponent();
}
private void bgen_Click(object sender, EventArgs e)
{
//day lists for common numbers for the day
List<int> mon = new List<int>();
List<int> tue = new List<int>();
List<int> wed = new List<int>();
List<int> thu = new List<int>();
List<int> fri = new List<int>();
List<int> sat = new List<int>();
List<int> sun = new List<int>();
int pick1 = 0, pick2 = 0, pick3 = 0, pick4 = 0, pick5 = 0;
if (rMon.Checked)
{
foreach (Number n in this.allnumobjs)
{
if (n.Monday > 3)
{
mon.Add(n.A_Val);
}
}
rand1:
Random r = new Random();
pick1 = hotnums[r.Next(0, hotnums.Count)];
pick2 = hotnums[r.Next(0, hotnums.Count)];
if (pick1 == pick2)
{
goto rand1;
}
pick3 = mon[r.Next(0, mon.Count)];
pick4 = mon[r.Next(0, mon.Count)];
if (pick3 == pick4)
{
goto rand1;
}
pick5 = coldnums[r.Next(0, coldnums.Count)];
int picktot = pick1 + pick2 + pick3 + pick4 + pick5;
if ((picktot <= 80) || (picktot >= 125))
{
goto rand1;
}
allpicks.Add(pick1);
allpicks.Add(pick2);
allpicks.Add(pick3);
allpicks.Add(pick4);
allpicks.Add(pick5);
allpicks.Sort();
int even = 0;
int odd = 0;
foreach (int i in allpicks)
{
foreach (Number n in allnumobjs)
{
if (i == n.A_Val)
{
if (n.Is_Even)
{
even++;
}
else
{
odd++;
}
}
}
}
//make sure we keep 4/1, 3/2 split on odds and evens
if ((even > 4) || (odd > 4))
{
goto rand1;
}
//first pick shouldnt be more than 14
if (allpicks[0] >= 14)
{
goto rand1;
}
//the picks are good, display them
lblpickone.Text = allpicks[0].ToString();
lblpicktwo.Text = allpicks[1].ToString();
lblpickthree.Text = allpicks[2].ToString();
lblpickfour.Text = allpicks[3].ToString();
lblpickfive.Text = allpicks[4].ToString();
allpicks.Clear();
mon.Clear();
}
else if (rTue.Checked)
{
foreach (Number n in this.allnumobjs)
{
if (n.Tuesday > 3)
{
tue.Add(n.A_Val);
}
}
rand2:
Random r = new Random();
pick1 = hotnums[r.Next(0, hotnums.Count)];
pick2 = hotnums[r.Next(0, hotnums.Count)];
if (pick1 == pick2)
{
goto rand2;
}
pick3 = tue[r.Next(0, tue.Count)];
pick4 = tue[r.Next(0, tue.Count)];
if (pick3 == pick4)
{
goto rand2;
}
pick5 = coldnums[r.Next(0, coldnums.Count)];
int picktot = pick1 + pick2 + pick3 + pick4 + pick5;
if ((picktot <= 80) || (picktot >= 125))
{
goto rand2;
}
allpicks.Add(pick1);
allpicks.Add(pick2);
allpicks.Add(pick3);
allpicks.Add(pick4);
allpicks.Add(pick5);
allpicks.Sort();
int even = 0;
int odd = 0;
foreach (int i in allpicks)
{
foreach (Number n in allnumobjs)
{
if (i == n.A_Val)
{
if (n.Is_Even)
{
even++;
}
else
{
odd++;
}
}
}
}
//make sure we keep 4/1, 3/2 split on odds and evens
if ((even > 4) || (odd > 4))
{
goto rand2;
}
//first pick shouldnt be more than 14
if (allpicks[0] >= 14)
{
goto rand2;
}
//the picks are good, display them
lblpickone.Text = allpicks[0].ToString();
lblpicktwo.Text = allpicks[1].ToString();
lblpickthree.Text = allpicks[2].ToString();
lblpickfour.Text = allpicks[3].ToString();
lblpickfive.Text = allpicks[4].ToString();
allpicks.Clear();
tue.Clear();
}
else if (rWed.Checked)
{
foreach (Number n in this.allnumobjs)
{
if (n.Wednesday > 3)
{
wed.Add(n.A_Val);
}
}
rand3:
Random r = new Random();
pick1 = hotnums[r.Next(0, hotnums.Count)];
pick2 = hotnums[r.Next(0, hotnums.Count)];
if (pick1 == pick2)
{
goto rand3;
}
pick3 = wed[r.Next(0, wed.Count)];
pick4 = wed[r.Next(0, wed.Count)];
if (pick3 == pick4)
{
goto rand3;
}
pick5 = coldnums[r.Next(0, coldnums.Count)];
int picktot = pick1 + pick2 + pick3 + pick4 + pick5;
if ((picktot <= 80) || (picktot >= 125))
{
goto rand3;
}
allpicks.Add(pick1);
allpicks.Add(pick2);
allpicks.Add(pick3);
allpicks.Add(pick4);
allpicks.Add(pick5);
allpicks.Sort();
int even = 0;
int odd = 0;
foreach (int i in allpicks)
{
foreach (Number n in allnumobjs)
{
if (i == n.A_Val)
{
if (n.Is_Even)
{
even++;
}
else
{
odd++;
}
}
}
}
//make sure we keep 4/1, 3/2 split on odds and evens
if ((even > 4) || (odd > 4))
{
goto rand3;
}
//first pick shouldnt be more than 14
if (allpicks[0] >= 14)
{
goto rand3;
}
//the picks are good, display them
lblpickone.Text = allpicks[0].ToString();
lblpicktwo.Text = allpicks[1].ToString();
lblpickthree.Text = allpicks[2].ToString();
lblpickfour.Text = allpicks[3].ToString();
lblpickfive.Text = allpicks[4].ToString();
allpicks.Clear();
wed.Clear();
}
else if (rThu.Checked)
{
foreach (Number n in this.allnumobjs)
{
if (n.Thursday > 3)
{
thu.Add(n.A_Val);
}
}
rand4:
Random r = new Random();
pick1 = hotnums[r.Next(0, hotnums.Count)];
pick2 = hotnums[r.Next(0, hotnums.Count)];
if (pick1 == pick2)
{
goto rand4;
}
pick3 = thu[r.Next(0, thu.Count)];
pick4 = thu[r.Next(0, thu.Count)];
if (pick3 == pick4)
{
goto rand4;
}
pick5 = coldnums[r.Next(0, coldnums.Count)];
int picktot = pick1 + pick2 + pick3 + pick4 + pick5;
if ((picktot <= 80) || (picktot >= 125))
{
goto rand4;
}
allpicks.Add(pick1);
allpicks.Add(pick2);
allpicks.Add(pick3);
allpicks.Add(pick4);
allpicks.Add(pick5);
allpicks.Sort();
int even = 0;
int odd = 0;
foreach (int i in allpicks)
{
foreach (Number n in allnumobjs)
{
if (i == n.A_Val)
{
if (n.Is_Even)
{
even++;
}
else
{
odd++;
}
}
}
}
//make sure we keep 4/1, 3/2 split on odds and evens
if ((even > 4) || (odd > 4))
{
goto rand4;
}
//first pick shouldnt be more than 14
if (allpicks[0] >= 14)
{
goto rand4;
}
//the picks are good, display them
lblpickone.Text = allpicks[0].ToString();
lblpicktwo.Text = allpicks[1].ToString();
lblpickthree.Text = allpicks[2].ToString();
lblpickfour.Text = allpicks[3].ToString();
lblpickfive.Text = allpicks[4].ToString();
allpicks.Clear();
thu.Clear();
}
else if (rFri.Checked)
{
foreach (Number n in this.allnumobjs)
{
if (n.Friday > 3)
{
fri.Add(n.A_Val);
}
}
rand5:
Random r = new Random();
pick1 = hotnums[r.Next(0, hotnums.Count)];
pick2 = hotnums[r.Next(0, hotnums.Count)];
if (pick1 == pick2)
{
goto rand5;
}
pick3 = fri[r.Next(0, fri.Count)];
pick4 = fri[r.Next(0, fri.Count)];
if (pick3 == pick4)
{
goto rand5;
}
pick5 = coldnums[r.Next(0, coldnums.Count)];
int picktot = pick1 + pick2 + pick3 + pick4 + pick5;
if ((picktot <= 80) || (picktot >= 125))
{
goto rand5;
}
allpicks.Add(pick1);
allpicks.Add(pick2);
allpicks.Add(pick3);
allpicks.Add(pick4);
allpicks.Add(pick5);
allpicks.Sort();
int even = 0;
int odd = 0;
foreach (int i in allpicks)
{
foreach (Number n in allnumobjs)
{
if (i == n.A_Val)
{
if (n.Is_Even)
{
even++;
}
else
{
odd++;
}
}
}
}
//make sure we keep 4/1, 3/2 split on odds and evens
if ((even > 4) || (odd > 4))
{
goto rand5;
}
//first pick shouldnt be more than 14
if (allpicks[0] >= 14)
{
goto rand5;
}
//the picks are good, display them
lblpickone.Text = allpicks[0].ToString();
lblpicktwo.Text = allpicks[1].ToString();
lblpickthree.Text = allpicks[2].ToString();
lblpickfour.Text = allpicks[3].ToString();
lblpickfive.Text = allpicks[4].ToString();
allpicks.Clear();
fri.Clear();
}
else if (rSat.Checked)
{
foreach (Number n in this.allnumobjs)
{
if (n.Saturday > 3)
{
sat.Add(n.A_Val);
}
}
rand6:
Random r = new Random();
pick1 = hotnums[r.Next(0, hotnums.Count)];
pick2 = hotnums[r.Next(0, hotnums.Count)];
if (pick1 == pick2)
{
goto rand6;
}
pick3 = sat[r.Next(0, sat.Count)];
pick4 = sat[r.Next(0, sat.Count)];
if (pick3 == pick4)
{
goto rand6;
}
pick5 = coldnums[r.Next(0, coldnums.Count)];
int picktot = pick1 + pick2 + pick3 + pick4 + pick5;
if ((picktot <= 80) || (picktot >= 125))
{
goto rand6;
}
allpicks.Add(pick1);
allpicks.Add(pick2);
allpicks.Add(pick3);
allpicks.Add(pick4);
allpicks.Add(pick5);
allpicks.Sort();
int even = 0;
int odd = 0;
foreach (int i in allpicks)
{
foreach (Number n in allnumobjs)
{
if (i == n.A_Val)
{
if (n.Is_Even)
{
even++;
}
else
{
odd++;
}
}
}
}
//make sure we keep 4/1, 3/2 split on odds and evens
if ((even > 4) || (odd > 4))
{
goto rand6;
}
//first pick shouldnt be more than 14
if (allpicks[0] >= 14)
{
goto rand6;
}
//the picks are good, display them
lblpickone.Text = allpicks[0].ToString();
lblpicktwo.Text = allpicks[1].ToString();
lblpickthree.Text = allpicks[2].ToString();
lblpickfour.Text = allpicks[3].ToString();
lblpickfive.Text = allpicks[4].ToString();
allpicks.Clear();
sat.Clear();
}
else if (rSun.Checked)
{
foreach (Number n in this.allnumobjs)
{
if (n.Sunday > 3)
{
sun.Add(n.A_Val);
}
}
rand7:
Random r = new Random();
pick1 = hotnums[r.Next(0, hotnums.Count)];
pick2 = hotnums[r.Next(0, hotnums.Count)];
if (pick1 == pick2)
{
goto rand7;
}
pick3 = sun[r.Next(0, sun.Count)];
pick4 = sun[r.Next(0, sun.Count)];
if (pick3 == pick4)
{
goto rand7;
}
pick5 = coldnums[r.Next(0, coldnums.Count)];
int picktot = pick1 + pick2 + pick3 + pick4 + pick5;
if ((picktot <= 80) || (picktot >= 125))
{
goto rand7;
}
allpicks.Add(pick1);
allpicks.Add(pick2);
allpicks.Add(pick3);
allpicks.Add(pick4);
allpicks.Add(pick5);
allpicks.Sort();
int even = 0;
int odd = 0;
foreach (int i in allpicks)
{
foreach (Number n in allnumobjs)
{
if (i == n.A_Val)
{
if (n.Is_Even)
{
even++;
}
else
{
odd++;
}
}
}
}
//make sure we keep 4/1, 3/2 split on odds and evens
if ((even > 4) || (odd > 4))
{
goto rand7;
}
//first pick shouldnt be more than 14
if (allpicks[0] >= 14)
{
goto rand7;
}
//the picks are good, display them
lblpickone.Text = allpicks[0].ToString();
lblpicktwo.Text = allpicks[1].ToString();
lblpickthree.Text = allpicks[2].ToString();
lblpickfour.Text = allpicks[3].ToString();
lblpickfive.Text = allpicks[4].ToString();
allpicks.Clear();
sun.Clear();
}
else
{
MessageBox.Show("Please select a day");
}
}
private void bclear_Click(object sender, EventArgs e)
{
lblpickone.Text = "";
lblpicktwo.Text = "";
lblpickthree.Text = "";
lblpickfour.Text = "";
lblpickfive.Text = "";
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
public class Number
{
public Number()
{
}
#region properties
public int Monday
{
get { return this.monday; }
set
{
this.monday = value;
}
}
private int monday;
public int Tuesday
{
get { return this.tuesday; }
set
{
this.tuesday = value;
}
}
private int tuesday;
public int Wednesday
{
get { return this.wednesday; }
set
{
this.wednesday = value;
}
}
private int wednesday;
public int Thursday
{
get { return this.thursday; }
set
{
this.thursday = value;
}
}
private int thursday;
public int Friday
{
get { return this.friday; }
set
{
this.friday = value;
}
}
private int friday;
public int Saturday
{
get { return this.saturday; }
set
{
this.saturday = value;
}
}
private int saturday;
public int Sunday
{
get { return this.sunday; }
set
{
this.sunday = value;
}
}
private int sunday;
public bool Is_Even
{
get { return this.is_even; }
set
{
this.is_even = value;
}
}
private bool is_even;
public bool Is_Odd
{
get { return this.is_odd; }
set
{
this.is_odd = value;
}
}
private bool is_odd;
public bool Is_Hot
{
get { return this.is_hot; }
set
{
this.is_hot = value;
}
}
private bool is_hot;
public bool Is_Cold
{
get { return this.is_cold; }
set
{
this.is_cold = value;
}
}
private bool is_cold;
public int A_Val
{
get { return this.a_val; }
set
{
this.a_val = value;
}
}
private int a_val;
public int Net_Val
{
get { return this.net_val; }
set
{
this.net_val = value;
}
}
private int net_val;
#endregion
}
}
Attached File(s)
-
cashfivelotto.txt (4.51K)
Number of downloads: 18

New Topic/Question
Reply



MultiQuote






|