kalabasa Posted September 3, 2022 Group: Members Topic Count: 123 Topics Per Day: 0.04 Content Count: 478 Reputation: 14 Joined: 11/30/17 Last Seen: January 23 Share Posted September 3, 2022 if ( abcde < 4 ) abcde++; for ( .@i = 0; .@i < abcde; .@i++ ) .@form$ = .@form$ + .word$[.@i] +" "; for ( .@i = abcde; .@i < 4; .@i++ ) .@form$ = .@form$ +"_ "; message strcharinfo(0), "Letter's Collected : "+ .@form$; instead of collecting chronologically at random % how to change it to obtain the letters randomly PS: i dont know what to put into the tittle . to the moderators kindly edit it thanks! Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted September 3, 2022 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2372 Joined: 10/28/11 Last Seen: 4 hours ago Share Posted September 3, 2022 you could try something like this. initialize all the character as specific character, then search and replace them randomly. if (abcde$ == "") abcde$ = "____"; // initialize with a dummy character if (compare(abcde$, "_")) { .@length = getstrlen(abcde$); do { .@index = rand(.@length); } while (charat(abcde$, .@index) != "_")); // search for it setchar(abcde$, .word$[.@index], .@index); // replace it } message strcharinfo(0), "Letter's Collected : "+ abcde$; Quote Link to comment Share on other sites More sharing options...
0 kalabasa Posted September 4, 2022 Group: Members Topic Count: 123 Topics Per Day: 0.04 Content Count: 478 Reputation: 14 Joined: 11/30/17 Last Seen: January 23 Author Share Posted September 4, 2022 its working but it wont let me show the letters that i obtained it will show only Letter's Collected: _____ Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted October 15, 2022 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2372 Joined: 10/28/11 Last Seen: 4 hours ago Share Posted October 15, 2022 (edited) if (abcde$ == "") abcde$ = "____"; // initialize with a dummy character if (compare(abcde$, "_")) { .@length = getstrlen(abcde$); do { .@index = rand(.@length); } while (charat(abcde$, .@index) != "_"); // search for it abcde$ = setchar(abcde$, .word$[.@index], .@index); // replace it } message strcharinfo(0), "Letter's Collected : "+ abcde$; end; Edited October 15, 2022 by Emistry Quote Link to comment Share on other sites More sharing options...
0 kalabasa Posted November 3, 2022 Group: Members Topic Count: 123 Topics Per Day: 0.04 Content Count: 478 Reputation: 14 Joined: 11/30/17 Last Seen: January 23 Author Share Posted November 3, 2022 i did try to add more letters on it. but it can only display up to 4 letters. i still cant find where did i got the script for the source. Quote Link to comment Share on other sites More sharing options...
Question
kalabasa
instead of collecting chronologically at random % how to change it to obtain the letters randomly
PS: i dont know what to put into the tittle . to the moderators kindly edit it thanks!
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.