using System;
public class Program
{
public static void Main()
{
try
{
bool win = false;
bool IsANumber = true;
string UserWord;
do
{
do
{
Console.WriteLine("Please enter a word: ");
UserWord = Console.ReadLine();
IsANumber = int.TryParse(UserWord, out _);
if (IsANumber == true)
{
Console.WriteLine("It Cannot be a number");
}
} while (IsANumber == true);
if (UserWord == ReverseWord(UserWord))
{
Console.WriteLine("Congrats!");
win = true;
}
else
{
Console.WriteLine("Not the type of word that I am looking for ");
}
} while (win == false);
Console.WriteLine("Thanks for playing");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
public static string ReverseWord(string word)
{
char[] charArray = word.ToCharArray();
Array.Reverse(charArray);
return new string(charArray);
}
}
Word Reverse Game Incomplete Draft