AlkantarClanX12

Your IP : 3.12.154.133


Current Path : /proc/thread-self/root/lib64/python2.7/Demo/scripts/
Upload File :
Current File : //proc/thread-self/root/lib64/python2.7/Demo/scripts/queens.pyo

�
Afc@sBdZdZddd��YZd�Zedkr>e�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.

itQueenscBsSeZed�Zd�Zdd�Zd�Zd�Zd�ZdZ	d�Z
RS(cCs||_|j�dS(N(tntreset(tselfR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyt__init__s	cCsf|j}dg||_dg||_dgd|d|_dgd|d|_d|_dS(Niii(RtNonetytrowtuptdowntnfound(RR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyRs	icCs�x}t|j�D]l}|j||�r|j||�|d|jkrX|j�n|j|d�|j||�qqWdS(Ni(trangeRtsafetplacetdisplaytsolvetremove(RtxR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyRs
cCs0|j|o/|j||o/|j||S(N(RRR	(RRR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyR&scCs@||j|<d|j|<d|j||<d|j||<dS(Ni(RRRR	(RRR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyR
)s

cCs@d|j|<d|j|<d|j||<d|j||<dS(Ni(RRRRR	(RRR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyR/s

cCs�|jd|_|jrdSdd|jdGHxbt|jddd�D]G}dGx5t|j�D]$}|j||kr�dGqedGqeWdGHqKWdd|jdGHdS(	Nis+-s--t+i����t|tQt.(R
tsilentRRR(RRR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyR7s	 	(t__name__t
__module__tNRRRRR
RRR(((s+/usr/lib64/python2.7/Demo/scripts/queens.pyRs	
			cCs�ddl}d}t}|jdd!dgkrDd}|jd=n|jdrgt|jd�}nt|�}||_|j�dG|jGdGHdS(Ni����iiis-ntFounds
solutions.(tsysRtargvtintRRRR
(RRRtq((s+/usr/lib64/python2.7/Demo/scripts/queens.pytmainFs

	
t__main__N((t__doc__RRRR(((s+/usr/lib64/python2.7/Demo/scripts/queens.pyt<module>
s
8