-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbet
149 lines (113 loc) · 4.76 KB
/
bet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
using System;
using System.IO;
using System.Linq;
namespace FileApplication
{
class Program
{
static void Main(string[] args)
{
string[] bettype = new string[] { "WIN", "PLA", "QIN", "QPL", "TRI", "CW" }; /*array of bettypes*/
//generate array
string[] scalibrator = new string[65]; /*output text to calibrator (string)*/
double[] dcalibrator = new double[65]; /*output text to calibrator*/
//dcalibrator[0] = "racebet(0306,1) {0} $100 "
int[] Ri = new int[10]; /* Ri is number of races, an array of 10 integers */
//int m, n, s; /*m = race no, n = no of horses, s = no of selections */
//m = 2;
/* initialize elements of array x */
for (int x = 2; x < 7; x++)
{
Ri[x] = x ;
}
//int[] mm = { 2, 3, 4, 5, 6};
//int[] n = { , 5, 6, 1, 2, 3, -2, -1, 0 };
for (int m = 2; m < 7; m++)
{
double[] race = new double[m];
string[] bet = new string[m];
for (int n = 1; n < 64; n++)
{
double[] Nrace = new double[n];
for (int i = 1; i < m; i++)
{
race[i] = i;
//Console.WriteLine(race[i]);
bet[i] = bettype[1]; //+ " " + i + "*" + "1+2+3" +"/"; /* WIN 0*1+2+3/ */
Console.WriteLine(bet[i]);
// }
//Console.WriteLine(race);
Console.WriteLine("racebet(0306,1) ST SUN {0}x{1} {2} 1*1 ", m, n, bet[i]);
scalibrator[n] = string.Format("racebet(0306,1) ST SUN {0}x{1} {2} 1*1", m, n, bet[i]);
//Console.WriteLine(Ri[i]);
int sz = race.Count();
for (int szi = 0; szi < sz-1; szi++)
{
scalibrator[n] += string.Format("/");
//Console.WriteLine("Size of Race is : {0}, race is {1}", szi, race[i]);
scalibrator[n] += string.Format(" {0} {1}*1", bet[i], szi + 2);
//Console.ReadKey();
}
scalibrator[n] += string.Format(" $10");
Console.WriteLine(scalibrator[n]);
//if (i<n+1)
//{
// scalibrator[n] += string.Format("/");
// scalibrator[n] += string.Format("WIN {0}*1", race[i]);
//}
//else
//scalibrator[n] += string.Format("$100");
//Console.WriteLine(scalibrator[n]);
}
}
/*write to m-th text file*/
string filename_p = "N_Race" + m + "_" + Convert.ToString(bettype[1]);
using (StreamWriter sw = new StreamWriter("C:/Users/simonasmlam/Work/" + filename_p + ".txt"))
{
foreach (string k in scalibrator)
{
sw.WriteLine(k);
}
//foreach (string s in names)
//{
// sw.WriteLine(s);
//}
}
}
//Write lines into file
/*sample*/
//string[] names = new string[] { "Zara Ali", "Nuha Ali" };
Console.WriteLine("Reading from test file");
string filename = "N_Race" + "test";//i;
string line = "";
using (StreamReader sw = new StreamReader("C:/Users/simonasmlam/Work/"+filename+".txt"))
{
{
while ((line = sw.ReadLine()) != null)
{
Console.WriteLine(line);
}
//line = sr.ReadLine()
//foreach (string k in line)
//{
// sw.WriteLine(k);
//}
//foreach (string s in names)
//{
// sw.WriteLine(s);
//}
}
/*Read and show each line from the file.*/
//string line = "";
//using (StreamReader sr = new StreamReader("C:/Users/simonasmlam/Work/test2.txt"))
//{
// while ((line = sr.ReadLine()) != null)
// {
// Console.WriteLine(line);
// }
//}
Console.ReadKey();
}
}
}
}