private int GetLastWireIndexOfColor(wireColor color) { for (int i = wires.Count - 1; i >= 0; --i) { if (wires[i] == color) { return(i); } } return(-1); }
private int GetNumberOfWiresOfColor(wireColor color) { int numColorWires = 0; foreach (wireColor wire in wires) { if (wire == color) { numColorWires++; } } return(numColorWires); }
public String GetSolution(int seq, wireColor color) { if (color == wireColor.Red) { return(redSeq[seq - 1]); } else if (color == wireColor.Blue) { return(blueSeq[seq - 1]); } else if (color == wireColor.Black) { return(blackSeq[seq - 1]); } else { return(""); } }
public void UpdateWire(int wireIndex, wireColor color) { wires[wireIndex] = color; CalculateSolution(); }