Guest User

Untitled

a guest
Jan 23rd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. public void MakeLabels()
  2. {
  3. word = GetRandomWord();
  4. char[] chars = word.ToCharArray();
  5. int between = 330 / chars.Length;
  6. for (int i = 0; i < chars.Length; i++)
  7. {
  8. labels.Add(new Label());
  9. labels[i].Location = new Point((i * between) + 10, 80);
  10. labels[i].Text = "_";
  11. labels[i].Parent = groupBox1;
  12. labels[i].BringToFront();
  13. labels[i].CreateControl();
  14. }
  15. }
  16.  
  17. static string NewWord(string src)
  18. {
  19. return src[0] + new string(src.Skip(1).Select(x => '_').ToArray());
  20. }
  21.  
  22. static string NewWord(string src)
  23. {
  24. return src[0] + Regex.Replace(src.Substring(1), ".", "_");
  25. }
  26.  
  27. string word = "слово";
  28. string encryptWord = word[0] + (new string('_', word.Length - 1));
  29.  
  30. private string HideCharacters(string word)
  31. {
  32. string res = word[0].ToString();
  33. for (int i = 1; i < word.Length; i++)
  34. res += " _";
  35. return res;
  36. }
  37.  
  38. for (int i = 0; i < chars.Length; i++)
  39. {
  40. labels.Add(new Label());
  41. labels[i].Location = new Point((i * between) + 10, 80);
  42. if(i!=0)labels[i].Text = "_";
  43. labels[i].Parent = groupBox1;
  44. labels[i].BringToFront();
  45. labels[i].CreateControl();
  46. }
  47.  
  48. public void MakeLabels()
  49. { word = GetRandomWord();
  50. char[] chars = word.ToCharArray();
  51. int between = 330 / chars.Length;
  52. labels.Add(new Label());
  53. labels[0].Location = new Point((0* between) + 10, 80);
  54. labels[0].Text = chars[0].ToString();
  55. labels[0].Parent = groupBox1;
  56. labels[0].BringToFront();
  57. labels[0].CreateControl();
  58. for (int i = 1; i < chars.Length; i++)
  59. {
  60. labels.Add(new Label());
  61. labels[i].Location = new Point((i * between) + 10, 80);
  62. labels[i].Text = "_";
  63. labels[i].Parent = groupBox1;
  64. labels[i].BringToFront();
  65. labels[i].CreateControl();
  66. }
  67. }
Add Comment
Please, Sign In to add comment