[ Solved ] with code that change 1 letter
so i made this code
Code:
{ |
Re: Help with code that change 1 letter
|
Re: Help with code that change 1 letter
first 2 things ty i didnt know it but the last one so i need new meta cause it will just remove the same letter evry time and i want it to remove random words
|
Re: Help with code that change 1 letter
Quote:
|
Re: Help with code that change 1 letter
ok so i want to replace randomly letter every time the i will use this function means
the word hello could be one time _ello hell_ so if i will just loop it it will always be h_llo cause the first letter in the constant is E from the other letters sorry for my bad english and sorry it is hard to understand me and tank you for helping me |
Re: Help with code that change 1 letter
If the error only occurs in the replace funciton then it is likely because Rletter is not a valid string. Make it a valid string (dimension it as with 2 cells).
However, it would be better to completely eliminate Rletter and any formats. Simply use the Chars[random(sizeof(Chars))] in the containi() function (make sure that it is an array of strings and not characters; I can't tell if you have the correct structure or not based on the code that you have given). This still leaves the possibility of an infinite loop so you would want to put in a timeout. Alternatively, you can find a "only once random function" so that you will be able to know that you hit each letter at least once. This means your loop will have a maximum number of executions (you probably would use a for loop with a break in this case). |
Re: Help with code that change 1 letter
yeah i thought about what you said and i did it like this
Code:
new Num = random(sizeof(Chars)); |
Re: Help with code that change 1 letter
Quote:
|
Re: Help with code that change 1 letter
well this is the whole code and when its doing the function
Code:
public athegame( client )Code:
stock Reworkword( ) |
Re: Help with code that change 1 letter
First of all, that is not the whole code because I can't see how the Chars variable is created. Also, I can't tell if there are other issues created by your global variables. You should attache the whole .sma file to your next post to make it easier for people to help you.
|
| All times are GMT -4. The time now is 21:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.