public void ShowHand() { DealCards dealcard = new DealCards(); dealcard.Deal(); ImageCard1.Source = new BitmapImage(new Uri(dealcard.ImageUrl1, UriKind.RelativeOrAbsolute)); ImageCard2.Source = new BitmapImage(new Uri(dealcard.ImageUrl2, UriKind.RelativeOrAbsolute)); ImageCard3.Source = new BitmapImage(new Uri(dealcard.ImageUrl3, UriKind.RelativeOrAbsolute)); ImageCard4.Source = new BitmapImage(new Uri(dealcard.ImageUrl4, UriKind.RelativeOrAbsolute)); ImageCard5.Source = new BitmapImage(new Uri(dealcard.ImageUrl5, UriKind.RelativeOrAbsolute)); }
static void Main(string[] args) { //no need to instantiate any other classes because deal cards inherits from deck which inherits from card // and drawCard is Static so no need to instantiate Console.BackgroundColor = ConsoleColor.Gray; Console.SetWindowSize(65, 40); //Remove scroll bars by setting the buffer to the actual window size Console.BufferWidth = 65; Console.BufferHeight = 40; Console.Title = "Poker Game"; DealCards d = new DealCards(); bool quit = false; while (!quit) { d.Deal(); char selection = ' '; while (!selection.Equals('Y') && (!selection.Equals('N'))) { Console.WriteLine("Play again? Y or N"); selection = Convert.ToChar(Console.ReadLine().ToUpper()); if (selection == 'Y') { quit = false; } else if (selection == 'N') { quit = true; } else { Console.WriteLine("Invalid Selection. Try Again"); } } } Console.ReadKey(); }
static void Main(string[] args) { Console.BackgroundColor = ConsoleColor.White; Console.SetWindowSize(65, 50); //Remove scroll bars by setting buffer to window size Console.BufferWidth = 65; Console.BufferHeight = 50; Console.Title = "Nathaniel's 1v1 Poker Simulator"; DealCards dc = new DealCards(); bool Quit = false; while (!Quit) { dc.Deal(); int x = 0; int y = 0; Console.SetCursorPosition(x, y); char selection = ' '; while (!selection.Equals('Y') && !selection.Equals('N')) { Console.SetCursorPosition(0, 48); Console.WriteLine("Play again? (Y)es or (N)o"); selection = Convert.ToChar(Console.ReadLine().ToUpper()); if (selection.Equals('Y')) { Quit = false; } else if (selection.Equals('N')) { Quit = true; } else { Console.WriteLine("Invalid input, try again."); } } } }
static void Main(string[] args) { Console.SetWindowSize(65, 40); Console.BackgroundColor = ConsoleColor.Gray; //remove scroll bars (buffer-a se naglasq s razmerite na prozoreca na konzolata Console.BufferWidth = 65; Console.BufferHeight = 40; Console.Title = "Poker Game"; DealCards game = new DealCards(); bool quit = false; while (!quit) { game.Deal(); char selection = ' '; while (!selection.Equals('Y') && !selection.Equals('N')) { Console.SetCursorPosition(0, 27); Console.WriteLine("Play Again? Y/N"); selection = char.Parse(Console.ReadLine().ToUpper()); if (selection == 'N') { quit = true; } else if (selection == 'Y') { quit = false; } else { Console.WriteLine("Invalid selection. Try again."); } } } }
static void Main(string[] args) { DealCards dc = new DealCards(); dc.Deal(); }