private string GetStringResultEqualPosition(RowElements rowElements) { string result = ""; ColorElement cp; // Parameter ColorElement cs; // Secret for (int i = 0; i < rowElements.GetElements().Count; i++) { cp = rowElements.GetElements()[i]; // Parameter cs = _rowCodeSecret.GetElements()[i]; // Secret if (cp.Equals(cs)) { // Si hay coincidencia de posición. result += OK_POS; } } return(result); }
private void ValidateRowElements(RowElements rowElements) { if (rowElements.GetElements().Count != this.NumElementPerRow) { throw new ArgumentException("El objeto no tiene " + this.NumElementPerRow + " elementos."); } if (_listAttempts.Count == NumMaxAttempts) { throw new WarningException("La lista tiene el máximo de intentos (" + NumMaxAttempts + ")."); } }
private string GetStringResultDistinctPosition(RowElements rowElements) { string result = ""; ColorElement cp; // Parameter ColorElement cs; // Secret for (int i = 0; i < rowElements.GetElements().Count; i++) { for (int j = 0; j < _rowCodeSecret.GetElements().Count; j++) { if (i != j) { cs = _rowCodeSecret.GetElements()[i]; // Secret cp = rowElements.GetElements()[j]; // Parameter if (cs.Equals(cp)) { // Si hay coincidencia en otra posición posición. result += OK_OPOS; } } } } return(result); }