Announcement (2017-05-07): www.ruby-forum.com is now read-only since I
unfortunately do not have the time to support and maintain the forum any
more. Please see rubyonrails.org/community and ruby-lang.org/en/community
for other Rails- und Ruby-related community platforms.

Hi! I'm trying to write a program that will print out a different
string each time it's run from a list of strings.
For example:
example = ['one', 'two', 'three']
# sort them somehow
# 'two' prints out as the output, for example
# run it again and a different string prints out
Make sense? I've tried srand & rand but can't do this with strings. Do
I need to forget the arrays and try something else? I've looked at the
Pickaxe book and Ruby Cookbook but can't find anything. Thanks!

On 2/11/07, Stefan Rusterholz <apeiros@gmx.net> wrote:
> Another example would be:> --> Posted via http://www.ruby-forum.com/.>> This is not really what you want to do but I cannot post more for now,
this is a Ruby Quiz Spoiler!!!
Robert

Robert Dober wrote:
> On 2/11/07, Stefan Rusterholz <apeiros@gmx.net> wrote:>> Another example would be:>> -->> Posted via http://www.ruby-forum.com/.>>>> This is not really what you want to do but I cannot post more for now,> this is a Ruby Quiz Spoiler!!!> Robert
I apologize. I didn't read the current quiz.
Does that mean I have to check back with the current quiz when somebody
asks for help in here?
my regards

On 2/11/07, Stefan Rusterholz <apeiros@gmx.net> wrote:
>> I apologize. I didn't read the current quiz.> Does that mean I have to check back with the current quiz when somebody> asks for help in here?>> my regards>> --> Posted via http://www.ruby-forum.com/.
No I do not think so, no need to apologize either ;)
Well James is the "boss" of the quiz, but the ML and the Quiz are two
distinct matters.
I personally chose to try to avoid to post any material too much related
to
the Quiz and furthermore I point it out to others who might not be
interested in the Quiz.
Quizzes can be spoiled by posts of course, I redrew a quiz once because
the
issue was discussed three days before its due date, actually I think it
was
a good thing because after the discussion I did not think my Quiz was
very
brilliant any more:). James was just great he had another quiz to come
up
with immediately.
AFAIAC your reply has been very thoughtful, do not worry!
Cheers
Robert
P.S. Quiz Advocacy, checking the quiz is a good idea anyway :)))
R.

On 2/11/07, Robert Dober <robert.dober@gmail.com> wrote:
> > >> > that will print all in random order> >> > my regards> >> > --> > Posted via http://www.ruby-forum.com/.> >> > This is not really what you want to do but I cannot post more for now,> this is a Ruby Quiz Spoiler!!!> Robert
Ok time to clarify.
#sort_by{ rand } is fine, it is my head that is broken, so it is time
for
me to apologize
#sort{ rand } of course is not, but I'll get new reading glasses soon.
Robert
--

On Feb 11, 2007, at 6:59 AM, Robert Dober wrote:
> I personally chose to try to avoid to post any material too much> related to> the Quiz and furthermore I point it out to others who might not be> interested in the Quiz.
Overlap happens. No big deal. It just means I chose well for the
quiz topic and it will be helpful in the future. ;)
James Edward Gray II