« first day (1630 days earlier)      last day (3508 days later) » 

10:00
3-SAT not SAT-3 ! :)
@Lembik but try it :)
did you use pbencoder?
I will try it!
@Lembik yes, but beware the numbers it generates at the start of the cnf file
not sure what they mean and you might have to remove them
@orlp thanks.
there is probably a flag to get rid of them :)
I feel we have learnt something new :)
why?
10:04
about encoding problems as PBS instances
had you done that before?
no, but in this case it really was simple
yes it was!
all I did was matrix x vector multiply, but instead of multiplying I just generated terms
right
I am intrigued to find out how efficient the end result will be
and how long it will take to solve them!
@trichoplax Can you check NNWSWWESWNSSWNNENESWNNSNSSSEEWWSSWNEWSEENNSWWWEENNENNSESSWWNENNSNNWWSSEWNSEESES‌​NEWSEENWENSWWNNSNSEWNSSNWESNWNESENNEEWNNNEESESEWNWSNNWEEESWENWWEEWENSWEWNWSNESSEW‌​NSSESWNWSWNSSWNWWEEWEENENWNESWWWWNWESEENWWSNNEENNSNWNENEWSEWSWEEWSWNEWSNWSENNENNS‌​EEENENSNNWSESESNWEWWWWNNWNNENWEWWNNSWWENNSESSEWENNESENW
10:11
@Sp3000 what challenge?
We're trying to see how feasible trichoplax's maze challenge (in the sandbox) is for 3x3
It's running the test now
Passes :)
Well that's 296...
@Sp3000 linky
10:14
I think... the problem is SE adding invisible chars in
2
A: Sandbox for Proposed Challenges

trichoplaxShortest Universal Maze Exit String code-challenge A maze on an N by N grid of square cells is defined by specifying whether each edge is a wall or not a wall. All outer edges are walls. One cell is defined as the start, and one cell is defined as the exit, and the exit is reachable from the st...

Try to filter out "NSEW" chars - you'll find there's only 296 of them
@Sp3000 I wondered that - 3 double character line separators would do it, and yet when I past it into python it comes out on one line...
Was that the problem with the 310 one earlier too?
And the reason why I was 10 off before was because I actually have else: instead of elif c == "W" for West (it's the last case)
Gonna change it to be more defensive
@Sp3000 Oh - so it works as long as there are no invalid characters?
I should change that too - especially for when answers come in from just anybody...
10:16
Before it would work even if you had other chars (it'd count as west) - fixed now though :P
Lesson learnt
296 - you were right I just needed to filter out other characters
Damnit SE :P
Using previous solutions as seeds, I'm getting better and better solutions now though
Seeds? Are you just changing characters at random and seeing if they still work?
Oops I sorta lied - I've actually got a GA over here. But since I was starting with a large initial population earlier so that it finished after the initial population was generated, that's why I said it was random
I'm going to try a jsfiddle validator with hardcoded mazes to cut out the start up time, and if that works I'll consider posting with 3x3
10:20
I should really hardcode the mazes too :P But it only takes a few seconds to generate them all, so I haven't bothered yet
(btw the GA doesn't actually do well at all on its own, in case you're wondering)
It only takes a few seconds for me too, so I'm torn between a fast jsfiddle and a slow stack snippet to avoid sending people off site
hrm, how I see this problem
I suppose I could load the mazes from an external source into a stack snippet
is that every maze has an associated infinite set of all finite inputs that solve it
the problem is then to find the shortest common element of all those sets
Yes - that's equivalent.
10:24
With that view an incremental approach would probably do better - I'm feeling lazy atm though :P
if you order the infinite sets lexicographically
If I was answering I'd be tempted to try xnor's approach from puzzling and then try to cut it down, but for testing the viability of the question that's not going to help me
the problem reduces to first common element
@trichoplax haven't you guys already found valid ~300 character solutions?
what's there to test about the viability?
I'm assuming by lexicographically you mean by length first
it seems viable to me
@Sp3000 lexicographically implies length
"tes" < "test"
10:26
I thought lexicograpically implies a then aa then b
@orlp It's answerable, but my concern is that it may be optimally answerable, at which point the competition ends
oh right
not lexicographically
@trichoplax that is fine
Whatever the name for the ordering you were thinking, that would work...
and optimal answers are interesting and generate upvotes
@orlp Yes I don't mind an optimal answer eventually, but I had a challenge recently which was optimally answered within an hour... :(
10:27
just go for it
@trichoplax don't worry about it
With this one I'm guessing an optimal answer will take weeks to months, so I'm close to posting with size 3x3.
Well at least you won't get an hour for this one. A day? Maybe. Probably not an hour though
you guys have been at it for more than an hour
tested enough, let's go :D
put it on the site
Eager to start or something?
:P
Then all I need to do is translate my validator from python to javascript then I can post...
10:29
@trichoplax you don't
isn't the validator going to be prohibitively slow in javascript?
besides, it's fine to use python
you can always add the validator later
I know I could post with the python validator, but I like having a validator built into the question
So people don't have to download a language they are not using
by the way, how many maze configurations are there in 3x3?
138172
The slow part of the validator is generating all 138172 mazes ready for testing - the actual test will be less than a second even in javascript
Even generating them in javascript is realistic - I was only thinking of precalculating to avoid putting people off
Probably depends on the string if it fails early or late :P Or do all strings work under a second?
10:32
Obviously all strings can't work under a second :P
I may be exaggerating but the test certainly seems quicker than the maze generation for the ones we're testing here
No I mean, does testing any single string work under a second with yours? Cos if it does I need to make mine a bit more efficient :P
(PyPy's giving me massive speedups for this though)
@Sp3000 Yours isn't inefficient - I was misjudging the difference. I've just counted up and it's over 20 seconds for the maze generation and over 5 seconds for the latest (shortest) string
Python 3 without PyPy
The other nice thing about loading the mazes from an external source is that I won't have to rewrite as much of the code (better for me and better for reliability...)
Mine takes 3 seconds to check a valid string in CPython... also I'm up to 276 fyi
down to 276 ;)
Maybe I should post the question quick before you reach an optimal solution
I won't post for a while - if I've been working on a sandboxed question I try to wait for the amount of time I've spent on it
10:37
That's terribly good form
@Sp3000 could I see your maze generation / checking code?
you can keep your solution code secret :P
a 3x3 maze has 12 internal walls, right?
so 12 bits encodes on maze
well
plus start / end
start can be 9 locations, end can be 8
I happen to order mine as vertical walls in reading order followed by horizontal walls in reading order
so 294912 mazes, 19 bits
can we reduce some with rotational symmetry?
10:41
Here - it's not too bad for speed, considering it was an implementation I tried to get done ASAP
@orlp If you rotate a maze the same string of NESW won't necessarily solve it
@trichoplax it would if you cycle NESW to ESWN
You can exploit symmetry in the move string though, I guess
@orlp True
@trichoplax mazes where start == end are not valid mazes, right?
10:49
Even if they were, they'd be solvable by any string, so I've excluded them from the count
@Sp3000 no they're not
consider an empty maze
with the start and end in the topleft corner
S would fail to solve that
as it would not move over the topleft corner
I assumed that you "finish" a maze if you're on the finish square at any point in time, even before you make the first move
To avoid that problem (whether to check before moving), only mazes with a distinct start and exit are valid
ok
Actually it looks like I didn't make that explicit in the wording (although that's how I've been coding). I'll edit it now
11:32
haha
oh man this is going to be fast
int move(uint32_t maze, int pos, Move move) {
    int new_pos += 6*move - 2*(move > 1) - 8;
    if (new_pos < 2 || new_pos > 22) return pos;

    int idx = (pos + new_pos) / 2;
    uint32_t masks[] = {0, 0, 0, 1<<0, 0, 1<<1, 1<<2, 0, 1<<3, 0, 1<<4, 1<<5, 0,
                        1<<6, 1<<7, 0, 1<<8, 0, 1<<9, 1<<10, 0, 1<<11, 0, 0, 0};
    return (maze & masks[idx]) ? pos : new_pos;
}
0
A: Sandbox for Proposed Challenges

gilad hochThe lost pawn problem After the chess game ended, a surviving pawn was left behind enemy lines. let's help him find the shortest way back home. The original problem describes a nXn "chess" board, and a function f: {1,..,n}X{1,..,n}X{1,2,3} => R+ of weights. the goal is to find the best path fro...

@orlp Wow. I really need to get on and post this ;)
Where's a reliable long term place to externally store a string of numbers to be accessed from a stack snippet?
11:47
Encoded in the pixels of an image :P
Interesting - so I could store it in the same Stack Exchange question....
I'm going to attempt a genetic algorithm
Good luck with that
you think it won't work?
I tried - it didn't give good results unless I initialised the population with actual solutions
You might have a better approach though, I dunno
11:56
what fitness function did you use?
Number of mazes solved
@Sp3000 with secondary fitness length?
how well did it work once you got a decent seed population?
Didn't have a secondary - how well it worked depended on how lucky I got, because it depends on how many useless chars could be trimmed off the string
I was thinking of doing random manipulations
such as adding characters
removing characters
modifying characters
I tried the first and third, not the last. I dunno - tell me how it goes :)
12:00
what is your current approach?
if not genetic
what size of grid are you working on?
Incremental
@trichoplax Something to consider, < 150 is possible. Are you sure you don't want 3x4?
Hmmm. I don't know
How long did you take to find sub 150?
A few seconds
????!??
Interesting
12:04
It's deterministic though, so improving it might be harder
@Sp3000 please, just keep it at 3x3
stuff explodes fast
I still think 3x3 will be tough to make optimal
tough enough
if you make challenges too hard no one competes
I'd be surprised if it's cracked in the first month
There's only 7 mil 3x4s, so it doesn't go up by that much fyi
4x4 explodes though
12:05
nobody posts anything in other months
I like 3x3
My guess is that the shorter the string you search for, the fewer there will be that are valid, so the longer it will take (even though there are fewer strings overall)
3x3 seems kinda smallish
I like that it seems smallish. People will be fooled into trying to beat it :)
might have problems that it's impossible to beat the first posted answer
12:06
That is exactly what I want to avoid.
So far in chat there has been a gradual improvement, so I'm hopeful that there will be plenty of answers before the supply of strings dries up
And I'll be throwing bounty at it when it slows down
@Sp3000 could you give me a longish string that solves all mazes so I can test my fitness function?
my fitness code is really elegant
There's a few if you scroll up a bit
Just filter out for NSEW cos SE seems to add invisible chars or something
what do you mean
line breaks add extra characters
oh I see it in vim
12:13
I can manage switching between coding in python and javascript, but trying to translate one to the other I'm getting colons and braces everywhere
12:23
0
Q: Draw an ASCII Checkerboard

Dragon GuySummary Inspired by the recent popularity of ASCII art challenges, this challenge's purpose is to draw an ASCII checkerboard, like one on which Chess can be played. Write a program that takes a positive integer n as an argument, in stdin, or as user input, and output an checkerboard with nxn sq...

what is the opposite of "greatest number"?
least number?
smallest number?
0
or negative infinity
dullest number?
guys, what is the least interesting number?
12:29
I normally use smallest
lowest
Fleventy Five
smallest
tiniest
I meant as a synonym for smallest, as smallest-largest, ???-greatest
least
small, smaller, smallest
12:30
greatest means biggest or largest - they are from different roots but mean the same thing, so any of smallest, least, lowest
does least means the same?
as in "choose the least number possible" == "choose the smallest number possible"
but fewest and least are different :)
Not in English, but I can't see a way it would differ in mathematics
@Sp3000 could you gist one of your valid solutions
I'm paranoid se chat is messing something up
"least interesting number" is ambiguous
12:32
Neither means less than zero, which is the only ambiguity I can imagine
@Lembik no, it's a contradiction :)
"least interesting number" is an interesting distinction
it is either the number that is least interesting or the smallest number which is still interesting
Oh I see
12:33
I don't think there are any uninteresting numbers
is -1 smaller than 5 ? :)
@trichoplax you can prove it too!
@Lembik Yes, by both definitions :P
I am not clear what small means wrt a number
can it be applied to negative numbers at all?
12:34
|-1|<|5|
-6 < 5 ?
Depends if the set you're talking about has a well defined ordering
well... it depends if smallness defines a well defined ordering on the set you're talking about
the integers certainly have at least one well defined ordering
it's just not clear that smallness does it
12:36
I always take "less than" to mean <
although I like the idea that -6 is bigger than 5
@trichoplax me too
With smaller than it could be either < or ||<||
the problem is small and big :)
right
for example, the matrix with the biggest determinant
Usually the context makes it clear. Where is doesn't, vote to close
in any case.. :)
12:42
for some reason it reports to only solve 175036 mazes
That's more than all of them...
no?
It only needs to solve the valid ones
there's 331776 mazes
138172
12:44
no
12 walls
9 start positions
9 end positions
2**12 * 9 * 9 = 331776
whether or not you include start == end is another thing, but that's still way more than 138172
138172 of them have the exit reachable from the start
ah
:)
If the exit is boxed in you don't need to be able to solve that maze
I don't have a formula for the valid mazes - I just found them by flood fill from the start to see if it finds the exit
oh, I'm actually checking the input string on all mazes
I probably shouldn't ye
but it shouldn't matter - it still means my code is bugged
does that 138172 figure include mazes where start == end
No those are invalid too
There may be nothing else wrong with your code - it simply can't work if you include unsolvable mazes
12:48
I don't think it's bugged - if you take out start == end I think the number's right
Since you're off by 9 * 2^12
ah yes
its correct my code
wow, getting a binary checkerboard is so non-trivial
@Optimizer yes it is?
you start with the top row and then you shift back / forth and add 1 every other row
85, 170, 85, 170, 85, 170, 85, 170?
or isn't that what you meant?
12:55
I'm assuming Optimizer means the new challenge?
We now have a challenge posted for just counting and formatting in binary?
Without even excluding builtin string formatting stuff?
god, 61 bytes
0
A: Sandbox for Proposed Challenges

randomraDistinct Sums You should write a program or function which receives an integers as input and returns two integers whose sum is the first one. There is one further requirement: no number can be part of the output for two different inputs. Details You should be able to handle inputs for at lea...

0
Q: Pronouncing Hex

Vioz-Pronouncing Hex For those of you uninitiated with the show Silicon Valley, this challenge is inspired by an exchange that goes like this: Kid - Here it is: Bit… soup. It’s like alphabet soup, BUT… it’s ones and zeros instead of letters. Erlich Bachman - {silence} Kid - ‘Cause it’s bina...

Alex should change his name to The commenter
13:10
61 seems really excessive for the checkerboard o_O
in Cjam?
I'm assuming so, cos Optimizer
I thought you can write a whole chess program in 61 bytes :P
whole chess program can be done in lesser.
59 now
I am just gonna post it and don't worry about getting my ass kicked by jimmy or Dennis later
@Optimizer time to pyth?
13:16
nah.
I'm good with 1 in 20 answers for Pyth
@Vioz- Serious question: What the fleventy-eff is a bitey?
its your dickety
"0x3C4F" -> "Thirty-cee bitey forty-dee" should be "0x3C4F" -> "Thirty-cee bitey forty-eff". I couldn't find other edits to do?
Good catch :P
I was having a lot of fun pronouncing them ha ha
13:21
I've never given that many f in a single answer...
My first try was 49 o_O
in CJam ?
Yeah
well, then I am really being dumb here
Still thinking there's got to be a nicer way though
13:22
whats ur current code ?
Build line by line
Nothing fancy
it works fine for input 2 ?
I think so
as in , 0110 instead of 0101
Well now I gotta fix mine so it works with odd numbers :P
13:24
0110?
01
10
Oh right, yeah
nice. post it then
Done
Hmm fmd gives a flat array, damn
hmm, 110 bytes in Retina seems postable
probably under 100 after golfing
13:36
@Sp3000 how long does it take it for your code to verify if a solution is valid?
Depends on the solution
on average?
or, say, the solution you sent me?
CPython, 3s. Haven't tested with PyPy
ouch
it takes my C++ 0.08 seconds
I didn't exactly optimise for speed -_- you don't need to compare
13:37
and that include generating the mazes
orlp is uselessly extra competitive :D
I get this speed because the way I represent positions and mazes is pretty smart
2,  4,  6
10, 12, 14
18, 20, 22
that's what my positions look like
then I map NSWE like this: N: -8, E: 2, S: 8, W: -2
then to calculate a wall index you can just average old pos + new pos
for example 12, 20 becomes 16
then I index that into a mask array, which then masks the wall (encoded as bits in an integer), and a simple AND determines if there was a collision
@orlp Since your code is so fast, would you like to brute force strings starting from shortest and see if you can find the shortest possible valid string? If you can't, then I'll know my question is safe to post :)
@trichoplax highly unlikely
even if the string is as short as 32, that's still a 64 bit bruteforce
So even with your super fast code you think 3x3 is a good size?
13:47
yes
Excellent
Back to my javascript validator then...
13:59
Hmm. Chopping off a few toes would make it much easier to multiply in hex. Base 20 just isn't a thing :(

« first day (1630 days earlier)      last day (3508 days later) »