Hey I'm having trouble completing this program. I need to check the users letter guess when they hit the guess button.
Here's what I have so far:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace GuessAWord
{
public partial class Form1 : Form
{
int randomNumber;
Random ranNumberGenerator;
string ranWord;
string[] words;
const int MAXWORDS = 10;
public Form1()
{
words = new string[MAXWORDS];
ranNumberGenerator = new Random();
words[0] = "dog";
words[1] = "cat";
words[2] = "fish";
words[3] = "bird";
words[4] = "elephant";
words[5] = "tiger";
words[6] = "lion";
words[7] = "snake";
words[8] = "walrus";
words[9] = "owl";
InitializeComponent();
}
private void startButton_Click(object sender, EventArgs e)
{
randomNumber = ranNumberGenerator.Next(0, 10);
ranWord = words[randomNumber];
mysteryLabel.Text = "";
for (int i = 0; i < ranWord.Length; i++)
{
mysteryLabel.Text += "*";
}
feedbackLabel.Text = "";
guessButton.Enabled = true;
userTextbox.Select();
}
private void guessButton_Click(object sender, EventArgs e)
{
}
}
}