[chbot] Choc fish challenege 3

Synco Reynders synco.reynders at gmail.com
Wed Aug 31 01:46:30 BST 2011


Hi All,
  Now I'm willing to put up a chocolate fish for the person who can tell how
many solutions there are for the largest n.
I include all rotations / mirrored results. So for example:
For n=4 there are 2 solutions
For n=5 there are 10 solutions
For n=6 there are 4 solutions
For n=7 there are 40 solutions
...
For n=10 there are 724 solutions
...
Good-luck,
/s


On 31 August 2011 11:47, Hanno Sander <hanno at mydancebot.com> wrote:

> Super-sized fish please!
> See attached for a Propeller program that uses all 8 cogs to solve the
> queen's problem.
> Hanno
>
>
>
> On Wed, Aug 31, 2011 at 10:04 AM, Hanno Sander <hanno at mydancebot.com>wrote:
>
>> I'm tempted by your "super-sized choc fish" :)
>> Here's what I'm thinking:
>>
>> The only part of the queens problem that lends itself to parallel
>> programming is checking to see if a solution is valid.  We can use up to 7
>> "cogs"- slang for one of the Propeller's eight 32-bit processors- to
>> validate a queen's position.  The first queen placed doesn't need to be
>> validated. Each of these cogs waits until a start signal and then checks if
>> its queen is not in danger from the other 7 queens- by looking for
>> row/column/diagonal attacks.  Once finished, it sets a stop signal and
>> indicates its result.
>>
>> The eight cog generates test patterns, indicates the start condition,
>> waits for all cogs to finish, and stops when a valid pattern is found.
>>
>> Want some code?
>> Hanno
>>
>>
>> On Wed, Aug 31, 2011 at 9:36 AM, Charles Manning <manningc2 at actrix.gen.nz
>> > wrote:
>>
>>> Three examples so far, all of which are obfuscated.
>>>
>>> Why  don't want people to understand their code?
>>>
>>> On Tuesday 30 August 2011 13:52:46 Charles Manning wrote:
>>> > Synco. Since we're making deals, I'll lick half the choc off the fish
>>> if
>>> > your solution doesn't work all the time.
>>> >
>>> > Here's an extra challenge to Propeller fans. A super-sized choc fish
>>> for
>>> > any solution that exploits multi-cores.
>>> >
>>> > On Tuesday 30 August 2011 10:15:12 Synco Reynders wrote:
>>> > > You realise asking for an explanation of how it works would cost
>>> atleast
>>> > > one chocolate fish. :-)
>>> > > /s
>>> > >
>>> > > On 30 August 2011 09:59, Charles Manning <manningc2 at actrix.gen.nz>
>>> wrote:
>>> > > > On Thursday 25 August 2011 13:48:40 Charles Manning wrote:
>>> > > > > The last set of choc fish were handed out without ceremony at the
>>> > > > > last meeting.
>>> > > > >
>>> > > > > A new choc fish challege: Write a program or make any other
>>> mechanism
>>> > > > > to solve the n queens problem.
>>> > > > >
>>> > > > > There will be many prizes and categories will be created on a
>>> whim.
>>> > > > > There will be prizes for at least the following categories:
>>> > > > >
>>> > > > > * Simplest C solution.
>>> > > > > * Simplest other language solution.
>>> > > > > * Solution not using recursion.
>>> > > > > * Non-programming solutions
>>> > > > >
>>> > > > >
>>> > > > > Background
>>> > > > > The n-queens problem is a  classical computer science problem.
>>> What
>>> > > > > you need to do is place n queens on an nxn chess board so that
>>> none
>>> > > > > of the queens can take eachother.
>>> > > > >
>>> > > > > For example, on a normal 8x8 board you must place 8 queens so
>>> that
>>> > > > > none
>>> > > >
>>> > > > may
>>> > > >
>>> > > > > take eachother.
>>> > > > >
>>> > > > > An example solution for 4 queens is:
>>> > > > >
>>> > > > > XQXX
>>> > > > > XXXQ
>>> > > > > QXXX
>>> > > > > XXQX
>>> > > > >
>>> > > > > Deadline: three days before the next meeting.
>>> > > >
>>> > > > So far, one very intriguing C entry from Synco. I've only looked at
>>> it
>>> > > > a short
>>> > > > while and have not quite figured out how it works.
>>> > > >
>>> > > > -- Charles
>>> > > >
>>> > > >
>>> > > >
>>> > > > _______________________________________________
>>> > > > Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
>>> > > > http://lists.ourshack.com/mailman/listinfo/chchrobotics
>>> > > > Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
>>> > > > Web site: http://kiwibots.org
>>> > > > Meetings 3rd Monday each month at Tait Radio Communications, 175
>>> > > > Roydvale Ave, 6.30pm
>>> > > >
>>> > > > When replying, please edit your Subject line to reflect new
>>> content.
>>> >
>>> > _______________________________________________
>>> > Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
>>> > http://lists.ourshack.com/mailman/listinfo/chchrobotics
>>> > Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
>>> > Web site: http://kiwibots.org
>>> > Meetings 3rd Monday each month at Tait Radio Communications, 175
>>> Roydvale
>>> > Ave, 6.30pm
>>> >
>>> > When replying, please edit your Subject line to reflect new content.
>>>
>>>
>>>
>>> _______________________________________________
>>> Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
>>> http://lists.ourshack.com/mailman/listinfo/chchrobotics
>>> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
>>> Web site: http://kiwibots.org
>>> Meetings 3rd Monday each month at Tait Radio Communications, 175 Roydvale
>>> Ave, 6.30pm
>>>
>>> When replying, please edit your Subject line to reflect new content.
>>>
>>
>>
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
> http://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Web site: http://kiwibots.org
> Meetings 3rd Monday each month at Tait Radio Communications, 175 Roydvale
> Ave, 6.30pm
>
> When replying, please edit your Subject line to reflect new content.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ourshack.com/pipermail/chchrobotics/attachments/20110831/d7f197ba/attachment.htm 


More information about the Chchrobotics mailing list