---
title: "How to create a small game program in C# console application ?"  
description: "How to create a small game program in C# console application ?"  
author: "Gurmeet Kaur"  
published: 2018-09-06  
updated: 2018-09-06  
canonical: https://answers.mindstick.com/qa/49661/how-to-create-a-small-game-program-in-c-sharp-console-application  
category: "programming"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# How to create a small game program in C# console application ?

## Answers

### Answer by Sanat Shukla

![How to create a small game program in C# console application ?](https://answers.mindstick.com/QuestionAnswer/509d3cdb-e2cd-4c17-9288-0813bbce9391/images/edb5ad0c-ac4d-4807-ad14-70814b8d03a1.png)

![How to create a small game program in C# console application ?](https://answers.mindstick.com/QuestionAnswer/509d3cdb-e2cd-4c17-9288-0813bbce9391/images/2331fa7f-5839-4326-a986-0bcfd7e72fb3.png)

```
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;
namespace ConsoleApplication3{    class Program    {        static void Main(string[] args)        {            Console.WriteLine("Welcome to Hangman!!!!!!!!!!");            string[] listwords = new string[10];            listwords[0] = "sheep";            listwords[1] = "goat";            listwords[2] = "computer";            listwords[3] = "america";            listwords[4] = "watermelon";            listwords[5] = "icecream";            listwords[6] = "jasmine";
            listwords[7] = "pineapple";            listwords[8] = "orange";            listwords[9] = "mango";            Random randGen = new Random();            var idx = randGen.Next(0, 9);            string mysteryWord = listwords[idx];            char[] guess = new char[mysteryWord.Length];            Console.Write("Please enter your guess: ");            for (int p = 0; p < mysteryWord.Length; p++)                guess[p] = '*';
            while (true)            {                char playerGuess = char.Parse(Console.ReadLine());                for (int j = 0; j < mysteryWord.Length; j++)                {                    if (playerGuess == mysteryWord[j])                        guess[j] = playerGuess;                }
                Console.WriteLine(guess);
            }
        }    }
}
```


---

Original Source: https://answers.mindstick.com/qa/49661/how-to-create-a-small-game-program-in-c-sharp-console-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
