On Thursday, August 16, 2012 06:14:23 Simen Kjaeraas wrote:
> On Wed, 15 Aug 2012 20:07:59 +0200, Jonathan M Davis
>
> wrote:
> >> 1) The specification is clear that the if the template has only
> >> one member and the member has the same name with the template's,
> >> the member is implicitly re
On Wed, 15 Aug 2012 20:07:59 +0200, Jonathan M Davis
wrote:
1) The specification is clear that the if the template has only
one member and the member has the same name with the template's,
the member is implicitly referred to in the instantiation. The
template octal has two members, so the pr
On 08/16/2012 03:56 AM, maarten van damme wrote:
solving sudoku's well too : http://dpaste.dzfl.pl/903e34b5
I have one question though, how can you make it find all possible solutions?
Keep on backtracking when you find one until there are no more
possibilities to explore. (i.e. get rid of the
solving sudoku's well too : http://dpaste.dzfl.pl/903e34b5
I have one question though, how can you make it find all possible solutions?
2012/8/16, Era Scarecrow :
> On Thursday, 16 August 2012 at 01:05:20 UTC, Era Scarecrow wrote:
>> So far having it running it's found over 23k+ combinations
>> af
Hmm, sorry odd things have happened to the formatting. Visual D's
spacing doesn't seem to work very well outside of itself.
This is my attempt at a D solver, it's a pretty direct
translation of a C++ version I wrote but it's a lot slower in D,
around 1/4 the speed sadly, 2x because of the compiler I think
and 2x because in C++ I can use proper bitfields which seem to
give another 2x speed up (halving the size of the
On Thursday, 16 August 2012 at 01:05:20 UTC, Era Scarecrow wrote:
So far having it running it's found over 23k+ combinations
after about 3 minutes.
Unless I introduced a bug... Now I'll have to speed it up to
make sure and won't take an afternoon to calculate.
On Wednesday, 15 August 2012 at 22:38:58 UTC, ixid wrote:
How many solutions do you find for that one?
Don't know, it actually just stops after finding the first one.
Modifying it to give all possible outputs wouldn't be too hard...
So far having it running it's found over 23k+ combinations
On 08/15/2012 12:31 AM, bearophile wrote:
http://www.reddit.com/r/cpp/comments/y6gwk/norvigs_python_sudoku_solver_ported_to_c11/
http://nonchalantlytyped.net/blog/2012/08/13/sudoku-solver-in-c11/
His C++11 port is 316 lines long:
https://gist.github.com/3345676
How many lines for a (not golfe
Jonathan M Davis:
It would probably have to be tweaked to match
whatever Bearophile's code does though as far is input goes (I
haven't looked at the code that he linked to).
And the original Python code is not mine, it's from the AI
researcher Peter Norvig :-)
Bye,
bearophile
Jonathan M Davis:
and the code is lightning fast. It would probably have to be
tweaked to match
whatever Bearophile's code does though as far is input goes (I
haven't looked
at the code that he linked to). It also makes no attempt at
being compact
(e.g. it actually checks the command line arg
On Wednesday, 15 August 2012 at 20:13:10 UTC, Era Scarecrow wrote:
On Wednesday, 15 August 2012 at 15:39:26 UTC, ixid wrote:
Could you supply your code? Which one are you using as the
hardest? If you're solving the 1400 second one in 12 seconds
that's very impressive, I can't get it below 240 s
On Wednesday, 15 August 2012 at 20:28:19 UTC, Jonathan M Davis
wrote:
Brute force is so fast that there's no really any point in
trying to solve it any other way except for the challenge of
doing so. I answered a question on this using D at
codegolf.stackexchange.com a while back:
http://co
On Wednesday, August 15, 2012 21:14:07 Era Scarecrow wrote:
> I have made a C version a while back that solves any sudoku
> puzzle in 1/8th of a second. The code for that though was
> considerably longer and involved several forms of pattern
> matching and detecting how to solve the puzzle before i
On Wednesday, 15 August 2012 at 15:39:26 UTC, ixid wrote:
Could you supply your code? Which one are you using as the
hardest? If you're solving the 1400 second one in 12 seconds
that's very impressive, I can't get it below 240 seconds.
Expanded to 225 lines after comments and refactoring for n
On Wed, Aug 15, 2012 at 6:46 PM, David Nadlinger wrote:
> On Tuesday, 14 August 2012 at 16:06:33 UTC, Jacob Carlborg wrote:
>>
>>
>> https://github.com/jacob-carlborg/orange/blob/master/orange/util/Reflection.d#L29
>
>
> Related:
> https://github.com/D-Programming-Language/phobos/blob/master/std/t
On Wednesday, 15 August 2012 at 15:39:26 UTC, ixid wrote:
Could you supply your code? Which one are you using as the
hardest? If you're solving the 1400 second one in 12 seconds
that's very impressive, I can't get it below 240 seconds.
1400 seconds? Well my CPU is a quad-core 3.2Ghz, but it's
On Wednesday, 15 August 2012 at 15:13:09 UTC, Andrew wrote:
Ah, understood. My thanks. I'll probably start using the
-property switch
just to avoid accidentally getting in the habit of using a
deprecated
feature.
Note, another form discussion has pointed out that -property is
horribly broke
On Wednesday, August 15, 2012 19:49:53 Michael wrote:
> Hi all,
> I have just read Walter's article about octals on Dr. Dobb's.
> As a newbie, I tried to create one myself.
>
> template octal(int n) {
> int toOct(int x) {...}
>
> enum octal = toOct(n);
> }
>
> void main() {
> import std.stdio :
Hi all,
I have just read Walter's article about octals on Dr. Dobb's.
As a newbie, I tried to create one myself.
template octal(int n) {
int toOct(int x) {...}
enum octal = toOct(n);
}
void main() {
import std.stdio : writeln;
writeln(octal!10);
}
I
Another option is to use "module constructors", as shown below. (But
somehow this all looks a bit fishy for me...)
LMB
import std.stdio;
string a = "a";
string b;
static this()
{
b = a;
}
void main()
{
writeln(b);
}
On Wed, Aug 15, 2012 at 11:03 AM, d_follower wrote:
> On Wednes
On Tuesday, 14 August 2012 at 16:06:33 UTC, Jacob Carlborg wrote:
https://github.com/jacob-carlborg/orange/blob/master/orange/util/Reflection.d#L29
Related:
https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L510
David
On 08/15/2012 06:55 AM, d_follower wrote:
On Wednesday, 15 August 2012 at 13:41:10 UTC, RommelVR wrote:
Make a an enum, const or otherwise immutable.
I don't think you understood the question.
I thought RommelVR did understand the question. Try this:
import std.stdio;
enum a = "a";
string
On Wed, 15 Aug 2012 15:36:24 +0200, Stefan wrote:
> Hi there, I'm having trouble getting the following code to compile:
>
> import std.stdio;
>
> string a = "a";
> string b = a;
>
> void main()
> {
> writeln(b);
> }
>
> DMD spits out the error "test.d(4): Error: variable a cannot be read
Could you supply your code? Which one are you using as the
hardest? If you're solving the 1400 second one in 12 seconds
that's very impressive, I can't get it below 240 seconds.
On Wednesday, 15 August 2012 at 01:22:41 UTC, Era Scarecrow wrote:
On Wednesday, 15 August 2012 at 00:37:32 UTC, ReneSac wrote:
And my last question of my first post: I can't use "auto" for
the "out" values right? An enhancement proposal like this
would be compatible with D?
I would say
On Tue, 14 Aug 2012 06:27:19 +0200, Jesse Phillips wrote:
> On Monday, 13 August 2012 at 18:49:55 UTC, Nathan M. Swan wrote:
>> Without the -property switch, you can use non-@property functions as if
>> they were @property. This is supposed to eventually be deprecated, so I
>> try to not do this.
On 8/15/12, d_follower wrote:
> I don't really know why, but it seems that you can only
> initialize globals with constants.
That's what the static constructor is for:
http://dlang.org/class.html#StaticConstructor
http://dlang.org/class.html#SharedStaticConstructor
On Wednesday, 15 August 2012 at 13:36:26 UTC, Stefan wrote:
Hi there, I'm having trouble getting the following code to
compile:
import std.stdio;
string a = "a";
string b = a;
void main()
{
writeln(b);
}
DMD spits out the error "test.d(4): Error: variable a cannot be
read at compile tim
On Wednesday, 15 August 2012 at 13:36:26 UTC, Stefan wrote:
Hi there, I'm having trouble getting the following code to
compile:
import std.stdio;
string a = "a";
string b = a;// line 4
void main()
{
writeln(b); // line 8
}
DMD spits out the error "test.d(4): Error: variable
On Wednesday, 15 August 2012 at 13:41:10 UTC, RommelVR wrote:
Make a an enum, const or otherwise immutable.
I don't think you understood the question.
On Wednesday, 15 August 2012 at 13:36:26 UTC, Stefan wrote:
Hi there, I'm having trouble getting the following code to
compile:
import std.stdio;
string a = "a";
string b = a;
void main()
{
writeln(b);
}
DMD spits out the error "test.d(4): Error: variable a cannot be
read at compile tim
Hi there, I'm having trouble getting the following code to
compile:
import std.stdio;
string a = "a";
string b = a;
void main()
{
writeln(b);
}
DMD spits out the error "test.d(4): Error: variable a cannot be
read at compile time". Is there any way to tell the compiler I
want b evaluated
Era Scarecrow:
I don't see the python source off hand,
The original Python code:
http://norvig.com/sudopy.shtml
Bye,
bearophile
On Tuesday, 14 August 2012 at 22:31:16 UTC, bearophile wrote:
http://www.reddit.com/r/cpp/comments/y6gwk/norvigs_python_sudoku_solver_ported_to_c11/
http://nonchalantlytyped.net/blog/2012/08/13/sudoku-solver-in-c11/
His C++11 port is 316 lines long:
https://gist.github.com/3345676
How many lin
On 08/15/2012 03:01 AM, Era Scarecrow wrote:
Not Golfed? I don't recognize that term. I don't see the python source
off hand, but I don't understand python anyways.
It refers to "code golf", where you try to solve a problem with the
smallest program possible (one-letter variable names, no wh
On Tuesday, 14 August 2012 at 22:31:16 UTC, bearophile wrote:
http://www.reddit.com/r/cpp/comments/y6gwk/norvigs_python_sudoku_solver_ported_to_c11/
http://nonchalantlytyped.net/blog/2012/08/13/sudoku-solver-in-c11/
His C++11 port is 316 lines long:
https://gist.github.com/3345676
How many lin
37 matches
Mail list logo