THIS Is Documentation For Hangman
THIS Is Documentation For Hangman
EDUV4935339
Table of Contents
1-A description of the program.............................................................................................................2
2 -Instructions on which operating system to use................................................................................3
3-The type and version of programs used............................................................................................5
4 -How to install and set up the program.............................................................................................6
5-A method to run the program...........................................................................................................9
6-The values to enter when asked for user input...............................................................................10
7-Ways to handle any error messages................................................................................................11
8-Screenshots of all operations..........................................................................................................13
9-Source Codes....................................................................................................................................14
10-Bibliography...................................................................................................................................26
1-A description of the
program
-The program is a console-based Hangman game written in
C#. The game chooses a random word from a prepared list,
and the player attempts to guess it by typing one letter at a
time. The player has a limited number of chances to guess
the word properly. This code implements the Hangman game
in a simple yet useful manner, with features for starting a new
game, making guesses, and handling win/lose scenarios.
2 -Instructions on which
operating system to use.
Instructions for Visual Studio 2022 on Windows
Open Visual Studio 2022:
Solution:
Problem:
Solution:
Problem:
-If you plan to add features that involve file operations (e.g.,
saving scores), file access errors may occur.
Solution:
- INCORECT guess
- Invalid in puts
9-Source Codes
Code in writing:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Hangman_project_1
{
internal class Program
{
static string[] words = { "HELP", "TOUGH",
"PROGRAMMING", "MYLMS", "LEMONADE" }; //Words: An
array of possible words for the game
static Random random = new Random(); //Random: An
instance of the Random class to select a random word
static string wordToGuess; //Word to guess: The
word that the player needs to guess
static char[] currentWordState; //Current word state: An
array representing the current state of the guessed word
static HashSet<char> correctGuesses; //Correct guesses:
A set of correctly guessed letters
static HashSet<char> incorrectGuesses; //Incorrect
guesses: A set of incorrectly guessed letters
static int remainingAttempts; //Ramaining attempts:
The number of attempts left for the player
// Make a guess
Console.Write("Enter your guess (or 'quit' to exit,
'new' for new game): ");
string input = Console.ReadLine().Trim().ToUpper();
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
}
10-Bibliography
- https://www.geeksforgeeks.org/c-sharp-
programming-language/
- https://docs.microsoft.com/en-us/visualstudio/get-
started/
-
https://docs.microsoft.com/en-us/dotnet/csharp/progr
amming-guide/
-https://eduvosonline.sharepoint.com/:f:/r/sites/
ITECA0-M00BasicCProgramming/Shared
%20Documents/General/Demo%202?
csf=1&web=1&e=88Xn4c