<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.ubuntu-fr.org/extern.php?action=feed&amp;tid=1174621&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / problème python EOFError]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=1174621</link>
		<description><![CDATA[Les sujets les plus récents dans problème python EOFError.]]></description>
		<lastBuildDate>Mon, 21 Jan 2013 21:07:49 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12294291#p12294291</link>
			<description><![CDATA[<p>non mais je sais qu&#039;il fonctionne^^ vu que j&#039;ai d&#039;autre os et il fonctionne sur tous sauf celui la fin je pense que je vais le desinstaller et reinstaller</p>]]></description>
			<author><![CDATA[dummy@example.com (idragus)]]></author>
			<pubDate>Mon, 21 Jan 2013 21:07:49 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12294291#p12294291</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12293661#p12293661</link>
			<description><![CDATA[<p>Je n&#039;utilise pas &quot;virtual&#160; box&quot;, et ne peux rien dire de plus. Si ton programme n&#039;est pas confidentiel, tu peux me l&#039;envoyer en message privé, et je le testerai.</p>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 21 Jan 2013 20:23:45 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12293661#p12293661</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12293421#p12293421</link>
			<description><![CDATA[<p>c&#039;est justement ça qui est bizarre car j&#039;ai télécharger le testcase a nouveau mais j&#039;ai toujours le même problème . <br />ps: le draughtsFunction c&#039;est mon fichier .py qui contient mon programme</p><br /><p>tu crois que je devrais reinstaller l&#039;os sur la virtual box?</p><p>ps: quand j&#039;éteignais la virtual box je cliquais sur la croix de windows (pas sur le bouton éteindre de l os sur la virtual box ) je sais pas si tu as bien compris mais bon <img src="http://forum.ubuntu-fr.org/img/smilies/tongue.png" width="15" height="15" alt="tongue" /> tu crois que c&#039;est ça le problème?</p>]]></description>
			<author><![CDATA[dummy@example.com (idragus)]]></author>
			<pubDate>Mon, 21 Jan 2013 20:02:11 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12293421#p12293421</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12292391#p12292391</link>
			<description><![CDATA[<p>Il doit y avoir un problème dans <strong>testCases.py</strong> ou <strong>draughtsFunctions.py</strong>.</p>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 21 Jan 2013 18:27:55 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12292391#p12292391</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12292311#p12292311</link>
			<description><![CDATA[<p>non pourquoi? quand je fais&quot; from config import* &quot; , dans le fichier config .py il y a ce que tu a mis</p>]]></description>
			<author><![CDATA[dummy@example.com (idragus)]]></author>
			<pubDate>Mon, 21 Jan 2013 18:16:43 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12292311#p12292311</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12292241#p12292241</link>
			<description><![CDATA[<p>L&#039;erreur se produit à la ligne 6 de runTests.py. Y a-t-il ce genre de lignes au début de ton(tes) script(s) ?</p><div class="codebox"><pre><code>#!/usr/bin/python3
# -*- coding: utf-8 -*-</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 21 Jan 2013 18:10:41 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12292241#p12292241</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12291711#p12291711</link>
			<description><![CDATA[<p>1) </p><div class="quotebox"><blockquote><div><div class="quotebox"><cite>Maisondouf a écrit&#160;:</cite><blockquote><div><p>Ton fichier de scripte a peut-être été coupé dans un fausse manip.<br />Regardes si le dernier caractère du fichier est bien &#039;0A&#039;.</p></div></blockquote></div></div></blockquote></div><p>voila ce que j&#039;obtiens :&quot;</p><div class="codebox"><pre class="vscroll"><code>00000cd0  20 6c 6f 72 73 71 75 27  69 6c 20 65 73 74 20 c3  | lorsqu&#039;il est .|
00000ce0  a0 20 6c 61 20 70 6f 73  69 74 69 6f 6e 22 30 22  |. la position&quot;0&quot;|
00000cf0  29 2e 0a 09 09 09 62 6f  61 72 64 5b 30 5d 5b 6a  |).....board[0][j|
00000d00  5d 3d 77 68 69 74 65 5f  6b 69 6e 67 5f 70 6c 61  |]=white_king_pla|
00000d10  79 65 72 0a 09 09 09 62  6f 61 72 64 5b 30 5d 5b  |yer....board[0][|
00000d20  6a 5d 3d 3d 57 48 49 54  45 5f 4b 49 4e 47 0a 09  |j]==WHITE_KING..|
00000d30  66 6f 72 20 70 6f 73 69  74 69 6f 6e 32 20 69 6e  |for position2 in|
00000d40  20 62 6f 61 72 64 5b 39  5d 3a 0a 09 09 69 66 20  | board[9]:...if |
00000d50  62 6f 61 72 64 5b 64 69  6d 65 6e 73 69 6f 6e 2d  |board[dimension-|
00000d60  31 5d 5b 6a 5d 3d 3d 42  4c 41 43 4b 5f 50 4c 41  |1][j]==BLACK_PLA|
00000d70  59 45 52 3a 0a 09 09 09  62 6f 61 72 64 5b 64 69  |YER:....board[di|
00000d80  6d 65 6e 73 69 6f 6e 2d  31 5d 5b 6a 5d 3d 62 6c  |mension-1][j]=bl|
00000d90  61 63 6b 5f 6b 69 6e 67  5f 70 6c 61 79 65 72 0a  |ack_king_player.|
00000da0  09 09 09 62 6f 61 72 64  5b 64 69 6d 65 6e 73 69  |...board[dimensi|
00000db0  6f 6e 2d 31 5d 5b 6a 5d  3d 3d 42 4c 41 43 4b 5f  |on-1][j]==BLACK_|
00000dc0  4b 49 4e 47 0a 0a 0a 64  65 66 20 6c 6f 6f 6b 63  |KING...def lookc|
00000dd0  61 70 74 75 72 65 28 62  6f 61 72 64 2c 69 2c 6a  |apture(board,i,j|
00000de0  2c 64 69 72 65 63 74 69  6f 6e 2c 70 6c 61 79 65  |,direction,playe|
00000df0  72 2c 6c 65 6e 67 74 68  3d 31 29 3a 0a 09 64 69  |r,length=1):..di|
00000e00  6d 65 6e 73 69 6f 6e 3d  6c 65 6e 28 62 6f 61 72  |mension=len(boar|
00000e10  64 29 0a 09 72 65 73 3d  46 61 6c 73 65 0a 09 6e  |d)..res=False..n|
00000e20  65 77 70 6f 73 3d 67 65  74 4e 65 77 43 6f 6f 72  |ewpos=getNewCoor|
00000e30  64 28 62 6f 61 72 64 2c  69 2c 6a 2c 64 69 72 65  |d(board,i,j,dire|
00000e40  63 74 69 6f 6e 2c 70 6c  61 79 65 72 2c 6c 65 6e  |ction,player,len|
00000e50  67 74 68 3d 31 29 0a 09  69 66 20 6e 65 77 70 6f  |gth=1)..if newpo|
00000e60  73 21 3d 30 3a 0a 09 09  69 66 20 62 6f 61 72 64  |s!=0:...if board|
00000e70  5b 6e 65 77 70 6f 73 5b  31 5d 5d 5b 6e 65 77 70  |[newpos[1]][newp|
00000e80  6f 73 5b 32 5d 5d 3d 3d  2d 70 6c 61 79 65 72 3a  |os[2]]==-player:|
00000e90  0a 09 09 09 72 65 73 3d  54 72 75 65 0a 09 72 65  |....res=True..re|
00000ea0  74 75 72 6e 20 72 65 73  0a 0a 64 65 66 20 70 6c  |turn res..def pl|
00000eb0  61 79 65 72 43 6f 6c 6f  72 28 76 61 6c 75 65 29  |ayerColor(value)|
00000ec0  3a 0a 09 72 65 74 75 72  6e 20 76 61 6c 75 65 2f  |:..return value/|
00000ed0  61 62 73 28 76 61 6c 75  65 29 0a 0a 64 65 66 20  |abs(value)..def |
00000ee0  67 65 74 4e 65 77 43 6f  6f 72 64 28 62 6f 61 72  |getNewCoord(boar|
00000ef0  64 2c 69 2c 6a 2c 64 69  72 65 63 74 69 6f 6e 2c  |d,i,j,direction,|
00000f00  70 6c 61 79 65 72 2c 6c  65 6e 67 74 68 3d 31 29  |player,length=1)|
00000f10  3a 0a 09 69 66 20 70 6c  61 79 65 72 43 6f 6c 6f  |:..if playerColo|
00000f20  72 28 70 6c 61 79 65 72  29 3d 3d 57 48 49 54 45  |r(player)==WHITE|
00000f30  5f 50 4c 41 59 45 52 3a  0a 09 09 69 66 20 64 69  |_PLAYER:...if di|
00000f40  72 65 63 74 69 6f 6e 3d  3d 22 4c 22 20 6f 72 20  |rection==&quot;L&quot; or |
00000f50  64 69 72 65 63 74 69 6f  6e 3d 3d 22 6c 22 3a 0a  |direction==&quot;l&quot;:.|
00000f60  09 09 09 6e 65 77 70 6f  73 3d 5b 70 6c 61 79 65  |...newpos=[playe|
00000f70  72 2c 69 2d 6c 65 6e 67  74 68 2c 6a 2d 6c 65 6e  |r,i-length,j-len|
00000f80  67 74 68 5d 0a 09 09 65  6c 69 66 20 64 69 72 65  |gth]...elif dire|
00000f90  63 74 69 6f 6e 3d 3d 22  52 22 20 6f 72 20 64 69  |ction==&quot;R&quot; or di|
00000fa0  72 65 63 74 69 6f 6e 3d  3d 22 72 22 3a 0a 09 09  |rection==&quot;r&quot;:...|
00000fb0  09 6e 65 77 70 6f 73 3d  5b 70 6c 61 79 65 72 2c  |.newpos=[player,|
00000fc0  69 2d 6c 65 6e 67 74 68  2c 6a 2b 6c 65 6e 67 74  |i-length,j+lengt|
00000fd0  68 5d 0a 09 09 65 6c 69  66 20 64 69 72 65 63 74  |h]...elif direct|
00000fe0  69 6f 6e 3d 3d 22 4c 42  22 20 6f 72 20 64 69 72  |ion==&quot;LB&quot; or dir|
00000ff0  65 63 74 69 6f 6e 3d 3d  22 6c 62 22 3a 0a 09 09  |ection==&quot;lb&quot;:...|
00001000  09 6e 65 77 70 6f 73 3d  5b 70 6c 61 79 65 72 2c  |.newpos=[player,|
00001010  69 2b 6c 65 6e 67 74 68  2c 6a 2d 6c 65 6e 67 74  |i+length,j-lengt|
00001020  68 5d 0a 09 09 65 6c 69  66 20 64 69 72 65 63 74  |h]...elif direct|
00001030  69 6f 6e 3d 3d 22 52 42  22 20 6f 72 20 64 69 72  |ion==&quot;RB&quot; or dir|
00001040  65 63 74 69 6f 6e 3d 3d  22 72 62 22 3a 0a 09 09  |ection==&quot;rb&quot;:...|
00001050  09 6e 65 77 70 6f 73 3d  5b 70 6c 61 79 65 72 2c  |.newpos=[player,|
00001060  69 2b 6c 65 6e 67 74 68  2c 6a 2b 6c 65 6e 67 74  |i+length,j+lengt|
00001070  68 5d 0a 09 65 6c 69 66  20 70 6c 61 79 65 72 43  |h]..elif playerC|
00001080  6f 6c 6f 72 28 70 6c 61  79 65 72 29 3d 3d 42 4c  |olor(player)==BL|
00001090  41 43 4b 5f 50 4c 41 59  45 52 3a 0a 09 09 69 66  |ACK_PLAYER:...if|
000010a0  20 64 69 72 65 63 74 69  6f 6e 3d 3d 22 4c 22 6f  | direction==&quot;L&quot;o|
000010b0  72 20 64 69 72 65 63 74  69 6f 6e 3d 3d 22 6c 22  |r direction==&quot;l&quot;|
000010c0  20 3a 0a 09 09 09 6e 65  77 70 6f 73 3d 5b 70 6c  | :....newpos=[pl|
000010d0  61 79 65 72 2c 69 2b 6c  65 6e 67 74 68 2c 6a 2b  |ayer,i+length,j+|
000010e0  6c 65 6e 67 74 68 5d 0a  09 09 65 6c 69 66 20 64  |length]...elif d|
000010f0  69 72 65 63 74 69 6f 6e  3d 3d 22 52 22 6f 72 20  |irection==&quot;R&quot;or |
00001100  64 69 72 65 63 74 69 6f  6e 3d 3d 22 72 22 3a 0a  |direction==&quot;r&quot;:.|
00001110  09 09 09 6e 65 77 70 6f  73 3d 5b 70 6c 61 79 65  |...newpos=[playe|
00001120  72 2c 69 2b 6c 65 6e 67  74 68 2c 6a 2d 6c 65 6e  |r,i+length,j-len|
00001130  67 74 68 5d 0a 09 09 65  6c 69 66 20 64 69 72 65  |gth]...elif dire|
00001140  63 74 69 6f 6e 3d 3d 22  4c 42 22 20 6f 72 20 64  |ction==&quot;LB&quot; or d|
00001150  69 72 65 63 74 69 6f 6e  3d 3d 22 6c 62 22 3a 0a  |irection==&quot;lb&quot;:.|
00001160  09 09 09 6e 65 77 70 6f  73 3d 5b 70 6c 61 79 65  |...newpos=[playe|
00001170  72 2c 69 2d 6c 65 6e 67  74 68 2c 6a 2b 6c 65 6e  |r,i-length,j+len|
00001180  67 74 68 5d 0a 09 09 65  6c 69 66 20 64 69 72 65  |gth]...elif dire|
00001190  63 74 69 6f 6e 3d 3d 22  52 42 22 20 6f 72 20 64  |ction==&quot;RB&quot; or d|
000011a0  69 72 65 63 74 69 6f 6e  3d 3d 22 72 62 22 3a 0a  |irection==&quot;rb&quot;:.|
000011b0  09 09 09 6e 65 77 70 6f  73 3d 5b 70 6c 61 79 65  |...newpos=[playe|
000011c0  72 2c 69 2d 6c 65 6e 67  74 68 2c 6a 2d 6c 65 6e  |r,i-length,j-len|
000011d0  67 74 68 5d 0a 09 72 65  74 75 72 6e 20 6e 65 77  |gth]..return new|
000011e0  70 6f 73 0a 0a 0a 64 65  66 20 6a 75 6d 70 28 69  |pos...def jump(i|
000011f0  6e 64 65 78 31 2c 69 6e  64 65 78 32 29 3a 0a 09  |ndex1,index2):..|
00001200  69 66 28 69 6e 64 65 78  31 3c 69 6e 64 65 78 32  |if(index1&lt;index2|
00001210  29 3a 0a 09 09 72 65 74  75 72 6e 20 6a 75 6d 70  |):...return jump|
00001220  28 69 6e 64 65 78 32 2c  69 6e 64 65 78 31 29 0a  |(index2,index1).|
00001230  09 72 65 74 75 72 6e 20  61 62 73 28 69 6e 64 65  |.return abs(inde|
00001240  78 31 2d 69 6e 64 65 78  32 29 3e 31 0a 0a 64 65  |x1-index2)&gt;1..de|
00001250  66 20 6d 6f 76 65 50 69  65 63 65 28 62 6f 61 72  |f movePiece(boar|
00001260  64 2c 69 2c 6a 2c 64 69  72 65 63 74 69 6f 6e 2c  |d,i,j,direction,|
00001270  6c 65 6e 67 74 68 3d 31  29 3a 0a 09 70 6c 61 79  |length=1):..play|
00001280  65 72 09 3d 20 70 6c 61  79 65 72 43 6f 6c 6f 72  |er.= playerColor|
00001290  28 62 6f 61 72 64 5b 69  5d 5b 6a 5d 29 0a 09 5f  |(board[i][j]).._|
000012a0  2c 6e 65 77 49 2c 6e 65  77 4a 09 3d 20 64 69 72  |,newI,newJ.= dir|
000012b0  65 63 74 69 6f 6e 54 6f  43 6f 6f 72 64 69 6e 61  |ectionToCoordina|
000012c0  74 65 73 28 62 6f 61 72  64 2c 70 6c 61 79 65 72  |tes(board,player|
000012d0  2c 69 2c 6a 2c 64 69 72  65 63 74 69 6f 6e 2c 6c  |,i,j,direction,l|
000012e0  65 6e 67 74 68 29 0a 09  62 6f 61 72 64 5b 6e 65  |ength)..board[ne|
000012f0  77 49 5d 5b 6e 65 77 4a  5d 3d 20 62 6f 61 72 64  |wI][newJ]= board|
00001300  5b 69 5d 5b 6a 5d 3b 0a  09 62 6f 61 72 64 5b 69  |[i][j];..board[i|
00001310  5d 5b 6a 5d 09 3d 20 46  52 45 45 5f 53 50 41 43  |][j].= FREE_SPAC|
00001320  45 0a 09 63 61 70 74 75  72 65 3d 20 4e 6f 6e 65  |E..capture= None|
00001330  0a 09 69 66 28 6a 75 6d  70 28 6a 2c 6e 65 77 4a  |..if(jump(j,newJ|
00001340  29 29 3a 0a 09 09 64 69  72 65 63 74 69 6f 6e 20  |)):...direction |
00001350  3d 20 72 65 76 65 72 73  65 44 69 72 65 63 74 69  |= reverseDirecti|
00001360  6f 6e 28 64 69 72 65 63  74 69 6f 6e 29 0a 09 09  |on(direction)...|
00001370  72 6f 77 2c 63 6f 6c 20  3d 20 63 6f 6d 70 75 74  |row,col = comput|
00001380  65 44 69 72 65 63 74 69  6f 6e 28 6e 65 77 49 2c  |eDirection(newI,|
00001390  6e 65 77 4a 2c 64 69 72  65 63 74 69 6f 6e 2c 70  |newJ,direction,p|
000013a0  6c 61 79 65 72 29 0a 09  09 69 66 28 6e 6f 74 20  |layer)...if(not |
000013b0  69 73 46 72 65 65 28 62  6f 61 72 64 2c 72 6f 77  |isFree(board,row|
000013c0  2c 63 6f 6c 29 29 3a 23  20 69 66 20 66 72 65 65  |,col)):# if free|
000013d0  2c 20 6a 75 73 74 20 61  20 6a 75 6d 70 20 6f 6e  |, just a jump on|
000013e0  20 61 20 66 72 65 65 20  77 61 79 0a 09 09 09 63  | a free way....c|
000013f0  61 70 74 75 72 65 20 3d  20 28 72 6f 77 2c 63 6f  |apture = (row,co|
00001400  6c 29 0a 09 72 65 74 75  72 6e 20 28 28 6e 65 77  |l)..return ((new|
00001410  49 2c 6e 65 77 4a 29 2c  63 61 70 74 75 72 65 29  |I,newJ),capture)|
00001420  0a 0a 64 65 66 20 63 61  70 74 75 72 65 28 62 6f  |..def capture(bo|
00001430  61 72 64 2c 69 2c 6a 29  3a 0a 09 62 6f 61 72 64  |ard,i,j):..board|
00001440  5b 69 5d 5b 6a 5d 3d 46  52 45 45 5f 53 50 41 43  |[i][j]=FREE_SPAC|
00001450  45 0a 0a 64 65 66 20 73  74 72 65 72 72 28 65 72  |E..def strerr(er|
00001460  72 43 6f 64 65 29 3a 0a  09 69 66 20 65 72 72 43  |rCode):..if errC|
00001470  6f 64 65 3d 3d 42 41 44  5f 44 49 52 45 43 54 49  |ode==BAD_DIRECTI|
00001480  4f 4e 5f 46 4f 52 4d 41  54 3a 0a 09 09 72 65 74  |ON_FORMAT:...ret|
00001490  75 72 6e 28 22 44 69 72  65 63 74 69 6f 6e 20 69  |urn(&quot;Direction i|
000014a0  6e 63 6f 72 72 65 63 74  22 29 0a 09 65 6c 69 66  |ncorrect&quot;)..elif|
000014b0  20 65 72 72 43 6f 64 65  3d 3d 43 41 4e 4e 4f 54  | errCode==CANNOT|
000014c0  5f 47 4f 5f 4f 55 54 53  49 44 45 3a 0a 09 09 72  |_GO_OUTSIDE:...r|
000014d0  65 74 75 72 6e 28 22 56  6f 75 73 20 76 6f 75 6c  |eturn(&quot;Vous voul|
000014e0  65 7a 20 64 c3 a9 70 6c  61 63 65 72 20 76 6f 74  |ez d..placer vot|
000014f0  72 65 20 70 69 6f 6e 20  73 75 72 20 75 6e 65 20  |re pion sur une |
00001500  63 61 73 65 20 65 6e 20  64 65 68 6f 72 73 20 64  |case en dehors d|
00001510  75 20 64 61 6d 69 65 72  2e 22 29 0a 09 65 6c 69  |u damier.&quot;)..eli|
00001520  66 20 65 72 72 43 6f 64  65 3d 3d 4f 50 50 4f 4e  |f errCode==OPPON|
00001530  45 4e 54 5f 50 49 45 43  45 3a 0a 09 09 72 65 74  |ENT_PIECE:...ret|
00001540  75 72 6e 28 22 43 65 63  69 20 6e 27 65 73 74 20  |urn(&quot;Ceci n&#039;est |
00001550  70 61 73 20 76 6f 74 72  65 20 70 69 c3 a8 63 65  |pas votre pi..ce|
00001560  22 29 0a 09 65 6c 69 66  20 65 72 72 43 6f 64 65  |&quot;)..elif errCode|
00001570  3d 3d 4e 4f 5f 50 49 45  43 45 3a 0a 09 09 72 65  |==NO_PIECE:...re|
00001580  74 75 72 6e 28 22 49 6c  20 6e 27 79 20 61 20 70  |turn(&quot;Il n&#039;y a p|
00001590  61 73 20 64 65 20 70 69  c3 a8 63 65 20 69 63 69  |as de pi..ce ici|
000015a0  22 29 0a 09 65 6c 69 66  20 65 72 72 43 6f 64 65  |&quot;)..elif errCode|
000015b0  3d 3d 50 41 57 4e 5f 4f  4e 4c 59 5f 4f 4e 45 5f  |==PAWN_ONLY_ONE_|
000015c0  4d 4f 56 45 3a 0a 09 09  72 65 74 75 72 6e 28 22  |MOVE:...return(&quot;|
000015d0  75 6e 20 70 69 6f 6e 20  6e 65 20 70 65 75 74 20  |un pion ne peut |
000015e0  70 61 73 20 73 65 20 64  c3 a9 70 6c 61 63 65 72  |pas se d..placer|
000015f0  20 64 65 20 70 6c 75 73  20 64 27 75 6e 65 20 63  | de plus d&#039;une c|
00001600  61 73 65 22 29 0a 09 65  6c 69 66 20 65 72 72 43  |ase&quot;)..elif errC|
00001610  6f 64 65 3d 3d 4e 4f 5f  45 52 52 4f 52 3a 0a 09  |ode==NO_ERROR:..|
00001620  09 72 65 74 75 72 6e 28  22 6f 6b 22 29 0a 09 65  |.return(&quot;ok&quot;)..e|
00001630  6c 69 66 20 65 72 72 43  6f 64 65 3d 3d 4f 4e 4c  |lif errCode==ONL|
00001640  59 5f 4b 49 4e 47 5f 47  4f 5f 42 41 43 4b 3a 0a  |Y_KING_GO_BACK:.|
00001650  09 09 72 65 74 75 72 6e  28 22 55 6e 20 70 69 6f  |..return(&quot;Un pio|
00001660  6e 20 6f 72 64 69 6e 61  69 72 65 20 6e 65 20 70  |n ordinaire ne p|
00001670  65 75 74 20 61 6c 6c 65  72 20 65 6e 20 61 72 72  |eut aller en arr|
00001680  69 c3 a8 72 65 20 2c 20  69 6c 20 66 61 75 74 20  |i..re , il faut |
00001690  c3 aa 74 72 65 20 75 6e  65 20 64 61 6d 65 20 70  |..tre une dame p|
000016a0  6f 75 72 20 63 65 6c 61  2e 22 29 0a 09 65 6c 69  |our cela.&quot;)..eli|
000016b0  66 20 65 72 72 43 6f 64  65 3d 3d 53 50 41 43 45  |f errCode==SPACE|
000016c0  5f 4f 43 43 55 50 49 45  44 3a 0a 09 09 72 65 74  |_OCCUPIED:...ret|
000016d0  75 72 6e 28 22 49 6c 20  79 20 61 20 64 c3 a9 6a  |urn(&quot;Il y a d..j|
000016e0  c3 a0 20 75 6e 65 20 70  69 c3 a8 63 65 20 69 63  |.. une pi..ce ic|
000016f0  69 2e 22 29 0a 09 65 6c  69 66 20 65 72 72 43 6f  |i.&quot;)..elif errCo|
00001700  64 65 3d 3d 4d 55 53 54  5f 43 41 50 54 55 52 45  |de==MUST_CAPTURE|
00001710  3a 0a 09 09 72 65 74 75  72 6e 28 22 56 6f 75 73  |:...return(&quot;Vous|
00001720  20 6e 65 20 70 6f 75 76  65 7a 20 66 61 69 72 65  | ne pouvez faire|
00001730  20 6c 61 20 63 61 70 74  75 72 65 20 64 75 20 27  | la capture du &#039;|
00001740  76 69 64 65 27 22 29 0a  09 65 6c 69 66 20 65 72  |vide&#039;&quot;)..elif er|
00001750  72 43 6f 64 65 3d 3d 4e  4f 5f 46 52 45 45 5f 57  |rCode==NO_FREE_W|
00001760  41 59 3a 0a 09 09 72 65  74 75 72 6e 28 22 45 72  |AY:...return(&quot;Er|
00001770  72 65 75 72 20 6d 6f 75  76 65 6d 65 6e 74 3a 20  |reur mouvement: |
00001780  76 6f 75 73 20 64 65 76  65 7a 20 63 6f 6e 74 69  |vous devez conti|
00001790  6e 75 65 72 20 6c 61 20  63 61 70 74 75 72 65 2c  |nuer la capture,|
000017a0  20 76 6f 75 73 20 6e 65  20 70 6f 75 76 65 7a 20  | vous ne pouvez |
000017b0  63 68 61 6e 67 65 72 20  6c 61 20 64 69 72 65 63  |changer la direc|
000017c0  74 69 6f 6e 2e 22 29 0a  09 65 6c 69 66 20 20 65  |tion.&quot;)..elif  e|
000017d0  72 72 43 6f 64 65 3d 3d  54 4f 4f 5f 4c 4f 4e 47  |rrCode==TOO_LONG|
000017e0  5f 4a 55 4d 50 3a 0a 09  09 72 65 74 75 72 6e 28  |_JUMP:...return(|
000017f0  22 76 6f 75 73 20 20 70  6f 75 76 65 7a 20 73 61  |&quot;vous  pouvez sa|
00001800  75 74 65 72 20 61 75 20  64 65 73 73 75 73 20 64  |uter au dessus d|
00001810  27 75 6e 65 20 70 69 c3  a8 63 65 20 6d 61 78 69  |&#039;une pi..ce maxi|
00001820  6d 75 6d 22 29 0a 09 65  6c 69 66 20 65 72 72 43  |mum&quot;)..elif errC|
00001830  6f 64 65 3d 3d 43 41 4e  4e 4f 54 5f 4a 55 4d 50  |ode==CANNOT_JUMP|
00001840  5f 4f 55 54 53 49 44 45  3a 0a 09 09 72 65 74 75  |_OUTSIDE:...retu|
00001850  72 6e 28 22 45 72 72 65  75 72 20 70 72 69 73 65  |rn(&quot;Erreur prise|
00001860  3a 20 76 6f 74 72 65 20  63 61 70 74 75 72 65 20  |: votre capture |
00001870  64 6f 69 74 20 73 65 20  74 65 72 6d 69 6e 65 72  |doit se terminer|
00001880  20 73 75 72 20 6c 65 20  64 61 6d 69 65 72 22 29  | sur le damier&quot;)|
00001890  0a 0a 64 65 66 20 64 69  72 65 63 74 69 6f 6e 54  |..def directionT|
000018a0  6f 43 6f 6f 72 64 69 6e  61 74 65 73 28 62 6f 61  |oCoordinates(boa|
000018b0  72 64 2c 70 6c 61 79 65  72 2c 72 6f 77 2c 63 6f  |rd,player,row,co|
000018c0  6c 2c 64 69 72 65 63 74  69 6f 6e 2c 6c 65 6e 67  |l,direction,leng|
000018d0  74 68 29 3a 0a 09 69 66  28 69 73 46 72 65 65 28  |th):..if(isFree(|
000018e0  62 6f 61 72 64 2c 72 6f  77 2c 63 6f 6c 29 29 3a  |board,row,col)):|
000018f0  20 0a 09 09 72 65 74 75  72 6e 20 65 72 72 6f 72  | ...return error|
00001900  43 6f 64 65 28 4e 4f 5f  50 49 45 43 45 29 0a 09  |Code(NO_PIECE)..|
00001910  69 66 28 70 6c 61 79 65  72 43 6f 6c 6f 72 28 62  |if(playerColor(b|
00001920  6f 61 72 64 5b 72 6f 77  5d 5b 63 6f 6c 5d 29 20  |oard[row][col]) |
00001930  21 3d 20 70 6c 61 79 65  72 29 3a 0a 09 09 72 65  |!= player):...re|
00001940  74 75 72 6e 20 65 72 72  6f 72 43 6f 64 65 28 4f  |turn errorCode(O|
00001950  50 50 4f 4e 45 4e 54 5f  50 49 45 43 45 29 0a 09  |PPONENT_PIECE)..|
00001960  69 66 28 6c 65 6e 67 74  68 3e 31 20 61 6e 64 20  |if(length&gt;1 and |
00001970  28 6e 6f 74 20 69 73 4b  69 6e 67 28 62 6f 61 72  |(not isKing(boar|
00001980  64 2c 72 6f 77 2c 63 6f  6c 29 29 29 3a 20 0a 09  |d,row,col))): ..|
00001990  09 72 65 74 75 72 6e 20  65 72 72 6f 72 43 6f 64  |.return errorCod|
000019a0  65 28 50 41 57 4e 5f 4f  4e 4c 59 5f 4f 4e 45 5f  |e(PAWN_ONLY_ONE_|
000019b0  4d 4f 56 45 29 0a 09 23  0a 09 64 69 72 65 63 74  |MOVE)..#..direct|
000019c0  69 6f 6e 3d 20 64 69 72  65 63 74 69 6f 6e 2e 73  |ion= direction.s|
000019d0  74 72 69 70 28 29 2e 6c  6f 77 65 72 28 29 3b 0a  |trip().lower();.|
000019e0  09 67 6f 42 61 63 6b 09  3d 20 62 61 64 46 6f 72  |.goBack.= badFor|
000019f0  6d 61 74 20 3d 20 46 61  6c 73 65 0a 09 63 6f 6c  |mat = False..col|
00001a00  6f 72 09 3d 20 70 6c 61  79 65 72 43 6f 6c 6f 72  |or.= playerColor|
00001a10  28 62 6f 61 72 64 5b 72  6f 77 5d 5b 63 6f 6c 5d  |(board[row][col]|
00001a20  29 0a 09 23 0a 09 69 66  28 6c 65 6e 28 64 69 72  |)..#..if(len(dir|
00001a30  65 63 74 69 6f 6e 29 3e  31 29 3a 23 20 67 6f 20  |ection)&gt;1):# go |
00001a40  62 61 63 6b 0a 09 09 67  6f 42 61 63 6b 20 3d 20  |back...goBack = |
00001a50  64 69 72 65 63 74 69 6f  6e 5b 31 5d 20 3d 3d 20  |direction[1] == |
00001a60  22 62 22 0a 09 09 23 20  69 66 20 64 69 72 65 63  |&quot;b&quot;...# if direc|
00001a70  74 69 6f 6e 20 73 74 61  72 74 20 77 69 74 68 20  |tion start with |
00001a80  4c 2f 52 20 62 75 74 20  6e 6f 74 20 66 6f 6c 6c  |L/R but not foll|
00001a90  6f 77 65 64 20 62 79 20  42 2c 20 62 61 64 20 66  |owed by B, bad f|
00001aa0  6f 72 6d 61 74 0a 09 09  62 61 64 46 6f 72 6d 61  |ormat...badForma|
00001ab0  74 20 3d 20 6e 6f 74 28  67 6f 42 61 63 6b 29 0a  |t = not(goBack).|
00001ac0  09 23 0a 09 23 63 6f 6d  70 75 74 65 20 70 6f 73  |.#..#compute pos|
00001ad0  69 74 69 6f 6e 0a 09 6e  65 77 20 3d 20 63 6f 6d  |ition..new = com|
00001ae0  70 75 74 65 44 69 72 65  63 74 69 6f 6e 28 72 6f  |puteDirection(ro|
00001af0  77 2c 63 6f 6c 2c 64 69  72 65 63 74 69 6f 6e 2c  |w,col,direction,|
00001b00  63 6f 6c 6f 72 2c 6c 65  6e 67 74 68 29 3b 0a 09  |color,length);..|
00001b10  69 66 28 69 73 69 6e 73  74 61 6e 63 65 28 6e 65  |if(isinstance(ne|
00001b20  77 2c 62 6f 6f 6c 29 29  3a 0a 09 09 62 61 64 46  |w,bool)):...badF|
00001b30  6f 72 6d 61 74 20 3d 20  54 72 75 65 0a 09 23 0a  |ormat = True..#.|
00001b40  09 69 66 28 62 61 64 46  6f 72 6d 61 74 29 3a 20  |.if(badFormat): |
00001b50  0a 09 09 72 65 74 75 72  6e 20 65 72 72 6f 72 43  |...return errorC|
00001b60  6f 64 65 28 42 41 44 5f  44 49 52 45 43 54 49 4f  |ode(BAD_DIRECTIO|
00001b70  4e 5f 46 4f 52 4d 41 54  29 0a 09 23 0a 09 6e 65  |N_FORMAT)..#..ne|
00001b80  77 59 2c 6e 65 77 58 20  3d 20 6e 65 77 0a 09 69  |wY,newX = new..i|
00001b90  66 28 6e 6f 74 20 6f 75  74 73 69 64 65 28 62 6f  |f(not outside(bo|
00001ba0  61 72 64 2c 6e 65 77 59  2c 6e 65 77 58 29 29 3a  |ard,newY,newX)):|
00001bb0  0a 09 09 23 20 63 61 73  65 20 69 73 20 66 72 65  |...# case is fre|
00001bc0  65 2c 20 4e 6f 20 6f 70  70 6f 6e 65 6e 74 0a 09  |e, No opponent..|
00001bd0  09 69 66 28 69 73 46 72  65 65 28 62 6f 61 72 64  |.if(isFree(board|
00001be0  2c 6e 65 77 59 2c 6e 65  77 58 29 29 3a 0a 09 09  |,newY,newX)):...|
00001bf0  09 69 66 28 67 6f 42 61  63 6b 20 61 6e 64 20 6e  |.if(goBack and n|
00001c00  6f 74 28 69 73 4b 69 6e  67 28 62 6f 61 72 64 2c  |ot(isKing(board,|
00001c10  72 6f 77 2c 63 6f 6c 29  29 29 3a 20 0a 09 09 09  |row,col))): ....|
00001c20  09 72 65 74 75 72 6e 20  65 72 72 6f 72 43 6f 64  |.return errorCod|
00001c30  65 28 4f 4e 4c 59 5f 4b  49 4e 47 5f 47 4f 5f 42  |e(ONLY_KING_GO_B|
00001c40  41 43 4b 29 3b 0a 09 09  09 65 6c 69 66 28 63 6f  |ACK);....elif(co|
00001c50  75 6e 74 46 72 65 65 28  62 6f 61 72 64 2c 72 6f  |untFree(board,ro|
00001c60  77 2c 63 6f 6c 2c 64 69  72 65 63 74 69 6f 6e 29  |w,col,direction)|
00001c70  3e 3d 6c 65 6e 67 74 68  29 3a 20 0a 09 09 09 09  |&gt;=length): .....|
00001c80  72 65 74 75 72 6e 20 28  4e 4f 5f 45 52 52 4f 52  |return (NO_ERROR|
00001c90  2c 6e 65 77 59 2c 6e 65  77 58 29 0a 09 09 09 65  |,newY,newX)....e|
00001ca0  6c 73 65 3a 20 0a 09 09  09 09 72 65 74 75 72 6e  |lse: .....return|
00001cb0  20 65 72 72 6f 72 43 6f  64 65 28 4e 4f 5f 46 52  | errorCode(NO_FR|
00001cc0  45 45 5f 57 41 59 29 3b  0a 09 09 65 6c 73 65 3a  |EE_WAY);...else:|
00001cd0  0a 09 09 23 20 63 61 73  65 20 62 75 73 79 0a 09  |...# case busy..|
00001ce0  09 09 69 66 28 6e 6f 74  20 69 73 46 72 65 65 28  |..if(not isFree(|
00001cf0  62 6f 61 72 64 2c 6e 65  77 59 2c 6e 65 77 58 29  |board,newY,newX)|
00001d00  29 3a 0a 09 09 09 09 69  66 28 6e 6f 74 20 69 73  |):.....if(not is|
00001d10  4f 70 70 6f 6e 65 6e 74  28 62 6f 61 72 64 5b 72  |Opponent(board[r|
00001d20  6f 77 5d 5b 63 6f 6c 5d  2c 62 6f 61 72 64 5b 6e  |ow][col],board[n|
00001d30  65 77 59 5d 5b 6e 65 77  58 5d 29 29 3a 20 0a 09  |ewY][newX])): ..|
00001d40  09 09 09 09 72 65 74 75  72 6e 20 65 72 72 6f 72  |....return error|
00001d50  43 6f 64 65 28 53 50 41  43 45 5f 4f 43 43 55 50  |Code(SPACE_OCCUP|
00001d60  49 45 44 29 3b 0a 09 09  09 09 65 6c 73 65 3a 20  |IED);.....else: |
00001d70  23 20 6a 75 6d 70 20 6f  76 65 72 20 74 68 65 20  |# jump over the |
00001d80  6f 70 70 6f 6e 65 6e 74  0a 09 09 09 09 09 6e 65  |opponent......ne|
00001d90  77 59 2c 6e 65 77 58 20  3d 20 63 6f 6d 70 75 74  |wY,newX = comput|
00001da0  65 44 69 72 65 63 74 69  6f 6e 28 6e 65 77 59 2c  |eDirection(newY,|
00001db0  6e 65 77 58 2c 64 69 72  65 63 74 69 6f 6e 2c 63  |newX,direction,c|
00001dc0  6f 6c 6f 72 29 3b 0a 09  09 09 09 09 69 66 28 6f  |olor);......if(o|
00001dd0  75 74 73 69 64 65 28 62  6f 61 72 64 2c 6e 65 77  |utside(board,new|
00001de0  59 2c 6e 65 77 58 29 29  3a 20 0a 09 09 09 09 09  |Y,newX)): ......|
00001df0  09 72 65 74 75 72 6e 20  65 72 72 6f 72 43 6f 64  |.return errorCod|
00001e00  65 28 43 41 4e 4e 4f 54  5f 4a 55 4d 50 5f 4f 55  |e(CANNOT_JUMP_OU|
00001e10  54 53 49 44 45 29 3b 0a  09 09 09 09 09 65 6c 69  |TSIDE);......eli|
00001e20  66 28 6e 6f 74 20 69 73  46 72 65 65 28 62 6f 61  |f(not isFree(boa|
00001e30  72 64 2c 6e 65 77 59 2c  6e 65 77 58 29 29 3a 20  |rd,newY,newX)): |
00001e40  0a 09 09 09 09 09 09 72  65 74 75 72 6e 20 65 72  |.......return er|
00001e50  72 6f 72 43 6f 64 65 28  54 4f 4f 5f 4c 4f 4e 47  |rorCode(TOO_LONG|
00001e60  5f 4a 55 4d 50 29 3b 0a  09 09 09 09 09 65 6c 69  |_JUMP);......eli|
00001e70  66 28 63 6f 75 6e 74 46  72 65 65 28 62 6f 61 72  |f(countFree(boar|
00001e80  64 2c 72 6f 77 2c 63 6f  6c 2c 64 69 72 65 63 74  |d,row,col,direct|
00001e90  69 6f 6e 29 3e 3d 6c 65  6e 67 74 68 2d 31 29 3a  |ion)&gt;=length-1):|
00001ea0  0a 09 09 09 09 09 09 72  65 74 75 72 6e 20 28 4e  |.......return (N|
00001eb0  4f 5f 45 52 52 4f 52 2c  6e 65 77 59 2c 6e 65 77  |O_ERROR,newY,new|
00001ec0  58 29 0a 09 09 09 09 09  65 6c 73 65 3a 20 0a 09  |X)......else: ..|
00001ed0  09 09 09 09 09 72 65 74  75 72 6e 20 65 72 72 6f  |.....return erro|
00001ee0  72 43 6f 64 65 28 4e 4f  5f 46 52 45 45 5f 57 41  |rCode(NO_FREE_WA|
00001ef0  59 29 3b 0a 09 23 20 65  6c 73 65 20 6e 65 77 20  |Y);..# else new |
00001f00  70 6f 73 69 74 69 6f 6e  20 69 73 20 6f 75 74 73  |position is outs|
00001f10  69 64 65 0a 09 72 65 74  75 72 6e 20 65 72 72 6f  |ide..return erro|
00001f20  72 43 6f 64 65 28 43 41  4e 4e 4f 54 5f 47 4f 5f  |rCode(CANNOT_GO_|
00001f30  4f 55 54 53 49 44 45 29  0a 0a 64 65 66 20 69 73  |OUTSIDE)..def is|
00001f40  4f 70 70 6f 6e 65 6e 74  28 6d 79 56 61 6c 75 65  |Opponent(myValue|
00001f50  2c 76 61 6c 75 65 29 3a  0a 09 72 65 74 75 72 6e  |,value):..return|
00001f60  20 28 70 6c 61 79 65 72  43 6f 6c 6f 72 28 6d 79  | (playerColor(my|
00001f70  56 61 6c 75 65 29 20 2a  20 70 6c 61 79 65 72 43  |Value) * playerC|
00001f80  6f 6c 6f 72 28 76 61 6c  75 65 29 29 20 3c 20 30  |olor(value)) &lt; 0|
00001f90  09 0a 0a 64 65 66 20 6f  75 74 73 69 64 65 28 62  |...def outside(b|
00001fa0  6f 61 72 64 2c 72 6f 77  2c 63 6f 6c 29 3a 23 76  |oard,row,col):#v|
00001fb0  65 72 69 66 69 65 20 73  69 20 6c 61 20 70 69 c3  |erifie si la pi.|
00001fc0  a8 63 65 20 65 73 74 20  68 6f 72 73 20 64 75 20  |.ce est hors du |
00001fd0  64 61 6d 69 65 72 20 6f  75 20 6e 6f 6e 2e 0a 09  |damier ou non...|
00001fe0  72 65 74 75 72 6e 20 72  6f 77 3c 30 20 6f 72 20  |return row&lt;0 or |
00001ff0  63 6f 6c 3c 30 20 6f 72  20 72 6f 77 3e 3d 20 6c  |col&lt;0 or row&gt;= l|
00002000  65 6e 28 62 6f 61 72 64  29 20 6f 72 20 63 6f 6c  |en(board) or col|
00002010  3e 3d 20 6c 65 6e 28 62  6f 61 72 64 29 0a 0a 64  |&gt;= len(board)..d|
00002020  65 66 20 63 68 65 63 6b  4d 6f 76 65 28 62 6f 61  |ef checkMove(boa|
00002030  72 64 2c 69 2c 6a 2c 64  69 72 65 63 74 69 6f 6e  |rd,i,j,direction|
00002040  2c 70 6c 61 79 65 72 2c  6c 65 6e 67 74 68 3d 31  |,player,length=1|
00002050  2c 68 61 73 50 6c 61 79  65 64 3d 46 61 6c 73 65  |,hasPlayed=False|
00002060  2c 68 61 73 43 61 70 74  75 72 65 64 3d 46 61 6c  |,hasCaptured=Fal|
00002070  73 65 29 3a 20 23 49 63  69 20 6e 6f 75 73 20 61  |se): #Ici nous a|
00002080  6c 6c 6f 6e 73 20 76 c3  a9 72 69 66 69 65 72 20  |llons v..rifier |
00002090  73 69 20 6c 61 20 63 6f  6d 6d 61 6e 64 65 20 75  |si la commande u|
000020a0  74 69 6c 69 73 c3 a9 20  70 61 72 20 6c 65 20 6a  |tilis.. par le j|
000020b0  6f 75 65 75 72 20 65 73  74 20 76 61 6c 69 64 65  |oueur est valide|
000020c0  20 2c 20 63 27 65 73 74  20 c3 a0 20 64 69 72 65  | , c&#039;est .. dire|
000020d0  20 73 69 20 73 6f 6e 20  64 c3 a9 70 6c 61 63 65  | si son d..place|
000020e0  6d 65 6e 74 20 65 73 74  20 70 6f 73 73 69 62 6c  |ment est possibl|
000020f0  65 2e 22 0a 09 65 72 72  43 6f 64 65 2c 6e 65 77  |e.&quot;..errCode,new|
00002100  49 2c 6e 65 77 4a 20 3d  20 64 69 72 65 63 74 69  |I,newJ = directi|
00002110  6f 6e 54 6f 43 6f 6f 72  64 69 6e 61 74 65 73 28  |onToCoordinates(|
00002120  62 6f 61 72 64 2c 70 6c  61 79 65 72 2c 69 2c 6a  |board,player,i,j|
00002130  2c 64 69 72 65 63 74 69  6f 6e 2c 6c 65 6e 67 74  |,direction,lengt|
00002140  68 29 0a 09 69 66 28 65  72 72 43 6f 64 65 20 3d  |h)..if(errCode =|
00002150  3d 20 4e 4f 5f 45 52 52  4f 52 29 3a 0a 09 09 69  |= NO_ERROR):...i|
00002160  66 28 68 61 73 50 6c 61  79 65 64 29 3a 23 20 69  |f(hasPlayed):# i|
00002170  66 20 74 68 65 20 70 6c  61 79 65 72 20 68 61 73  |f the player has|
00002180  20 73 74 61 72 74 65 64  20 61 20 72 61 66 6c 65  | started a rafle|
00002190  0a 09 09 09 69 66 28 6e  6f 74 20 68 61 73 43 61  |....if(not hasCa|
000021a0  70 74 75 72 65 64 29 3a  20 72 65 74 75 72 6e 20  |ptured): return |
000021b0  4d 55 53 54 5f 43 41 50  54 55 52 45 23 20 68 65  |MUST_CAPTURE# he|
000021c0  20 6e 65 76 65 72 20 63  61 6e 20 63 6f 6e 74 69  | never can conti|
000021d0  6e 75 65 20 68 69 73 20  72 61 66 6c 65 0a 09 09  |nue his rafle...|
000021e0  09 23 20 65 6c 73 65 20  63 68 65 63 6b 20 69 66  |.# else check if|
000021f0  20 74 68 65 20 63 75 72  72 65 6e 74 20 6d 6f 76  | the current mov|
00002200  65 20 69 73 20 61 20 63  61 70 74 75 72 65 20 6d  |e is a capture m|
00002210  6f 76 65 0a 09 09 09 72  6f 77 2c 63 6f 6c 20 3d  |ove....row,col =|
00002220  20 63 6f 6d 70 75 74 65  44 69 72 65 63 74 69 6f  | computeDirectio|
00002230  6e 28 6e 65 77 49 2c 6e  65 77 4a 2c 72 65 76 65  |n(newI,newJ,reve|
00002240  72 73 65 44 69 72 65 63  74 69 6f 6e 28 64 69 72  |rseDirection(dir|
00002250  65 63 74 69 6f 6e 29 2c  70 6c 61 79 65 72 29 0a  |ection),player).|
00002260  09 09 09 69 66 28 28 6e  6f 74 20 6a 75 6d 70 28  |...if((not jump(|
00002270  6a 2c 6e 65 77 4a 29 29  20 6f 72 20 69 73 46 72  |j,newJ)) or isFr|
00002280  65 65 28 62 6f 61 72 64  2c 72 6f 77 2c 63 6f 6c  |ee(board,row,col|
00002290  29 29 3a 20 72 65 74 75  72 6e 20 4d 55 53 54 5f  |)): return MUST_|
000022a0  43 41 50 54 55 52 45 0a  09 72 65 74 75 72 6e 20  |CAPTURE..return |
000022b0  65 72 72 43 6f 64 65 0a  0a 64 65 66 20 63 6f 6d  |errCode..def com|
000022c0  70 75 74 65 44 69 72 65  63 74 69 6f 6e 28 72 6f  |puteDirection(ro|
000022d0  77 2c 63 6f 6c 2c 64 69  72 65 63 74 69 6f 6e 2c  |w,col,direction,|
000022e0  70 6c 61 79 65 72 2c 6c  65 6e 67 74 68 3d 31 29  |player,length=1)|
000022f0  3a 20 23 63 61 6c 63 75  6c 20 6c 61 20 63 6f 6c  |: #calcul la col|
00002300  6f 6e 6e 65 20 65 74 20  6c 61 20 6c 69 67 6e 65  |onne et la ligne|
00002310  20 73 75 69 76 61 6e 74  65 0a 09 64 69 72 65 63  | suivante..direc|
00002320  74 69 6f 6e 20 3d 20 64  69 72 65 63 74 69 6f 6e  |tion = direction|
00002330  2e 6c 6f 77 65 72 28 29  0a 09 72 6f 77 20 3d 20  |.lower()..row = |
00002340  72 6f 77 20 2b 20 70 6c  61 79 65 72 2a 28 6c 65  |row + player*(le|
00002350  6e 67 74 68 20 69 66 28  6c 65 6e 28 64 69 72 65  |ngth if(len(dire|
00002360  63 74 69 6f 6e 29 3e 31  29 20 65 6c 73 65 20 2d  |ction)&gt;1) else -|
00002370  6c 65 6e 67 74 68 29 3b  0a 09 69 66 28 64 69 72  |length);..if(dir|
00002380  65 63 74 69 6f 6e 5b 30  5d 20 3d 3d 20 22 6c 22  |ection[0] == &quot;l&quot;|
00002390  29 3a 20 63 6f 6c 20 3d  20 63 6f 6c 2b 28 2d 6c  |): col = col+(-l|
000023a0  65 6e 67 74 68 2a 70 6c  61 79 65 72 29 0a 09 65  |ength*player)..e|
000023b0  6c 69 66 28 64 69 72 65  63 74 69 6f 6e 5b 30 5d  |lif(direction[0]|
000023c0  20 3d 3d 20 22 72 22 29  3a 20 63 6f 6c 20 3d 20  | == &quot;r&quot;): col = |
000023d0  63 6f 6c 2b 28 6c 65 6e  67 74 68 2a 70 6c 61 79  |col+(length*play|
000023e0  65 72 29 0a 09 65 6c 73  65 3a 20 72 65 74 75 72  |er)..else: retur|
000023f0  6e 20 46 61 6c 73 65 0a  09 72 65 74 75 72 6e 20  |n False..return |
00002400  69 6e 74 28 72 6f 77 29  2c 69 6e 74 28 63 6f 6c  |int(row),int(col|
00002410  29 0a 0a 64 65 66 20 69  73 46 72 65 65 28 62 6f  |)..def isFree(bo|
00002420  61 72 64 2c 72 6f 77 2c  63 6f 6c 29 3a 0a 09 72  |ard,row,col):..r|
00002430  65 74 75 72 6e 20 62 6f  61 72 64 5b 72 6f 77 5d  |eturn board[row]|
00002440  5b 63 6f 6c 5d 20 3d 3d  20 46 52 45 45 5f 53 50  |[col] == FREE_SP|
00002450  41 43 45 0a 0a 64 65 66  20 72 65 76 65 72 73 65  |ACE..def reverse|
00002460  44 69 72 65 63 74 69 6f  6e 28 64 69 72 65 63 74  |Direction(direct|
00002470  69 6f 6e 29 3a 0a 09 64  69 72 65 63 74 69 6f 6e  |ion):..direction|
00002480  20 3d 20 64 69 72 65 63  74 69 6f 6e 2e 75 70 70  | = direction.upp|
00002490  65 72 28 29 0a 09 69 66  28 6c 65 6e 28 64 69 72  |er()..if(len(dir|
000024a0  65 63 74 69 6f 6e 29 3e  31 29 3a 20 72 65 74 75  |ection)&gt;1): retu|
000024b0  72 6e 20 22 4c 22 20 69  66 28 64 69 72 65 63 74  |rn &quot;L&quot; if(direct|
000024c0  69 6f 6e 20 3d 3d 20 22  52 42 22 29 65 6c 73 65  |ion == &quot;RB&quot;)else|
000024d0  20 22 52 22 0a 09 72 65  74 75 72 6e 20 22 52 42  | &quot;R&quot;..return &quot;RB|
000024e0  22 20 69 66 28 64 69 72  65 63 74 69 6f 6e 20 3d  |&quot; if(direction =|
000024f0  3d 20 22 4c 22 29 65 6c  73 65 20 22 4c 42 22 0a  |= &quot;L&quot;)else &quot;LB&quot;.|
00002500  0a 64 65 66 20 65 72 72  6f 72 43 6f 64 65 28 63  |.def errorCode(c|
00002510  6f 64 65 29 3a 0a 09 72  65 74 75 72 6e 20 63 6f  |ode):..return co|
00002520  64 65 2c 4e 6f 6e 65 2c  4e 6f 6e 65 0a 0a 64 65  |de,None,None..de|
00002530  66 20 69 73 4b 69 6e 67  28 62 6f 61 72 64 2c 72  |f isKing(board,r|
00002540  6f 77 2c 63 6f 6c 29 3a  0a 09 72 65 74 75 72 6e  |ow,col):..return|
00002550  20 61 62 73 28 62 6f 61  72 64 5b 72 6f 77 5d 5b  | abs(board[row][|
00002560  63 6f 6c 5d 29 3e 31 0a  0a 64 65 66 20 6f 75 74  |col])&gt;1..def out|
00002570  73 69 64 65 28 62 6f 61  72 64 2c 72 6f 77 2c 63  |side(board,row,c|
00002580  6f 6c 29 3a 20 23 72 65  74 75 72 6e 20 75 6e 65  |ol): #return une|
00002590  20 76 61 6c 65 75 72 20  62 6f 6f 65 6c 65 65 6e  | valeur booeleen|
000025a0  6e 65 20 61 66 69 6e 20  64 65 20 73 61 76 6f 69  |ne afin de savoi|
000025b0  72 20 73 69 20 6c 65 73  20 63 6f 6f 72 64 6f 6e  |r si les coordon|
000025c0  6e c3 a9 65 73 20 73 6f  6e 74 20 68 6f 72 73 20  |n..es sont hors |
000025d0  64 75 20 64 61 6d 69 65  72 73 2e 0a 09 72 65 74  |du damiers...ret|
000025e0  75 72 6e 20 72 6f 77 3c  30 20 6f 72 20 63 6f 6c  |urn row&lt;0 or col|
000025f0  3c 30 20 6f 72 20 72 6f  77 3e 3d 20 6c 65 6e 28  |&lt;0 or row&gt;= len(|
00002600  62 6f 61 72 64 29 20 6f  72 20 63 6f 6c 3e 3d 20  |board) or col&gt;= |
00002610  6c 65 6e 28 62 6f 61 72  64 29 0a 0a 64 65 66 20  |len(board)..def |
00002620  63 6f 75 6e 74 46 72 65  65 28 62 6f 61 72 64 2c  |countFree(board,|
00002630  69 2c 6a 2c 64 69 72 65  63 74 69 6f 6e 2c 70 6c  |i,j,direction,pl|
00002640  61 79 65 72 3d 4e 6f 6e  65 2c 6c 65 6e 67 74 68  |ayer=None,length|
00002650  3d 30 29 3a 0a 09 69 66  20 70 6c 61 79 65 72 3d  |=0):..if player=|
00002660  3d 4e 6f 6e 65 3a 0a 09  09 70 6c 61 79 65 72 3d  |=None:...player=|
00002670  70 6c 61 79 65 72 43 6f  6c 6f 72 28 62 6f 61 72  |playerColor(boar|
00002680  64 5b 69 5d 5b 6a 5d 29  0a 09 09 0a 09 61 2c 62  |d[i][j]).....a,b|
00002690  3d 63 6f 6d 70 75 74 65  44 69 72 65 63 74 69 6f  |=computeDirectio|
000026a0  6e 28 69 2c 6a 2c 64 69  72 65 63 74 69 6f 6e 2c  |n(i,j,direction,|
000026b0  70 6c 61 79 65 72 29 0a  09 69 66 20 28 6e 6f 74  |player)..if (not|
000026c0  20 6f 75 74 73 69 64 65  28 62 6f 61 72 64 2c 61  | outside(board,a|
000026d0  2c 62 29 20 61 6e 64 20  69 73 46 72 65 65 28 62  |,b) and isFree(b|
000026e0  6f 61 72 64 2c 61 2c 62  29 29 3a 0a 09 09 72 65  |oard,a,b)):...re|
000026f0  74 75 72 6e 20 63 6f 75  6e 74 46 72 65 65 28 62  |turn countFree(b|
00002700  6f 61 72 64 2c 61 2c 62  2c 64 69 72 65 63 74 69  |oard,a,b,directi|
00002710  6f 6e 2c 70 6c 61 79 65  72 2c 6c 65 6e 67 74 68  |on,player,length|
00002720  2b 31 29 0a 09 0a 09 65  6c 73 65 3a 0a 09 09 72  |+1)....else:...r|
00002730  65 74 75 72 6e 20 6c 65  6e 67 74 68 0a 09 0a 0a  |eturn length....|
00002740  64 65 66 20 63 68 65 63  6b 45 6e 64 4f 66 47 61  |def checkEndOfGa|
00002750  6d 65 28 62 6f 61 72 64  2c 70 6c 61 79 65 72 29  |me(board,player)|
00002760  3a 0a 09 6d 6f 76 65 73  3d 20 7b 57 48 49 54 45  |:..moves= {WHITE|
00002770  5f 50 4c 41 59 45 52 3a  46 61 6c 73 65 2c 09 42  |_PLAYER:False,.B|
00002780  4c 41 43 4b 5f 50 4c 41  59 45 52 3a 46 61 6c 73  |LACK_PLAYER:Fals|
00002790  65 7d 0a 09 70 69 65 63  65 73 09 3d 20 7b 57 48  |e}..pieces.= {WH|
000027a0  49 54 45 5f 50 4c 41 59  45 52 3a 30 2c 09 09 42  |ITE_PLAYER:0,..B|
000027b0  4c 41 43 4b 5f 50 4c 41  59 45 52 3a 30 7d 0a 09  |LACK_PLAYER:0}..|
000027c0  66 6f 72 20 72 6f 77 20  69 6e 20 72 61 6e 67 65  |for row in range|
000027d0  28 6c 65 6e 28 62 6f 61  72 64 29 29 3a 0a 09 09  |(len(board)):...|
000027e0  66 6f 72 20 63 6f 6c 20  69 6e 20 72 61 6e 67 65  |for col in range|
000027f0  28 6c 65 6e 28 62 6f 61  72 64 29 29 3a 0a 09 09  |(len(board)):...|
00002800  09 69 66 28 6e 6f 74 20  69 73 46 72 65 65 28 62  |.if(not isFree(b|
00002810  6f 61 72 64 2c 72 6f 77  2c 63 6f 6c 29 29 3a 23  |oard,row,col)):#|
00002820  20 61 20 70 69 65 63 65  20 69 6e 20 78 2c 79 0a  | a piece in x,y.|
00002830  09 09 09 09 63 6f 6c 6f  72 20 3d 20 70 6c 61 79  |....color = play|
00002840  65 72 43 6f 6c 6f 72 28  62 6f 61 72 64 5b 72 6f  |erColor(board[ro|
00002850  77 5d 5b 63 6f 6c 5d 29  0a 09 09 09 09 70 69 65  |w][col]).....pie|
00002860  63 65 73 5b 63 6f 6c 6f  72 5d 20 3d 20 70 69 65  |ces[color] = pie|
00002870  63 65 73 5b 63 6f 6c 6f  72 5d 20 2b 20 31 0a 09  |ces[color] + 1..|
00002880  09 09 09 69 66 28 6e 6f  74 20 6d 6f 76 65 73 5b  |...if(not moves[|
00002890  63 6f 6c 6f 72 5d 29 3a  0a 09 09 09 09 09 66 6f  |color]):......fo|
000028a0  72 20 64 69 72 65 63 74  69 6f 6e 20 69 6e 20 28  |r direction in (|
000028b0  22 4c 22 2c 22 52 22 2c  22 4c 42 22 2c 22 52 42  |&quot;L&quot;,&quot;R&quot;,&quot;LB&quot;,&quot;RB|
000028c0  22 29 3a 0a 09 09 09 09  09 09 69 66 28 63 68 65  |&quot;):.......if(che|
000028d0  63 6b 4d 6f 76 65 28 62  6f 61 72 64 2c 72 6f 77  |ckMove(board,row|
000028e0  2c 63 6f 6c 2c 64 69 72  65 63 74 69 6f 6e 2c 63  |,col,direction,c|
000028f0  6f 6c 6f 72 29 20 3d 3d  20 4e 4f 5f 45 52 52 4f  |olor) == NO_ERRO|
00002900  52 29 3a 0a 09 09 09 09  09 09 09 6d 6f 76 65 73  |R):........moves|
00002910  5b 63 6f 6c 6f 72 5d 20  3d 20 54 72 75 65 0a 09  |[color] = True..|
00002920  69 66 28 70 69 65 63 65  73 5b 57 48 49 54 45 5f  |if(pieces[WHITE_|
00002930  50 4c 41 59 45 52 5d 2b  70 69 65 63 65 73 5b 42  |PLAYER]+pieces[B|
00002940  4c 41 43 4b 5f 50 4c 41  59 45 52 5d 20 3d 3d 20  |LACK_PLAYER] == |
00002950  30 29 3a 20 72 65 74 75  72 6e 20 30 23 20 6e 65  |0): return 0# ne|
00002960  76 65 72 20 68 61 70 70  65 6e 0a 09 69 66 28 70  |ver happen..if(p|
00002970  69 65 63 65 73 5b 57 48  49 54 45 5f 50 4c 41 59  |ieces[WHITE_PLAY|
00002980  45 52 5d 20 3d 3d 20 30  29 3a 20 72 65 74 75 72  |ER] == 0): retur|
00002990  6e 20 42 4c 41 43 4b 5f  50 4c 41 59 45 52 0a 09  |n BLACK_PLAYER..|
000029a0  69 66 28 70 69 65 63 65  73 5b 42 4c 41 43 4b 5f  |if(pieces[BLACK_|
000029b0  50 4c 41 59 45 52 5d 20  3d 3d 20 30 29 3a 20 72  |PLAYER] == 0): r|
000029c0  65 74 75 72 6e 20 57 48  49 54 45 5f 50 4c 41 59  |eturn WHITE_PLAY|
000029d0  45 52 0a 09 23 20 65 6c  73 65 20 74 68 65 79 20  |ER..# else they |
000029e0  68 61 76 65 20 70 69 65  63 65 73 0a 09 69 66 28  |have pieces..if(|
000029f0  28 6e 6f 74 20 6d 6f 76  65 73 5b 70 6c 61 79 65  |(not moves[playe|
00002a00  72 5d 29 20 61 6e 64 20  28 6e 6f 74 20 6d 6f 76  |r]) and (not mov|
00002a10  65 73 5b 2d 70 6c 61 79  65 72 5d 29 29 3a 20 72  |es[-player])): r|
00002a20  65 74 75 72 6e 20 30 0a  09 72 65 74 75 72 6e 20  |eturn 0..return |
00002a30  46 61 6c 73 65 20 69 66  28 6d 6f 76 65 73 5b 70  |False if(moves[p|
00002a40  6c 61 79 65 72 5d 29 65  6c 73 65 20 2d 70 6c 61  |layer])else -pla|
00002a50  79 65 72 0a 0a 0a 0a 64  65 66 20 73 61 76 65 28  |yer....def save(|
00002a60  66 69 6c 65 6e 61 6d 65  2c 62 6f 61 72 64 2c 70  |filename,board,p|
00002a70  6c 61 79 65 72 29 3a 0a  09 66 64 3d 6f 70 65 6e  |layer):..fd=open|
00002a80  28 66 69 6c 65 6e 61 6d  65 2c 22 77 22 29 0a 09  |(filename,&quot;w&quot;)..|
00002a90  73 61 76 65 3d 5b 5d 0a  09 74 78 74 3d 22 22 0a  |save=[]..txt=&quot;&quot;.|
00002aa0  09 66 64 2e 77 72 69 74  65 28 73 74 72 28 70 6c  |.fd.write(str(pl|
00002ab0  61 79 65 72 29 2b 22 5c  6e 22 29 0a 09 66 64 2e  |ayer)+&quot;\n&quot;)..fd.|
00002ac0  77 72 69 74 65 28 73 74  72 28 6c 65 6e 28 62 6f  |write(str(len(bo|
00002ad0  61 72 64 29 29 2b 22 5c  6e 22 29 0a 09 66 6f 72  |ard))+&quot;\n&quot;)..for|
00002ae0  20 69 20 69 6e 20 62 6f  61 72 64 3a 0a 09 09 69  | i in board:...i|
00002af0  2e 61 70 70 65 6e 64 28  22 5c 6e 22 29 0a 09 09  |.append(&quot;\n&quot;)...|
00002b00  66 6f 72 20 6a 20 69 6e  20 69 3a 0a 09 09 09 73  |for j in i:....s|
00002b10  61 76 65 2e 61 70 70 65  6e 64 28 73 74 72 28 6a  |ave.append(str(j|
00002b20  29 2b 22 20 22 29 0a 09  66 6f 72 20 69 20 69 6e  |)+&quot; &quot;)..for i in|
00002b30  20 73 61 76 65 3a 0a 09  09 74 78 74 3d 74 78 74  | save:...txt=txt|
00002b40  2b 69 0a 09 66 64 2e 77  72 69 74 65 28 74 78 74  |+i..fd.write(txt|
00002b50  29 0a 09 66 64 2e 63 6c  6f 73 65 28 29 0a 0a 64  |)..fd.close()..d|
00002b60  65 66 20 6c 6f 61 64 28  66 69 6c 65 6e 61 6d 65  |ef load(filename|
00002b70  29 3a 0a 09 66 64 3d 6f  70 65 6e 28 66 69 6c 65  |):..fd=open(file|
00002b80  6e 61 6d 65 29 0a 09 66  64 3d 66 64 2e 72 65 61  |name)..fd=fd.rea|
00002b90  64 28 29 0a 09 66 64 3d  66 64 2e 73 70 6c 69 74  |d()..fd=fd.split|
00002ba0  28 22 5c 6e 22 29 0a 09  70 6c 61 79 65 72 3d 66  |(&quot;\n&quot;)..player=f|
00002bb0  64 5b 30 5d 0a 09 64 69  6d 65 6e 73 69 6f 6e 3d  |d[0]..dimension=|
00002bc0  66 64 5b 31 5d 0a 09 64  65 6c 28 66 64 5b 30 5d  |fd[1]..del(fd[0]|
00002bd0  29 0a 09 64 65 6c 28 66  64 5b 30 5d 29 0a 09 66  |)..del(fd[0])..f|
00002be0  6f 72 20 69 20 69 6e 20  72 61 6e 67 65 28 6c 65  |or i in range(le|
00002bf0  6e 28 66 64 29 29 3a 0a  09 09 66 64 5b 69 5d 3d  |n(fd)):...fd[i]=|
00002c00  66 64 5b 69 5d 2e 73 74  72 69 70 28 29 0a 09 09  |fd[i].strip()...|
00002c10  66 64 5b 69 5d 3d 66 64  5b 69 5d 2e 73 70 6c 69  |fd[i]=fd[i].spli|
00002c20  74 28 29 0a 09 66 6f 72  20 6a 20 69 6e 20 72 61  |t()..for j in ra|
00002c30  6e 67 65 28 6c 65 6e 28  66 64 5b 69 5d 29 29 3a  |nge(len(fd[i])):|
00002c40  0a 09 09 66 64 5b 69 5d  5b 6a 5d 3d 69 6e 74 28  |...fd[i][j]=int(|
00002c50  66 64 5b 69 5d 5b 6a 5d  29 0a 09 69 66 20 66 64  |fd[i][j])..if fd|
00002c60  5b 2d 31 5d 3d 3d 5b 5d  3a 0a 09 09 64 65 6c 28  |[-1]==[]:...del(|
00002c70  66 64 5b 2d 31 5d 29 0a  09 62 6f 61 72 64 3d 66  |fd[-1])..board=f|
00002c80  64 0a 09 72 65 74 75 72  6e 20 70 6c 61 79 65 72  |d..return player|
00002c90  2c 64 69 6d 65 6e 73 69  6f 6e 2c 62 6f 61 72 64  |,dimension,board|
00002ca0  0a                                                |.|
00002ca1</code></pre></div><p>a l&#039;avant derniere ligne j&#039;ai 0a c&#039;est bon non? </p><p>2) pingouinux voial pour ta demande:</p><div class="codebox"><pre><code>Traceback (most recent call last):
  File &quot;runTests.py&quot;, line 6, in &lt;module&gt;
    from testCases import *
  File &quot;/home/alain/Bureau/dossier projet année/testCases.py&quot;, line 2, in &lt;module&gt;
    from draughtsFunctions import *
  File &quot;/usr/lib/python3.2/encodings/__init__.py&quot;, line 83, in search_function
    norm_encoding = normalize_encoding(encoding)
  File &quot;/usr/lib/python3.2/encodings/__init__.py&quot;, line 59, in normalize_encoding
    for c in encoding:
EOFError: EOF read where not expected</code></pre></div><p>voila la partie du programme contenant la ligne 59:</p><div class="codebox"><pre class="vscroll"><code>def printBoard(board,player): #Initialise un damier à partir de la matrice crée par&quot;InitBoard&quot;
	joueur = player
	if joueur==WHITE_PLAYER:
		for i in range(DIMENSION):
			for j in range(DIMENSION):
				if board[i][j]==BLACK_PLAYER:
					print(BLACK_PAWN,end=&quot; &quot;)
				elif board[i][j]==WHITE_PLAYER:
					print(WHITE_PAWN,end=&quot; &quot;)
				elif board[i][j]==black_king_player:
						print(BLACK_KING,end=&quot; &quot;)
				elif board[i][j]==white_king_player:
						print(WHITE_KING,end=&quot;  &quot;)
				elif (i+j)%2==0: #Nous allons tester si le case est paire car si tel est le cas nous savons qu&#039;il y aura un &quot;WHITE SQUARE&quot; car le case sera blanche.
					print(WHITE_SQUARE, end=&quot; &quot;)
				else: 
					print(BLACK_SQUARE, end=&quot; &quot;)
			print (&quot; | &quot;, i+1)
		print (&quot;_ &quot;*(DIMENSION), end=&quot;&quot;)
		print ()
		for i in range (DIMENSION):
			print (chr(97+i), end=&quot; &quot;) #cette étape permet d&#039;avoir la bonne lettre étant donné que les dimensions de la matrice sont modifiables.
		print ()
	else:
		for i in range(DIMENSION-1,-1,-1):
			for j in range(DIMENSION-1,-1,-1):
				if board[i][j]==BLACK_PLAYER:
					print(BLACK_PAWN, end=&quot; &quot;)
				elif (board[i][j]==1):
					print(WHITE_PAWN, end=&quot; &quot;)
				elif board[i][j]==black_king_player:
					print(BLACK_KING,end=&quot; &quot;)
				elif board[i][j]==white_king_player:
					print(WHITE_KING,end=&quot; &quot;)
				elif(i+j)%2==0:
					print(WHITE_SQUARE, end=&quot; &quot;)
				else:
					print(BLACK_SQUARE, end=&quot; &quot;)
			print (&quot; | &quot;, i+1)
		print (&quot;_ &quot;*(DIMENSION), end=&quot;  &quot;)
		print ()
		for i in range (DIMENSION-1, -1, -1):
			print (chr(i+97), end=&quot; &quot;)
	return board</code></pre></div><p>tu en dis quoi?</p>]]></description>
			<author><![CDATA[dummy@example.com (idragus)]]></author>
			<pubDate>Mon, 21 Jan 2013 17:44:27 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12291711#p12291711</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12291251#p12291251</link>
			<description><![CDATA[<p>Ton fichier de scripte a peut-être été coupé dans un fausse manip.<br />Regardes si le dernier caractère du fichier est bien &#039;0A&#039;.</p><div class="codebox"><pre><code>hd nom_duporgramme.py</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (Maisondouf)]]></author>
			<pubDate>Mon, 21 Jan 2013 17:15:18 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12291251#p12291251</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290931#p12290931</link>
			<description><![CDATA[<p>Peux-tu élaguer le programme en ne laissant que le strict minimum pour qu&#039;il plante ?</p>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 21 Jan 2013 16:52:31 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290931#p12290931</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290781#p12290781</link>
			<description><![CDATA[<p>je met tout le prgramme ou juste la ligne où il me met une erreur?&#160; parce que le programme en entier fait a peu pres 360 ligne de code^^</p>]]></description>
			<author><![CDATA[dummy@example.com (idragus)]]></author>
			<pubDate>Mon, 21 Jan 2013 16:40:22 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290781#p12290781</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290651#p12290651</link>
			<description><![CDATA[<p>Bonjour,<br />Si tu veux vraiment de l&#039;aide, fais un copier-coller de la commande que tu lances, et du résultat obtenu. En plus, l&#039;idéal serait de voir le programme (entre balises-codes <span style="color: #0f9fff">&lt;&gt;</span>).</p><p><span class="bbu">Ajouté</span> :<br />Information trouvée <a href="http://docs.python.org/2/library/exceptions.html">ici</a></p><div class="quotebox"><blockquote><div><p>exception EOFError</p><p>&#160; &#160; Raised when one of the built-in functions (input() or raw_input()) hits an end-of-file condition (EOF) without reading any data. (N.B.: the file.read() and file.readline() methods return an empty string when they hit EOF.)</p></div></blockquote></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 21 Jan 2013 16:27:14 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290651#p12290651</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290491#p12290491</link>
			<description><![CDATA[<p>il me dit que ça vient d&#039;une ligne du programme mais pourtant je n&#039;ai rien changé au programme depuis hier alors bon c est bizarre</p>]]></description>
			<author><![CDATA[dummy@example.com (idragus)]]></author>
			<pubDate>Mon, 21 Jan 2013 16:18:22 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290491#p12290491</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290421#p12290421</link>
			<description><![CDATA[<p>bah en gros j&#039;ai un programme &quot;.py&quot; dans mon bureau et quand je fais cd Bureau/ python 3 nom_duporgramme.py </p><p>le terminal me met cette erreur</p>]]></description>
			<author><![CDATA[dummy@example.com (idragus)]]></author>
			<pubDate>Mon, 21 Jan 2013 16:16:45 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290421#p12290421</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290391#p12290391</link>
			<description><![CDATA[<div class="quotebox"><cite>idragus a écrit&#160;:</cite><blockquote><div><p> j&#039;ai un problème de EOFError</p></div></blockquote></div><p>C&#039;est bien...<br />Mais ça serait bien de dire qui t&#039;annonce cette erreur.</p>]]></description>
			<author><![CDATA[dummy@example.com (Maisondouf)]]></author>
			<pubDate>Mon, 21 Jan 2013 16:14:20 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290391#p12290391</guid>
		</item>
		<item>
			<title><![CDATA[problème python EOFError]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290071#p12290071</link>
			<description><![CDATA[<p>Bonjour j&#039;ai installé hier Ubuntu 12.0.4 LTS sur une virtual Box et aujourd&#039;hui en essayant de programmer (avec sublime Text 2 comme éditeur de texte) j&#039;ai un problème de EOFError&#160; mais je ne comprend pas pourquoi car hier j&#039;ai réussi à programmer sans problème et aujourd&#039;hui j&#039;ai ce problème.Pouvez vous m&#039;aider a résoudre mon problème svp? </p><br /><p>Merci d&#039;avance</p><p>ps: sur Windows je n&#039;ai pas ce problème</p>]]></description>
			<author><![CDATA[dummy@example.com (idragus)]]></author>
			<pubDate>Mon, 21 Jan 2013 15:50:32 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=12290071#p12290071</guid>
		</item>
	</channel>
</rss>
