same name for all labels?

Status
Not open for further replies.

Pavle

Well-known member
Joined
Oct 4, 2016
Messages
47
Programming Experience
1-3
I am trying to make game that you have 12 random letters and with them you should make longest possible word that exist in ditionary.I want to loop through all labels and every time button is clicked each label separatly stops generating letters,when 12 label stops generating letters timer should stop.How to give same name for all labels?
 
[FONT=&quot]I shuffled word like this: string shuffled_word = new string(word.OrderBy(r => random.Next()).ToArray());[/FONT]
[FONT=&quot]But I don't know how to every time I click button show letter of word on other label?[/FONT]
 
[FONT=&quot]I made every time I click button to show word letter on each label.But this only works with word that has lenght 12,for words that have lenght 10 and 11 program crashes.What should I do?[/FONT]
[FONT=&quot]If word lenght is 10 it should generate 2 random letters and place it somewhere in word,if word lenght is 11 it should generate 1 random letter and place it somewhere in word!!![/FONT]

[FONT=&quot]Here is my code: [/FONT]http://pastebin.com/psqqMaeh
 
[FONT="]I made every time I click button to show word letter on each label.But this only works with word that has lenght 12,for words that have lenght 10 and 11 program crashes.What should I do?[/FONT


If it only works for length 12 then you must be hard-coding that length somewhere. Don't. Use the length of the actual word.
 
I have fixed problem.How to make that when user enter word using given random letters from labels in textbox,user cannot enter letter that does not exist in given letters!!!
 
I have fixed problem.How to make that when user enter word using given random letters from labels in textbox,user cannot enter letter that does not exist in given letters!!!

Please don't keep asking question after question on different topics in the same thread. Look at the title of your thread and ask yourself whether the latest question has anything to do with that topic. If you have a new question on a new topic then please start a new thread with a title that reflects that topic. Thread closed.
 
Status
Not open for further replies.
Back
Top Bottom