public static Program FromString(string betString)
{
Console.WriteLine("betString: " + betString);
string[] fields = betString.Split(',');
Console.WriteLine("fields: " + string.Join(", ", fields));
if (fields.Length != 6)
{
throw new ArgumentException("Invalid bet string format.");
}
string numberString = fields[0];
int bet = int.Parse(fields[1]);
double multiplier = double.Parse(fields[2]);
int frequency = int.Parse(fields[3]);
int counter = int.Parse(fields[4]);
string timeString = fields[5];
return new Program(numberString, bet, multiplier, frequency, counter, timeString);
}