
-----------------------------------
Flashkicks
Mon Dec 13, 2004 2:08 pm

Randomizing Strings
-----------------------------------
Hay guys!  This is a really dumb question but I need your help with randomizing string's and to put whatever it is on screen.  Lemme explain more :? ..lol..  I have a variable called 'face' and I want it to store certain images in string format (or WHATEVER format would be best..)  The images are what you would type in on MSN Messenger..  you know..  A ":D" for a big smilie, a ":P" for a smilie but with his tongue sticking out, a ":S" for the confused guy..  basically I wantthe program to randome like 100's of these and draw them.  Eventually once I get that they're going to be drawn to a file.  but for now all I need is for it to look like this:

:P :D :S :P :P :P :D :S

Here is what I have for starting- I know it isnt much but already Im getting angry!!..lol..  Delta and I did this once long ago but I forgot everything..
~Flashkicks
var face : array 1 .. 5 of string
for i : 1 .. 5
    randint (face (i), ":P", ":D")
    put face (i), " " ..
end for

PS:  This coding I have doesnt even werk yet:([/code]

-----------------------------------
beard0
Mon Dec 13, 2004 2:28 pm


-----------------------------------
Here you go:
const faceArray : array 1 .. 3 of string := init (":P", ":S", ":D")
var faces : string := ""
for i : 1 .. 80
    if faces not= "" then
        faces += " "
    end if
    faces += faceArray (Rand.Int (1, 3))
end for
put faces

-----------------------------------
Flashkicks
Tue Dec 14, 2004 12:01 pm


-----------------------------------
Wow, thank you so much beard0- it werks Swell!!
