예제 #1
0
 private void SeleccionaSiguienteTest()
 {
     var lt1  = GetAnyButThis(this.PreguntaActual);
     var lt2 = GetAnyButThis(this.PreguntaActual);
     var lt3 = this.PreguntaActual;
     //set them randomly
     var all = new List<Letra>();
     all.Add(lt1);
     all.Add(lt2);
     all.Add(lt3);
     //assign them
     Letra1 = all[rnd.Next(0, 3)];
     all.Remove(Letra1);
     Letra2 = all[rnd.Next(0, 2)];
     all.Remove(Letra2);
     Letra3 = all.First();
     all.Clear();
 }
예제 #2
0
 private Letra GetAnyButThis(Letra letra)
 {
     Letra lt2 = null;
     while (lt2 == null || lt2 == letra)
     {
         int idx1 = rnd.Next(0, Preguntas.Count - 1);
         lt2 = Preguntas[idx1];
     }
     return lt2;
 }