Like HangMan Game...
How to create a small game in C#(console base) ?
1683
10-Oct-2018
Anonymous User
17-Oct-2018WaaW, it's a nice program.
Anonymous User
10-Oct-2018OR
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication18 { class Program { static void Main(string[] args) { Console.WriteLine(" **** Welcome to Hangman **** "); string[] listwords = { "cow", "mango", "sanat", "india", "aditya", "arti", "harsh", "bachchalal", "mindstick", "shukla" }; Random rndmGen = new Random(); var id_x = rndmGen.Next(0, 9); string mysecretWord = listwords[id_x]; char[] guess = new char[mysecretWord.Length]; Console.Write("\tPlease Enter your guess(word): "); for (int z = 0; z < mysecretWord.Length; z++) guess[z] = '*'; while (true) { string playerGuess = Convert.ToString(Console.ReadLine()); char[] guessWordsArray = playerGuess.ToCharArray(); if (guessWordsArray.Count() > 0) { char guessWord = guessWordsArray[0]; for (int j = 0; j < mysecretWord.Length; j++) { if (guessWord == mysecretWord[j]) guess[j] = guessWord; } Console.WriteLine(guess); } else { Environment.Exit(0); } } } } }