Beispiel #1
0
 public int ComareTo(StringGuesser obj)
 {
     if (obj.GetType() != this.GetType())
     {
         throw new ArgumentException("Object is not a stringthingy");
     }
     return(this.Fitness - obj.Fitness);
 }
Beispiel #2
0
 public int CompareTo(object obj)
 {
     if (obj is StringGuesser)
     {
         StringGuesser objConverted = (StringGuesser)obj;
         if (objConverted.Fitness > this.Fitness)
         {
             return(1);
         }
         return(0);
     }
     throw new ArgumentException("Object is not a stringthingy");
 }
Beispiel #3
0
 private void b_test_Click(object sender, EventArgs e)
 {
     //should this be a timer or should it just fire as soon as enough time has elapsed?
     //TODO: if performance suffers switch this to a standard for list.
     MessageBox.Show(StringGuesser.RandomString(10) + "    " + TB1_str_in.Text);
 }