MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/3/root/usr/lib/python2.4/Demo/scripts/queens.pyo
mò
‚=5Dc@sDdZdZdfd„ƒYZd„ZedjoeƒndS(sıN queens problem.

The (well-known) problem is due to Niklaus Wirth.

This solution is inspired by Dijkstra (Structured Programming).  It is
a classic recursive backtracking approach.

itQueenscBsStZed„Zd„Zdd„Zd„Zd„Zd„ZdZ	d„Z
RS(	NcCs||_|iƒdS(N(tntselftreset(RR((t)/usr/lib/python2.4/Demo/scripts/queens.pyt__init__s	cCsf|i}dg||_dg||_dgd|d|_dgd|d|_d|_dS(Niii(RRtNonetytrowtuptdowntnfound(RR((RRs	icCsˆxt|iƒD]p}|i||ƒoW|i||ƒ|d|ijo|iƒn|i|dƒ|i	||ƒqqWdS(Ni(
trangeRRRtsafetxtplacetdisplaytsolvetremove(RRR((RRscCs2|i|o#|i||o|i||S(N(RRRR	RR
(RRR((RR
&scCs@||i|<d|i|<d|i||<d|i||<dS(Ni(RRRRR	R
(RRR((RR)s

cCs@d|i|<d|i|<d|i||<d|i||<dS(Ni(RRRRRR	R
(RRR((RR/s

cCsµ|id|_|iodSndd|idGHxdt|idddƒD]I}dGx7t|iƒD]&}|i||jodGqjdGqjWdGHqPWdd|idGHdS(	Nis+-s--t+i˙˙˙˙t|tQt.(RRtsilentRRRR(RRR((RR7s
	(t__name__t
__module__tNRRRR
RRRR(((RRs	
			cCs›dk}d}t}|idd!dgjod}|id=n|idot|idƒ}nt|ƒ}||_|iƒdG|i	GdGHdS(Niiis-ntFounds
solutions.(
tsysRRRtargvtintRtqRR(RRRR((RtmainFs		
t__main__N(t__doc__RRR R(R RR((Rt?
s
8