Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace COMP60Assignment2
- {
- public partial class Form1 : Form
- {
- // Skyler Berry
- // Code to play Hangman
- List<string> words = new List<string>();
- int wrongGuess;
- int gamesWon = 0;
- int gamesLost = 0;
- string guess;
- Random rand = new Random();
- public Form1()
- {
- InitializeComponent();
- words.Add("Elite");
- words.Add("Looking");
- words.Add("Highway");
- words.Add("Trilogy");
- words.Add("Coping");
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- private void Guesses_Click(object sender, EventArgs e)
- {
- }
- private void newGame_Click(object sender, EventArgs e)
- {
- wrongGuess = 0;
- textBoxWord.Clear();
- textBoxGuesses.Clear();
- int rand2 = rand.Next(words.Count);
- guess = words[rand2];
- char[] lines;
- lines = new char[words.Count];
- for(int ctr = 0; ctr < words.Count; ctr++)
- {
- lines[ctr] = '-';
- }
- }
- private void textBoxWord_TextChanged(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement