Re: get random char from array

2013-02-02 Thread SaltySugar
On Saturday, 2 February 2013 at 09:59:07 UTC, bearophile wrote: SaltySugar: My code: In Phobos there isn't something like random.choice() of Python. This code doesn't work with truly Unicode strings (better to use a dstring or dchar[] for that, unless you want to walk the string every time

Re: get random char from array

2013-02-02 Thread bearophile
SaltySugar: My code: In Phobos there isn't something like random.choice() of Python. This code doesn't work with truly Unicode strings (better to use a dstring or dchar[] for that, unless you want to walk the string every time you want to extract a random item): import std.stdio, std.ran