Your skill will accomplishwhat the force of many cannot PerlMonks

### The Perl 6 Coding Contest 2012

by moritz (Cardinal)
 on Dec 22, 2012 at 17:54 UTC Need Help??

Carl Mäsak has announced his Perl 6 Coding Contest 2012, with five small-ish challenges to be solved in Perl 6 until 2013-01-18.

I have participated in 2010 and helped organize it in 2011. This year I'm participating again. In fact I have already solved one or two of the tasks. And it's been quite fun.

Replies are listed 'Best First'.
Re: The Perl 6 Coding Contest 2012
by BrowserUk (Pope) on Dec 24, 2012 at 14:08 UTC

Has an expanded explanation of the following phrase(s) been forthcoming anywhere?:

Two crossings can never be placed vertically adjacent to each other. (This is equivalent to saying that the wires never split or merge, they only permute.)

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

I'm pretty sure it means that you can't cross the wires (0, 1) and (1, 2) at once, just (0, 1) and (2, 3):

```# allowed:
0 _  _ 1
\/
1 _/\_ 0

2 _  _ 3
\/
3 _/\_ 2

# disallowed, ambiguous:
0 _  _ 1
\/
1 _/\_ 0
\/
2 _/\ _ 3

Hm. To me, that was clearly not an option.

My doubt centers around this:

```0 _      _ 3
\    /
1 _ \  / _ 4
\ \/ /
2 __\/\/__ 2
/\/\
3 _/ /\ \_ 0
/  \
4 _/    \_ 1

The crossovers between: the 0 & 3 wires; and the 1 & 4 wires are "vertically adjacent". Ie. As close together vertically as two crossovers can be. It also means that the striaght through 2 wire has a large break which cannot be filled, leaving its continuity unclear.

Both of these things can be addressed like this:

```0 ___    ___ 3
\  /
1 _   \/   _ 4
\  /\  /
2 __\/__\/__ 2
/\  /\
3 _/  \/  \_ 0
/\
4 ___/  \___ 1

This makes for a much clearer diagram, but that means that all the crossovers are 'on the wire lines' rather than between them. It also may be seen to contravene the "It is considered elegant not to make the grid wider than it has to be." rule.

So maybe it would need to be something like:

```0 _____  _____ 3
\/
1 _    /\    _ 4
\  /  \  /
2 __\/____\/__ 2
/\    /\
3 _/  \  /  \_ 0
\/
4 _____/\_____ 1

But that still leaves some crossovers occurring on wire lines rather than between them. So maybe:

```0 _____  _____ 3
\/
1 ___  /\  ___ 4
\/  \/
2 __ /\__/\___ 2
/  \/  \
3 _/   /\   \_ 0
/  \
4 ___/    \___ 1

The 2 line sucks and it destroys the natural symmetry, but it more clearly complies with the rules -- except perhaps the no wider than necessary. Unless it is necessary to be that wide in order to comply with the other rules :)

It is an interesting programming problem, but it would suck to implement a brilliant solution, only to be failed because the problem description was ambiguous.

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
Science is about questioning the status quo. Questioning authority

Yep, moritz has it right.

Think of it like this. The fundamental operation is "exchange wires N and N+1". This is depicted graphically with a single crossing between two adjacent wires. You're allowed to put several of these fundamental operations in the same column, provided no two operations in the same column act on the same wire.

Create A New User
Node Status?
node history
Node Type: perlnews [id://1010037]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2017-12-16 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
What programming language do you hate the most?

Results (448 votes). Check out past polls.

Notices?