Namespace set __ Color ball Practice
{
Class Program
{
static void Main (string[] args)
{
while (true)
// {
ArrayList al = new ArrayList ();
Al. ADD (1); Al. ADD (2); Al. ADD (3); Al. ADD (4); Al. ADD (5); Al. ADD (6); Al. ADD (7); Al. ADD (8); Al. ADD (9); Al. ADD (10); Al. ADD (11); Al. ADD (12); Al. ADD (13); Al. ADD (14); Al. ADD (15); Al. ADD (16); Al. ADD (17); Al. ADD (18); Al. ADD (19); Al. ADD (20); Al. ADD (21); Al. ADD (22); Al. ADD (23); Al. ADD (24); Al. ADD (25); Al. Add (26); Al. ADD (27); Al. ADD (28); Al. ADD (29); Al. ADD (30); Al. ADD (31); Al. ADD (31); Al. ADD (31);
Random r = new Random ();
int x = R.next (1,al. Count);
Console.Write (x+ "\ t");
Al. Remove (x);
int y = R.next (1, AL. Count);
Console.Write (y + "\ t");
Al. Remove (y);
int z = r.next (1, AL. Count);
Console.Write (z + "\ t");
Al. Remove (z);
int s = r.next (1, AL. Count);
Console.Write (s + "\ T");
Al. Remove (s);
int t = R.next (1, AL. Count);
Console.Write (t + "t");
Al. Remove (t);
int w = r.next (1, AL. Count);
Console.Write (w + "T");
Al. Remove (w);
Blue Ball
int q = r.next (1, 17);
Console.Write ("Blue ball for" +q + "\ t");
Console.ReadLine ();
// }
//random r = new Random ();
//arraylist al = new ArrayList ();
//while (true)
//{
// if (al. Count = = 6)
// {
// break;
// }
Else
// {
int a = R.next (1, 34);
if (al. Contains (a))
// {
// }
Else
// {
Al. Add (a);
// }
// }
//}
Al. Sort ();
Console.Write ("red ball is \ t");
for (int i = 0; i < al. Count; i++)
//{
Console.Write (Al[i] + "\ t");
//}
int y = r.next (1, 17);
Console.Write ("Blue ball for" + y);
Console.ReadLine ();
}
}
}
Set ArrayList color ball Practice (own method, too troublesome)