Puzzle of the week

This is a discussion on Puzzle of the week within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I found this in an algebra II book. They have a puzzle at the end of every chapter. If I ...

Puzzle of the week

I found this in an algebra II book. They have a puzzle at the end of every chapter. If I can remember I will try and post one a week until I run out. I don't think this one is too hard at all. Took me about 5 minutes.

Five friends, Luis, Bill, Jan, Omar, and Judy, are sitting in one row of seats. Neither Luis nor Bill is sitting next to Omar. Neither Luis nor Bill is sitting next to Jan. Neither Omar nor Bill is sitting next to Judy. Judy is sitting just to the right of Jan.

Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

why not make this a little more challenging? write a program that will solve the problem with a specified number of objects and a set of rules. in this example, the people were the objects and the rules were things like, A left of B, A not beside C, etc...

why not make this a little more challenging? write a program that will solve the problem with a specified number of objects and a set of rules. in this example, the people were the objects and the rules were things like, A left of B, A not beside C, etc...

hint: look up "Constraint propogation" a very usefull tool in AI.

Or, a simpler method would be to write a bunch of facts in prolog, and write a goal to find the answer.