{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 " Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 1 3 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Maple O utput" -1 12 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE " " -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}{PARA 7 "" 1 "" {TEXT -1 80 "Warning , the protected names norm and trace have been redefined and unprotect ed\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT 256 16 "Le jeu de Chomp." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 34 "On d\351finit les dimensions du jeu :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "m:=8:\nn:=9:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 69 "On calcule les positions admiss ibles \340 partir d'une position donn\351e :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 248 "successeur:=proc(som)\nlocal s,i,j,k,suc :\nsuc:=[]:\nfor i from 0 to m do\nfor j from 0 to n do\nif not(j=0 an d i = m) then\ns:=[seq(min(som[k],j),k=1..i),seq(som[k],k=i+1..m)]:\ns uc:=[op(\{op(suc),s\})]:\nfi:\nod:\nod:\nsuc := [op(\{op(suc)\} minus \+ \{som\})];\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 36 "On calcule le noyau par r\351currence :" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 234 "noyau:=proc(som)\noption remember:\nlocal s: \nif som = [seq(0,i=1..m)] then return false:\nelse\nif som = [seq(0,i =2..m),1] then return true:\nelse\nfor s in successeur(som) do\nif noy au(s) then return false: fi:\nod:\nreturn true:\nfi:\nfi:\nend:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 147 "On d\351finit enfin la s trat\351gie de jeu : on part d'une position dans le noyau qui oblige l 'adversaire \340 en sortir, et on y retourne le coup d'apr\350s :" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 202 "strategie:=proc(s om)\nlocal s,suc:\nif noyau(som) then return successeur(som)[1]:\nelse \nsuc:=[op(\{op(successeur(som))\} minus \{[seq(0,i=1..m)]\})];\nfor s in suc do\nif noyau(s) then return s: fi:\nod:\nfi:\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "On peut m\352me visualiser les \+ coups \340 jouer sur une matrice :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 112 "visual:=proc(s)\nlocal i,j,A:\nA:=[seq([seq(O,j=1. .s[i]),seq(x,j=s[i]+1..n)],i=1..m)];\nA:=convert(A, Matrix);\nend:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 21 "La proc\351dure finale : " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "jeu:=proc(som)\nlocal s:\ns:=strategie(som):\nprint(s ):\nvisual(s);\nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "s:=successeur([9,9,9,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F5F5F5F5F5F5F'F'7*F7F7F7F7F7 F7F'F'7*F9F9F9F9F9F9F'F'7*F)F)F)F)F)F)F)F'7*F+F+F+F+F+F+F+F'7*F-F-F-F- F-F-F-F'7*F/F/F/F/F/F/F/F'7*F1F1F1F1F1F1F1F'7*F3F3F3F3F3F3F3F'7*F5F5F5 F5F5F5F5F'7*F7F7F7F7F7F7F7F'7*F9F9F9F9F9F9F9F'7*F+F+F+F+F+F+F+F+7*F-F- F-F-F-F-F-F-7*F/F/F/F/F/F/F/F/7*F1F1F1F1F1F1F1F17*F3F3F3F3F3F3F3F37*F5 F5F5F5F5F5F5F57*F7F7F7F7F7F7F7F77*F9F9F9F9F9F9F9F9" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "for som in s do\nif noyau(som) then print(s om):\nfi;\nod;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7*\"\"'F$F$\"\"*F%F% F%F%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "visual([6, 6, 6, 9, 9, 9, 9, 9]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'RTABLEG6%\")?d+>- %'MATRIXG6#7*7+%\"OGF,F,F,F,F,%\"xGF-F-F+F+7+F,F,F,F,F,F,F,F,F,F.F.F.F .%'MatrixG" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "29 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }{RTABLE_HANDLES 19005720 }{RTABLE M7R0 I5RTABLE_SAVE/19005720X,%)anythingG6"6"[gl!"%!!!#co")"*%"OGF'F'F'F'F'F'F'F'F'F' F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'F'%"xGF (F(F'F'F'F'F'F(F(F(F'F'F'F'F'F(F(F(F'F'F'F'F'F& }