Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace BlackJack
- {
- class Program
- {
- static void Main(string[] args)
- {
- int dealersScore = 0, Current = 0, End=1, rand;
- string randomizedCard, Dealer, Choice;
- List<string> Bank = new List<string>()
- { "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A",
- };
- Random x = new Random();
- while (End == 1) {
- Choice = Console.ReadLine();
- if (Choice == "")
- {
- Current = x.Next(417);
- int playersScore = 0;
- int Player=0;
- if (Bank[Current] == "2")
- {
- playersScore += 2;
- Console.WriteLine("You earn 2. Now you have: ", playersScore.ToString());
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "3")
- {
- playersScore += 3;
- Console.WriteLine("You earn 3. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "4")
- {
- playersScore += 4;
- Console.WriteLine("You earn 4. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "5")
- {
- playersScore += 5;
- Console.WriteLine("You earn 5. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "6")
- {
- playersScore += 6;
- Console.WriteLine("You earn 6. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "7")
- {
- playersScore += 7;
- Console.WriteLine("You earn 7. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "8")
- {
- playersScore += 8;
- Console.WriteLine("You earn 8. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "9")
- {
- playersScore += 9;
- Console.WriteLine("You earn 9. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "10")
- {
- playersScore += 10;
- Console.WriteLine("You earn 10. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "J")
- {
- playersScore += 10;
- Console.WriteLine("You earn J. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "Q")
- {
- playersScore += 10;
- Console.WriteLine("You earn Q. Now you have: ");
- Player = playersScore + Player;
- Console.Write(Player);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "K")
- {
- playersScore += 10;
- Console.WriteLine("You earn K. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else if (Bank[Current] == "A")
- {
- if (playersScore + 11 > 21)
- {
- playersScore += 1;
- Console.WriteLine("You earn A. Now you have: ", playersScore, "(soft)");
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- else playersScore += 11;
- Console.WriteLine("You earn A. Now you have: ", playersScore);
- Console.WriteLine("Press 'Enter', if you want HIT, or enter any key for STAND");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement