Posted: Mon Dec 13, 2004 2:08 pm Post subject: 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 "" for a big smilie, a "" 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:
code:
: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
code:
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]
Sponsor Sponsor
beard0
Posted: Mon Dec 13, 2004 2:28 pm Post subject: (No subject)
Here you go:
code:
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
Posted: Tue Dec 14, 2004 12:01 pm Post subject: (No subject)