On Sun, Jan 5, 2014 at 6:07 AM, Wiktor wrote:
> On Sat, 4 Jan 2014 01:16:14 +0100, Wiktor wrote:
> Idea is still the same. I start with 2d array
> And then I fill it up one number by one (exception: first row). At every
> step
> checking if current column is unique (0's not counted) and if al
On Sat, 4 Jan 2014 20:07:33 +0100, Wiktor wrote:
> I guess that some kind of you have done this before. ;-)
Damn it. This 'kind' shouldn't be there. Now it sounds silly,
even offensive. ;-) Normally I would supersede it, but probably attached
mailin
On Sat, 4 Jan 2014 01:16:14 +0100, Wiktor wrote:
> Hi,
OK, another question. This time, I think, closer to the original subject
(recursive algorithm).
Thanks to Terry's and Chris' advises I refined script. Then I thought, that
with some changes and with minimal effort I can force this script
On Sat, 4 Jan 2014 22:18:09 +1100, Chris Angelico wrote:
>> Thank you for all Your comments.
>
> My pleasure! Always happy to help out.
I'm aware, that at my point of education there's no sense in optimizing code
to squeeze from it every millisecond, but Project Euler gave me habit to
compar
On Sat, 4 Jan 2014 22:18:09 +1100, Chris Angelico wrote:
>>> This is the same as you have at the top of 'if not towers'. Can you be
>>> confident that row is None any time towers is None? If so, just move
>>> this up above the other check and save the duplication.
>>
>> row is None at start, but
On Fri, 03 Jan 2014 20:47:16 -0500, Terry Reedy wrote:
> [0]*size] is fine for one row
>
> towers = [[0]*size] for i in range(size)]
>
> should do what you want for a 2-d array instead of the above.
Right. Thank you also.
--
Best regards, Wiktor Matuszewski
'py{}@wu{}em.pl'.format('wkm'
On Sat, Jan 4, 2014 at 10:09 PM, Wiktor wrote:
> On Sat, 4 Jan 2014 13:02:37 +1100, Chris Angelico wrote:
>> And in fact, you might want to turn this whole branch into something
>> that harks to a more functional programming style:
>>
>> return all((check(towers, i) for i in range(len(towers)))
>
On Sat, 4 Jan 2014 13:02:37 +1100, Chris Angelico wrote:
>> def check(towers, x=None):
>> column = [] # value added on pos. x
>> for i in range(len(towers)):
>> column.append(towers[i][c])
>> column = [x for x in column if x != 0]
>
On Sat, Jan 4, 2014 at 11:13 AM, Wiktor wrote:
> Hi,
> it's my first post on this newsgroup so welcome everyone. :)
Hi! Welcome!
> I'm still learning Python (v3.3), and today I had idea to design (my first)
> recursive function, that generates board to 'Towers' Puzzle:
> http://www.chiark.greene
On 1/3/2014 7:16 PM, Wiktor wrote:
Hi,
it's my first post on this newsgroup so welcome everyone. :)
I'm still learning Python (v3.3), and today I had idea to design (my first)
recursive function, that generates (filled out) board to 'Towers' Puzzle:
http://www.chiark.greenend.org.uk/~sgtatham/p
Hi,
it's my first post on this newsgroup so welcome everyone. :)
I'm still learning Python (v3.3), and today I had idea to design (my first)
recursive function, that generates (filled out) board to 'Towers' Puzzle:
http://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/towers.html
(so I could in
Hi,
it's my first post on this newsgroup so welcome everyone. :)
I'm still learning Python (v3.3), and today I had idea to design (my first)
recursive function, that generates board to 'Towers' Puzzle:
http://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/towers.html
(so I could in future write a
12 matches
Mail list logo