Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace COMP60Assignment2
  12. {
  13. public partial class Form1 : Form
  14. {
  15. // Skyler Berry
  16. // Code to play Hangman
  17.  
  18. List<string> words = new List<string>();
  19. int wrongGuess;
  20. int gamesWon = 0;
  21. int gamesLost = 0;
  22. string guess;
  23. Random rand = new Random();
  24.  
  25.  
  26.  
  27.  
  28. public Form1()
  29. {
  30. InitializeComponent();
  31. words.Add("Elite");
  32. words.Add("Looking");
  33. words.Add("Highway");
  34. words.Add("Trilogy");
  35. words.Add("Coping");
  36. }
  37.  
  38. private void label1_Click(object sender, EventArgs e)
  39. {
  40.  
  41. }
  42.  
  43. private void Guesses_Click(object sender, EventArgs e)
  44. {
  45.  
  46. }
  47.  
  48. private void newGame_Click(object sender, EventArgs e)
  49. {
  50. wrongGuess = 0;
  51. textBoxWord.Clear();
  52. textBoxGuesses.Clear();
  53. int rand2 = rand.Next(words.Count);
  54. guess = words[rand2];
  55. char[] lines;
  56. lines = new char[words.Count];
  57. for(int ctr = 0; ctr < words.Count; ctr++)
  58. {
  59. lines[ctr] = '-';
  60. }
  61.  
  62. }
  63.  
  64. private void textBoxWord_TextChanged(object sender, EventArgs e)
  65. {
  66.  
  67. }
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement