private void BtnPart2_Click(object sender, RoutedEventArgs e) { MoonSystem ms = new MoonSystem(); ms.SetLocations(tbCode.Text); tbResult.Text = ""; ulong steps = 0; //ms.SimulateWithRepeats(out steps); ms.FindByLeastCommonMultiple(out steps); tbResult.Text = steps.ToString(); }
private void Button_Click(object sender, RoutedEventArgs e) { MoonSystem ms = new MoonSystem(); ms.SetLocations(tbCode.Text); tbResult.Text = ""; int i = 0; for (i = 0; i < 10; i++) { tbResult.Text += " Step " + (i * 100).ToString() + Environment.NewLine; tbResult.Text += ms.SystemDescription; tbResult.Text += ms.TotalEnergy.ToString() + Environment.NewLine + Environment.NewLine; ms.RunSteps(100); } tbResult.Text += " Step " + (i * 100).ToString() + Environment.NewLine; tbResult.Text += ms.SystemDescription; tbResult.Text += ms.TotalEnergy.ToString() + Environment.NewLine + Environment.NewLine; }