public Naipe Extraer() { Random rnd = new Random(); int posicionAExtraer = rnd.Next(_baraja.Count); Naipe tmp = _baraja[posicionAExtraer]; _baraja.RemoveAt(posicionAExtraer); return(tmp); }
static void Main(string[] args) { Baraja b1 = new Baraja(); Naipe extraido = null; b1.VerBaraja(); Console.WriteLine("".PadRight(40, '-')); extraido = b1.Extraer(); b1.VerBaraja(); Console.WriteLine(extraido.Info()); Console.WriteLine(" DATOS DE LA CARTA "); Console.WriteLine("-----------------------------------------"); foreach (string tmp in extraido.Formatear()) { Console.WriteLine(tmp); } Console.ReadLine(); }