private bool Valid2(PEntry entry) { bool p1 = CharInPos(entry.Character, entry.LowRange - 1, entry.Password); bool p2 = CharInPos(entry.Character, entry.HighRange - 1, entry.Password); return(p1 ^ p2); }
private PEntry ParsePEntry(string line) { Parser p = new Parser(line); PEntry entry = new PEntry(); entry.LowRange = p.GetNumber(); p.Burn(); entry.HighRange = p.GetNumber(); entry.Character = p.GetIdent()[0]; p.Burn(); entry.Password = p.GetIdent(); return(entry); }
private bool Valid(PEntry entry) { int num = entry.Password.Count((c) => c == entry.Character); return(num >= entry.LowRange && num <= entry.HighRange); }