Program Script


Pasted by rko619 on Sunday, February 21, 2010 5:33 PM

Syntax:

											
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace War_Games 7 { 8 class Program 9 { 10 static void Main(string[] args) 11 { 12 // to access main program enter correct password. 13 Console.WriteLine("Logon:"); 14 string logon = Console.ReadLine(); 15 if (logon == ("qwerty")) 16 { 17 //if correct password, console asks if user wants to play a game 18 19 Console.WriteLine("Hello, welcome to War Games"); 20 Console.WriteLine("Would you like to play a game? yes or no?"); 21 string pg = Console.ReadLine(); 22 if (pg == ("yes")) 23 { 24 //asks the user which game they want to play 25 26 Console.WriteLine("Please pick a Game"); 27 Console.WriteLine("1)Tic-Tac-Toe"); 28 Console.WriteLine("Type the number of the game you wish to play (e.g. 1)"); 29 string GS = Console.ReadLine(); 30 if (GS ==("1")) 31 { 32 //calls the script for the TICTACTOE game 33 } 34 } 35 if (pg == ("no")) 36 { 37 Console.WriteLine("Googbye"); 38 } 39 40 else 41 { 42 //if correct password not entered 43 //program terminated 44 Console.WriteLine("Incorrect Password"); 45 Console.WriteLine("--CONNECTION TERMINATED--"); 46 47 48 Console.Clear(); 49 } 50 } 51 } 52 } 53 } 54