Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void MakeLabels()
- {
- word = GetRandomWord();
- char[] chars = word.ToCharArray();
- int between = 330 / chars.Length;
- for (int i = 0; i < chars.Length; i++)
- {
- labels.Add(new Label());
- labels[i].Location = new Point((i * between) + 10, 80);
- labels[i].Text = "_";
- labels[i].Parent = groupBox1;
- labels[i].BringToFront();
- labels[i].CreateControl();
- }
- }
- string word = "слово";
- string encryptWord = word[0] + (new string('_', word.Length - 1));
- private string HideCharacters(string word)
- {
- string res = word[0].ToString();
- for (int i = 1; i < word.Length; i++)
- res += " _";
- return res;
- }
- static string NewWord(string src)
- {
- return src[0] + new string(src.Skip(1).Select(x => '_').ToArray());
- }
- static string NewWord(string src)
- {
- return src[0] + Regex.Replace(src.Substring(1), ".", "_");
- }
- for (int i = 0; i < chars.Length; i++)
- {
- labels.Add(new Label());
- labels[i].Location = new Point((i * between) + 10, 80);
- if(i!=0)labels[i].Text = "_";
- labels[i].Parent = groupBox1;
- labels[i].BringToFront();
- labels[i].CreateControl();
- }
Add Comment
Please, Sign In to add comment