internal bool FillWindow() { if (Test.Question.Count == 0) { return(false); } else { Content = Test.Question[0].Content; QuestionInfo = (Id + 1).ToString() + " of " + Test.Question.Count.ToString(); Timeleft = Test.Length; Answer.Clear(); for (int i = 0; i < 5; i++) { if (Test.Question[Id].Answer.Count > i) { Answer.Add(Test.Question[Id].Answer[i].Item1); CheckBoxVisible[i] = "Visible"; } else { Answer.Add(""); CheckBoxVisible[i] = "Hidden"; } } RaisePropertyChanged("CheckBoxVisible"); return(true); } }
public Question(object code, object answer_code, object k, object type, object dop_param, object answer) { Code = (int)code; SumK = (decimal)k; Answer_code.Add((int)answer_code); Answer.Add(answer.ToString()); K.Add((decimal)k); Type = type.ToString(); Dop_param = dop_param.ToString(); }
private void OptionButtonChecked(object sender, RoutedEventArgs e) { var optionButton = sender as ToggleButton; optionButton.Background = new SolidColorBrush(chosenOptionColor); var buttonIndex = optionButtons.IndexOf(optionButton); Answer.Add(buttonIndex); IsAnswerChosen = true; }
public void AddAnswer(object answer_code, object answer, object k = null) { if (k == null) { K.Add(0); } else { SumK += (decimal)k; K.Add((decimal)k); } Answer_code.Add((int)answer_code); Answer.Add(answer.ToString()); }
private void Reset() { Answer.Clear(); Console.WriteLine(SearchQuery); ISearchImplBase search = new ArtyomSearch(); switch (SelectedName) { case "Artyom": break; case "Sergey": search = new SergeySearch(); break; case "Nikita": search = new NikitaSearch(); break; } search.Initialize(); foreach (var k in Directory.EnumerateFiles(ArtyomSearch.RootDirectory, "*.txt")) { if (k != "MyDictionary.txt") { search.AddFileToIndex(k); } } if (SearchQuery == "") { return; } foreach (var inner in search.DoSearch(SearchQuery)) { Answer.Add($"{Path.GetFileName(inner.FilePath)} : {inner.Score}"); } }
void Start() { string[] Alphabreak = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; string Serial = Bomb.GetSerialNumber(); string Log4 = "Mutation numbers: "; for (int x = 0; x < 9; x++) { switch (x) { case 0: case 1: case 2: case 3: case 4: case 5: Focus[x] = Array.IndexOf(Alphabreak, Serial[x].ToString()) != -1 ? (Array.IndexOf(Alphabreak, Serial[x].ToString()) + 1) % 4 : Int32.Parse(Serial[x].ToString()) % 4; break; case 6: Focus[x] = Bomb.GetBatteryCount() % 4; break; case 7: Focus[x] = Bomb.GetIndicators().Count() % 4; break; case 8: Focus[x] = Bomb.GetPortCount() % 4; break; default: break; } Log4 += (Focus[x] + 1).ToString(); } string[] TheColors = { "Red", "Yellow", "Green", "Blue" }; string Log1 = "Sequence shown on top: ", Log2 = "Colors of each letter: ", Log3 = "DNA strand colors: ", Log5 = "Correct new sequence (before color strand rules): "; for (int x = 0; x < 9; x++) { Color[x] = UnityEngine.Random.Range(0, 4); Chemical[x] = UnityEngine.Random.Range(0, 4); StrandColors[x] = UnityEngine.Random.Range(0, 4); Strands[x].GetComponent <MeshRenderer>().material = DarkerMaterials[StrandColors[x]]; TopDisplay.text += x != 8 ? "<color=" + Colors[Color[x]] + ">" + Letters[Chemical[x]] + "</color> " : "<color=" + Colors[Color[x]] + ">" + Letters[Chemical[x]] + "</color>"; RepresentingLetters[x] = Mutation[Color[x]][Chemical[x]][Focus[x]].ToString(); Log1 += Letters[Chemical[x]]; Log2 += x != 8 ? TheColors[Color[x]] + ", " : TheColors[Color[x]]; Log3 += x != 8 ? DarkerMaterials[StrandColors[x]].name + ", " : DarkerMaterials[StrandColors[x]].name; Log5 += RepresentingLetters[x]; } Debug.LogFormat("[DNA Mutation #{0}] {1}", moduleId, Log1); Debug.LogFormat("[DNA Mutation #{0}] {1}", moduleId, Log2); Debug.LogFormat("[DNA Mutation #{0}] {1}", moduleId, Log3); Debug.LogFormat("[DNA Mutation #{0}] {1}", moduleId, Log4); Debug.LogFormat("[DNA Mutation #{0}] {1}", moduleId, Log5); for (int x = 0; x < 2; x++) { int[] NumberChoice = { 3, 5 }; for (int y = 0; y < 2; y++) { if (y == 0) { NumberChoice.Shuffle(); } if (x == 0) { TopDisplayNumber[y].text = NumberChoice[y].ToString(); } else { BottomDisplayNumber[y].text = NumberChoice[y].ToString(); } } } string Log6 = "Correct new sequence (after color strand rules): ", Log7 = ""; for (int x = 0; x < 9; x++) { switch (RepresentingLetters[x]) { case "G": switch (StrandColors[x]) { case 0: Answer.Add("C"); break; case 1: Answer.Add("G"); break; case 2: Answer.Add("T"); break; case 3: Answer.Add("A"); break; default: break; } break; case "C": switch (StrandColors[x]) { case 0: Answer.Add("G"); break; case 1: Answer.Add("C"); break; case 2: Answer.Add("A"); break; case 3: Answer.Add("T"); break; default: break; } break; case "A": switch (StrandColors[x]) { case 0: Answer.Add("T"); break; case 1: Answer.Add("A"); break; case 2: Answer.Add("C"); break; case 3: Answer.Add("G"); break; default: break; } break; case "T": switch (StrandColors[x]) { case 0: Answer.Add("A"); break; case 1: Answer.Add("T"); break; case 2: Answer.Add("G"); break; case 3: Answer.Add("C"); break; default: break; } break; default: break; } Log6 += Answer[x]; Log7 = Answer[x] + Log7; } Debug.LogFormat("[DNA Mutation #{0}] {1}", moduleId, Log6); if (TopDisplayNumber[0].text == BottomDisplayNumber[0].text) { Answer.Reverse(); Debug.LogFormat("[DNA Mutation #{0}] The sequence numbers do not differ. The actual sequence is {1}", moduleId, Log7); } }
private void FindVolume() { DecisionList.Add(new Formulas(cube.FindVolumes(Given))); Answer.Add(answer.FindAnswerVolume(DecisionList, Find)); }
private void FindRib() { DecisionList.Add(new Formulas(cube.FindRibs(Given, Figure))); Answer.Add(answer.FindAnswerRib(DecisionList, Find)); }