Game Maker Games, Articles, Tutorials & More

Game Maker Network


Howdy, Guest! Please sign in or register an account.

Print

random_letter

By Daniel · December 24, 2008

Returns a randomly-chosen consonant or vowel

// random_letter(type)
// type: 0 = consonant, 1 = vowel

var selection;

if argument0 then selection = "aeiou";
else selection = "bcdfghjklmnpqrstvwxyz";

return string_char_at(selection,ceil(random(string_length(selection))));

Categories: String handling

Comments

There are no comments to display.

Post a Comment

You must be signed in to post comments.

Advertisement