Ruby newcomer

Hi all!

I’m totally new to ruby (and don’t have much experience with
programming at all) and need to implement a program (for school) which
shows a solution for the nQueensProblem. It should be able to show the
solutions even if the “chessboard” is bigger than 8x8!
Can anyone give me some ideas how to get this program done quickly?

best regards Bernhard

On Dec 7, 2005, at 10:27 AM, BAT wrote:

Can anyone give me some ideas how to get this program done quickly?

What part are you having trouble with? Dive right in and then just
post questions here as you have them. If you back yourself into a
corner, we’ll get you out. :wink:

James Edward G. II

BAT wrote:

Firstly you gain ten points for being honest and telling us that you are
asking us to do your school work.

However you loose all these points and more for not using that
indispensable programming tool…

GOOGLE

Try “n queens problem” and just remember than unless your teacher is a
complete idiot they will have done this too.

On Thu, Dec 08, 2005 at 01:27:35AM +0900, BAT wrote:

Can anyone give me some ideas how to get this program done quickly?

Asking a mailing list to do your homework for you is poor form. I
suggest you google “n queens problem” and you’ll find many good
resources.

When you have a Ruby-specific question, we’ll be glad to help.

regards,
Ed

As others have said, use Google or whatever materials your teacher has
provided to get the basic algorithm for solving the problem. Then code
that algorithm in Ruby. If you look at some of the quizzes and
solutions on rubyquiz.com, you will quickly see that even simple
problems can be solved in many different ways in Ruby. It is a very
flexible language, which is why so many of us enjoy it so much.

Ryan

The N Queens Problem.

I’m sorry if you felt like i’m trying to get the code from you! That
wasn’t the thing i was asking for!! I use to do my homework myself. I
just wanted to know which is the best way to start solving the problem
as a person without knowledge in programming.

anyway, thanks for your quick replies

Well, it won’t help you with your homework, but if you’re looking for
an introduction to Ruby aimed at those with no previous experience, I
wrote this:

Learn to Program, by Chris Pine

Let me know if you get stuck or anything.

:slight_smile:

Chris

Have a look at the Ruby Q. site.

Chess Variants Quiz. Might give you some ideas.

http://rubyquiz.com/quiz35.html
http://rubyquiz.com/quiz36.html