Computer Science Canada scrambling words |
Author: | carrie [ Thu Nov 18, 2004 7:27 pm ] |
Post subject: | scrambling words |
i have a school project in school and i need ur help on some ideas on how to scramble up words randomly (basically something like a game) i have an idea but i'm just not sure it's ryt i think u have to store it as a temp var wat do u guys think?? ![]() ![]() ![]() ![]() |
Author: | zylum [ Thu Nov 18, 2004 8:55 pm ] |
Post subject: | |
you mean scramble the letters in a word or scramble words in a sentence? |
Author: | carrie [ Thu Nov 18, 2004 9:12 pm ] |
Post subject: | |
oh um scramble letters in a word |
Author: | carrie [ Thu Nov 18, 2004 9:27 pm ] |
Post subject: | |
please help me!! |
Author: | Mr. Glib [ Thu Nov 18, 2004 10:10 pm ] | ||
Post subject: | |||
carrie wrote: please help me!!
Carrie, it might be more helpful to us if we had a better understanding of the problem at hand. My interpretation of your dire straights is that you need some code to scramble a word. Does it matter how long the word is? Here's what I suggest you do... 1)have the user input the word to a string var 2)figure out the length of the string var using the length function 3)take apart the string var using substrings 4)at random put the individual characters back together to form a garbled word.
|
Author: | HyperFlexed [ Fri Nov 19, 2004 10:47 am ] | ||
Post subject: | |||
|
Author: | HyperFlexed [ Fri Nov 19, 2004 10:51 am ] | ||||
Post subject: | |||||
Mr. Glib wrote: carrie wrote: please help me!!
Carrie, it might be more helpful to us if we had a better understanding of the problem at hand. My interpretation of your dire straights is that you need some code to scramble a word. Does it matter how long the word is? Here's what I suggest you do... 1)have the user input the word to a string var 2)figure out the length of the string var using the length function 3)take apart the string var using substrings 4)at random put the individual characters back together to form a garbled word.
Why would you use the variable wordlength? why not go...
and better yet, put all your variables at the top. Just make your array flexible. |
Author: | carrie [ Fri Nov 19, 2004 4:07 pm ] |
Post subject: | |
oh sorry for not explaining clearly... ![]() ![]() ![]() well i have this school project and it's a game where i have to program a group of words scrambled and then the player needs to arrange the words wat i need help with is how to scramble them randomly and yup that's basically it...oh and also the get statement...how can u use font.draw for the input on the get statement...*i hope that makes sense* |
Author: | carrie [ Fri Nov 19, 2004 8:34 pm ] |
Post subject: | |
pleas someone help me??? |
Author: | zylum [ Fri Nov 19, 2004 10:34 pm ] | ||
Post subject: | |||
carrie wrote: oh um scramble letters in a word
i thought you said you needed the letters in the word to be scrambled... now you say you want to scrable a group of words? wtf? anyways, you basically do the same thing mr. glib did... put all the words in the array, loop through each element and give it a new random position...
|
Author: | HyperFlexed [ Sat Nov 20, 2004 2:07 am ] |
Post subject: | |
carrie wrote: oh sorry for not explaining clearly...
![]() ![]() ![]() well i have this school project and it's a game where i have to program a group of words scrambled and then the player needs to arrange the words wat i need help with is how to scramble them randomly and yup that's basically it...oh and also the get statement...how can u use font.draw for the input on the get statement...*i hope that makes sense* If you can't write this program by yourself, then I think that Font.Draw is the last thing you should be thinking about. Basics first. Fancy later. |
Author: | Mr. Glib [ Sat Nov 20, 2004 4:37 pm ] | ||
Post subject: | |||
HyperFlexed wrote: Why would you use the variable wordlength? why not go...
and better yet, put all your variables at the top. Just make your array flexible. Because I like more variables! ![]() ![]() |