tkyahtzee

 

par David Cobac


J'aime les jeux simples ! Je voulais aussi mettre en application le "test du poker" que j'ai découvert lors d'un stage très enrichissant sur les possibilités des calculatrices : j'ai alors appris que si on a, par exemple, cinq nombres A,..,E et qu'on veut connaître le nombre de brelans, de paires, de carrés etc. il est possible d'utiliser la somme S=(A=B)+(A=C)+(A=D)+...+(D=E) qui permet par ses valeurs de tester ce qu'on a obtenu !

N'ayant pas réussi à mettre ceci en place pour les petites et grandes suites, j'ai simplement testé pour ces deux cas l'exhaustivité des résulats possibles (3 dans le cas des P.S. et 2 pour les G.S.).

Les images des dés m'ont été fournies par l'inarrêtable Kroc.

utilisation

Évidente ! si vous connaissez le petit jeu électronique... c'est quasiment le même !

Les flêches servent à sélectionner les différents items une fois vos lancers effectués et ok permet de valider le choix.

Il faut 63 points sur les numéros pour avoir un bonus de 35 points, le premier yahtzee rapporte 50 points, les suivants 100 (et vous devez alors sélectionner une nouvelle case).

Le son n'est pas encore disponible.

screenshot

Le code

    #! /usr/bin/wish
    # auteur : david cobac
    # une adaptation d'un jeu électronique

    proc auteur {} {
        set date {mars 2002}
        set version 0.1
        toplevel .moi
        wm resizable .moi false false
        wm overrideredirect .moi 1
        set x0 [expr ([winfo screenwidth .]-[winfo reqwidth .moi])/2]
        set y0 [expr ([winfo screenheight .]-[winfo reqheight .moi])/2]
        wm geometry .moi +[expr $x0]+[expr $y0]
        frame .moi.cadre1 -relief ridge -borderwidth 2
        set montexte "David Cobac\nPage Web :\
                http://dcobac.free.fr\nemail : dcobac@free.fr\nTkYahtzee\nversion : $version\n$date"
        label .moi.cadre1.present -text "$montexte" -background white
        #label .moi.cadre1.photo -image $mp -background white
        pack .moi.cadre1
        pack .moi.cadre1.present -side right -fill both
        #pack .moi.cadre1.photo -side left
        update
        grab -global .moi
        bind .moi <Enter> {destroy .moi}
    }

    #images de D. Zolli
    set datade1 {R0lGODlhHAAcAPcAANnZ2Ti6Tji1TT26UjirQzChOjCmQD3DU03bYVTbbFfbckbTZEPTVz3H
        TjjHRSuvNy+qOkrXY0/ebFneclziblneblTeaVnbbEjXXDrLTSy1OSOfLzayQDjHSlTebF/e
        eUPTXTLDQC+nOE+6XUHPVE/bZ1nbZ0/XZ1/bcl/ieFneeTfCRTCbOF++b1fHZ1/ebFTbYVTb
        aEHXWSy6PTCVN0OmTW/DfU/PYV/eck/iaVTTZ1nPe1/beU/eYTDBRTSWOyiFL4DTkCRZN0qb
        hZfiz5frvyieM3vDhnXXhUrDWAwgHT2FbpfXy7vu3lzicE/XbiimOh+QJxx5IxVOFZLLnWzX
        fUbTUmTeeBQzICROQFSWg3XDmiSrNhmMHxpdIA87E1zDaKzXtXXXiz3XUUa6UjSQQT2bTiGb
        KhRoFhQ3FgkoDh18J2THbrzWw5LenTjTTBuJIxFOEQ8jEQgWCh9zI2nLc7HRurHbumTedVTi
        bj3LWBhuGRRAFBQjGg8dEazitSOrLxRdFhczGRogIBYVGZ3PptDl1KzgsDjDSSirMhcnHRcj
        HRQVFm/DeXXHg6fXqyW0MiymMhQgFiMjJx0dICOPKySWKiimLz2wSG/Pf1THYTrNSTC+Oiy6
        NDC6OBVTHB0jIyR/Jx1uHRlpHR1/IyqQLy2vMSSwLhczHRpdHRVTFhxYFxxdFxtjGhdYFxxz
        ICGFKCGWJh+hKiGwKyR5KhsoICErJygoKBpYFBdTFBpTERtYERRdHRhfGSGhJySmKyFYJyIh
        IxNOGRhYGR5dFBZJERdOFCGLJh1AIxFTGRVAERFJExFOExROFBozIx0aIBFFExhGERdFFBhJ
        FCFuIxU3DxQ3ERhOERhkIBFTFwozDBpjIxFdGBEzExQ5FBdFFxNAFhpdIww7EQw3DhEvDwwz
        DhFGFggjDP//////////////////////////////////////////////////////////////
        /////////////////////////////////yH5BAEAAAAALAAAAAAcABwAAAj/AAEIHEgQQAAB
        AwgUKFiwYEEDBxAkUJAgwQIGDRw8KFiQIIQDESRMoFDBgoULFRJgyKBhQ8GCADh0sOChggcF
        HhJcqPDhg4ILIEJoEFFw4AgSJSoouFDBxIkECRSgSKEChQIEDlawKAighYsTCRK8qHAhgQkY
        J2JciOHBgwIFMmZwoEGwho0bJSxMwBEDRg4dO3jEqNCjhwUPHkr4EPEDyEAbQWQkUIAjhokK
        J4QMIVIkQYweFhIkSBDBCA0gAoEcQSIjgYoPCVC8SKJkCZMmOEpYoODkwpMnUKJImQKgBpUq
        VkrgwHHlyoQKWLJo2YLCRAUnLywgWMCli5cvAMCE/xEzpsQEHDhQ4KBApowZMBNeUHBCIUYE
        EGfQpFGzhk0bgG7enJigYgKOCzgqRDiB4woOHBQsWDhxAE4cOXPo1LFzRweGEhcq4HiBB4eF
        FzhwvHDiJI8EPTP28Onjx0gdO23+gMAgYYKTDx/w4HlhoQKOCnlS6PABKJCgQYREjCjUxtAh
        FBESWJigAgUPHihiWPDgoQSiRHDSKFrESASEGo0cPTrkhkcEDAg84PigYkICCRE6QIokRdIk
        SgDOVLJ06UwkTGAyaVqxYpMVBjIYkAjBqZOnSJ+UgBoEIMqZKKFEjRJFh1SlUokemDI1o9Mp
        SJ1meCqFCtQkSgAArKGTSvjVKlatXAVq9QpWlFiyZp0ClEiEKVq1bN0CAADAqFSrWOHKpQvX
        LlasePXaQ+pMLF+/TAECNijYJAAAAAAQNmwVQGKrihnbpQtXrimqcvE6ZumXrErIBlEKBgAA
        AADJhuXKlStXMWPFlC1j1kxVMVV0YP2C5exZMIAABA4cBi3aMmOqjBWLJm1aMWPGiq2iFkvK
        IkIDBwpctkxVsylTmjVTVs2asmm4ro2Sgk0So4EDBwLI1mzZlCnL+FTTVk3aFD6ftnHrNnDg
        wIEAoEGDxgcaH2/WvkkDF+6TuIEDBw4cKFDbOHLlxpnjA07YOYAABA4kWNDgwYMBAQA7}
    set datade2 {R0lGODlhHAAcAPcAANnZ2Ti3TT26UjirQzChOjCmQD3DU0rbY1LbblfbckbTZEPTVz3HTjfE
        Qy6uNy+qOk3XYFTebFneclneblTeZVnbbEjXXDrLTSy1OSOfLzS1QTjFSVzeeEPTXTLDQC6m
        N0+6XUHPVE/bZ1/ebFTbaFTXaFTLaEq6eXXXq3XilzjLRTCbOF++b1vEZyRoMyRjTnXHvr/x
        5YDlnz3XUTC6OjiwQDCVN0OmTW/Pf1THYVnXbCFYJxpFNmS1obHi1oDenzDDRTSWOyiFL2/D
        fYDTkEHXWV/ecjihRR1AIyRTQEqWaCieM3vDhnXXhV/ieE/DeW/blmnegErHXU/Xbh+QJx15
        IxVOFZLLnUbTUiRdMz2Lc4zXy6fuz2nihVzicFnia0/XZyesNhmMHxlhIA87E6zXtXXXi0/T
        aBcnHTBpWIDHurbo13XejyGbKhRdFhQ3FgkoDh18J2THbrzWw5LenTjTTCFYLxQrKzhjXV+h
        f1nPbmXeeVLiZxyOIxROEQ8jEQgWCh9zI2nLc7HRurHbul/ldUG1TT3LWBhuGRQjGg8dEazi
        tVTibjK+QiOqLRczGRogIBYVGZ3PptDl1KzgsF/beSS1MRNAFhcjHRQVFnXHg6fXqyymMhQg
        FiMjJx0dICSWKiGWJj2wSD3PSTC+Oii1NyirMhZSHCIhIyOPKyR/JxxzIB1uIB1/IyywMy+4
        NySwLiy6NCqQLxczHR0jIxpdGhxYFxpYFBxdFxtjGhlpHSGLJiSmKyGwKyR5KhsoICQpJxdd
        HRhYGRdTFBtYER5dFB+hKiGhJxJPGBtTFBZJERROFBFTFxFdGBdFKx0aIBdOFBVAERFJExVT
        FhpTFyGFKBEvIBFFExhGERFGFhQ7ERhJFBdFFBU3DwozDBpgIxM1FBM/ExQ3ERdFFww7EQwz
        DggjDP//////////////////////////////////////////////////////////////////
        /////////////////////////////////yH5BAEAAAAALAAAAAAcABwAAAj/AAEIHEgQQIAA
        AgYQKFiwYMECBg4gSIAAgYIFDBo4KFiQ4AMDECJImDCBAoUKEyJYuIAhQ8GCADRsoBAhQgQJ
        ERAgmMCBgwQEHTxg+FBwIIgQIiYkGFGBRIkKCBJwMHECRYoDKhqsKAiARQsRCBCMqFChAokD
        JEhAcPECRgwZM2jUsEHwBo4cIihIkEDhAIkKJUjogLCDRw8fPw4A+RBEyMAhRIpESGCEBAkS
        FESIIFEhwREkSZSYQKBgiQ0hAoUwabIAgRMTT6BEoUCCBIUJCCJAkDIlAYIpBKhUsQLgxhUc
        WEhMyaJlC5cuEypUGGEkQgQvX0iAURBGzBgyAFqU/zEzQ8QZNGnUrGFDgUIFCUZGfPny5cCB
        Dm3cvIETR84cgHTqIHBi5w6ePHpIkKBgZI8RI1748AFjoI+fP4ACCRpEqMQCBIWkGCphZMSI
        CkaMjBjhJQKCQxgQkUmkaImgQXMWQbAgwosTDnv2VBhBokKFL4ycgGnkyM0jSJE+SJE0ZxKl
        ShAQRPAiYY8RDkYmIJggQcQGS30uocGU6QOBG4I0baJEp5IFCyIiVOLAIQKFCBY2WOIUqJOn
        TwDaUAGVIdQSUS1w5GjkYRSWBRYWXABCylIpU6cwoYIEgAqoVKpWIWIVqFWqDKYcmHL1qpQl
        WLFIvZI1i5anTwAAtKpSy/jWLVy5bNnStWrXLlC8esFyZMqBK1+/gAEDAADAmGDCat0aNuwW
        sWK4guVCtCqUsWO8TDnaAYmWJwAAAABAZssWwGLJlClL5ufWMmbCmDXbBYqXsVTOID1DBQAA
        AADITg0bNmwYtGHKoi2TtmyaMmqBqh2rZi0SKoAABA4Mdk2ZtGXQkinDhk2ZMmjQlNmKQ0UV
        mkgDBwqUlm3aMivQli27pk2btm3JlOmqMiZRpoEDBwJgNiybFSvconXz1m2blWinvrkBN3Dg
        wIEApF0LF45bOHDixnG7NOYUuYEDBw4cKNBbuXLluo27dMmKOYAABA4kWNDgwYMBAQA7}
    set datade3 {R0lGODlhHAAcAPcAANnZ2Ti3TT26UjirQzCeODCmQD3DU0jbYFTbbFTbc0/XZ0PTVz3HTjfE
        Qy6uNy+qOk3XYVLea1neclneblTeaUrXXzrLTSy1OSOfLzS1QTjFSVTbZWXeeVzeeEPTXTLD
        QC6mN0+6XUHPVE/bZ1zbc1/ebF/bb1nbbFTLaEq6eXXXq3XilzjLRV++b1fHZyRoMyRjTnXH
        vr/x5YDlnzrVTjC6OjiwQDCVN0OmTW/DfUzOYVTbYVLiZ1nPe1/beSFYJxpFNmS1obHi1ozb
        rEbbXzDDRTSWOyiFL3vVj1/eciNWN0+ZhZfiz5frvzihRR1AIyROQEqWaCieM3jFhnXXhUHX
        WVLHYxQiGD2FbprXy7vu3lTibkrHYU/ZbiimOh+QJx15IxVOFZLLnW/Pf0bTUj2bXW/Pqozl
        tl/ieBozI3XDmlnia0bTZBmMHxpdIg87E1zDaK/Ztyh5Ox1JO2nDr7br4pLrtVzicDSQQT2b
        TiGbKhRoFhQ3FgkoDh18J2THbrzWw5LdniRuNxQzK1ShkByOIxROEQ8jEQgWCh9zI2nLc7HR
        ujiFTj3LWBhuGQ8dEazitVnXbFTTZzK+QiOqLRRdFhczGxwfIBYVGZ3PptDl1KzgsCS1MRNA
        FhsoIBcjHRQVFiirMm/DeafXqyymMh1uICIhIyGWJmnLeT3LUjC+Oii1NyesNhZSHCSWKiGL
        JiR/JxxzIB2FIyqQLyywMy+4NyOwLCy6NCOPKx0jIxpdGhxYFxpYFBxdFxtjGiSmKyR5Khcn
        HSQpJyMjJxlpHRddHRhTFBtYER+hKiGhJxNOGRdIERdIExpTERZUFh0aIBFTGRpTFxdOFBVA
        ERFTFxFFExhYGSFuIxFJExU3DxQ6ERhkIBFOExdFFxRAFAozDBpjIxFdGBEzExQ5FAw5DxEv
        DxFGFggjDP//////////////////////////////////////////////////////////////
        /////////////////////////////////yH5BAEAAAAALAAAAAAcABwAAAj/AAEIHEgQQIAA
        AgYQKFiwYMECBg4gSIAAgYIFDBo4KFiQ4AMDECJImDCBAgUEESJUsHABQ8GCADJooBAhQgQJ
        ERBsmMChgwQEHj5cAFFwYAgRIyaQKGFigwIEJyR0QJFCxYoDLBoQKAighYsRCBCUOIHgxAYF
        ChRAeAEjhowZNGrYuEEQRw4dGyhIkEBhBw8IPXwogPADSBAhQ4gUAWHkyMAcSBYgIJFkw4YS
        CpQsYdLkhJMnUKLoSOBByo0jAo9MoVIFQYckJEiUsHIFSxYtHbZA4ILgBIIuXr6ACQMAh5gx
        ZBBwKWPmDBoEaaAsUUNiBIU1aygoYAOijZs3AODE/0FCg42cOXTq2LkjAE8eOB2S3FlTggIE
        D3r28Onj5w8ggIFoKBA0iFCWISZKKFCQJEmJJHd4UFBgoJChQ4gSKVoUR0EFD4KUMLJCogSF
        Ekk6lJhwZ0uERhccvbnySMqfRYAgVTgAwUMkNEmSJClhwsQJCVskSJpEqZKlS5gehMgESNMm
        HwoQILjTgQQHCRIiUIhwZ4QGToU6efoEKtQDHKKmjNoUyAeECiMmkOggIQKFCGw0cCJV6oop
        UwD0nNJD6ZSUAXBQofhQxMICDxU8pPqgitMqVq0umboE4IurV7BKOYoFRtarWaE4haJVi5Mt
        TrdU1cJlKVeuSwAA+Emka/gXr16+dlXyFevVq1O/bNmiFMoBLWDBhA0DAAAAsWK6dPEyZozX
        sV69dO1xBOYUsmS/QlH6kcuUMAAAAABQtmsXQF68ljE71sxYGGXOnOl65eoXsldPcj0zBQAA
        AADQWhkzZiyaNGnLpi2TZozasmiJZCHDlQaTKYAABA4sVq3aMmnRpBlitqzaMmnSllm7dgrM
        J0wDBwrEhs2ZtDBhmGGblk2bNma8mm0D4+YKqIEDBwLgZgybszDdvGX7lo1ZmGnQwIUTN3Dg
        wIEAqlWbtqyat3HaujHr5KYYuYEDBw4cKPBbtnLlsnXq1MncOYAABA4kWNDgwYMBAQA7}
    set datade4 {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}
    set datade5 {R0lGODlhHAAcAPcAANnZ2Ti3TT26UjapQzCeOD7IU0rbY0/bZ1TbbFLXaEPTVzvKTjXEQyyw
        NSypOkfSYEbLYVnLhYDen1neclTeaVnea1TebErXXyy1OSOfLzS1QTjFSVTbZU3JXSRjO0ib
        hZri0J3uxF/eeUXSWzLDQCypNU+6XUPRU1nbbj2wTRQzJz18aIzNwrHt1Wneg1fbclbKZ0q6
        eXXXq3Ximk3XYTjLRV++b1TTZyFdLx1HN2nBgk/RYSZrMiRjTnXHvr/x5YDlny+7OjiwQDCV
        N0OmTTipSEOuU1TPeWnbeR9YKWS1obHi1jSWOymCMIDTkF/eciRdO5rrvjihRRpAKyRRQEqW
        aE/bbyieMyOPK3XXiErFWAwgHT2FbpfXy7vu3k/iZVPWbiCMJx15IxVOFZLLnUHXWT2hU1S6
        j4ziuhQzIFSWg3XDmlnibySrNhyOIxpdIBI+E1zDaKzXtTjXTWnkfUa6UjSQQTCVQ1nTcmnZ
        f1/ieCGbKhRoFhQ3FgkoDiGCJ2THbrzWw5Lbnz2wSBErIzBpWJ3bx0/DYTSFWG/LsJ3oxz3L
        WBROEQ8dEQgWCh5yI2nLc7HRuh1TLyxoRUawXRo7M2nDq7bo4RhuGRFFExQiGKzitV/ldXu1
        qm/TlTK+QiOsMBFTFxczGxsoIBYVGdDl1Ch5O0GmXSesMRQVFiymMm/DeXvJhqfXq6zgsJLe
        nT3PSR1zHx8iIySWKiimLyGWJmnLeSq1Nye2MRZSHBwfIB1uHR1/IyqQLy2vMS68NhpdGhtW
        FxxdFxtjGhRdFh+hKiGwKyR5KhcnHSQpJyMjJxlpHRddHR5dFBhTFBpYFBtYERmMHyGhJySm
        KxJPGBhYGRhJFBFdGB1AIx0aIBdOFBZJERVAERFJEx15JxcjHRM7EQw3DhdFExhkIBQ3EAoz
        DBpjIxM1FBdFFxFCFREvDwwzDgw7EQgjDP//////////////////////////////////////
        /////////////////////////////////yH5BAEAAAAALAAAAAAcABwAAAj/AAEIHEgQQIAA
        AgYQKFiwYMEBBQwcQIAAQQIFCxg0KFiQoIMFDyBEkDCBAgUEFSxcWIAhQ8GCADRs4NDBwwcQ
        ISxwqCBCxAQLI0hgKFFwoIkTB1CkULGCRQsXCF6IgBFDxgwaNRgQKAjABowELyzcwJFjhY4d
        NBLQ4NHDxw8gJ4IIGUKQiI4dBxC8mNChiBEYR5Ak2JEkh5IlEgwwKMGkyUAdThQcmPCEAoUK
        NKB8ABHFgpQpVKrAsDLiyhAsApvoyKIAwQQkKFBU0LKFSxcvSL7Q6GDlBQIwBMKIGQOgCBkk
        ZXaYOYMGyAsUaaioWYPgAAU2bCgkeNDGzRs4AOLI/8kyJ8WUD0ta0KlQx84dGHjy6GFjgYKB
        EXv49PHzB1AggILmDCJUiIWhPBYqJKhwCFEiRXQMULixyA2jRo4eQYoU6EaZO5ImUUrwokIF
        FDwqWboU5YuFAhgwZdLU6AqgSIE2Xbiw6AEnPU9EPKlgh9CKTp4m3PgEKpSoUaQcdCATqNQm
        EQYOIHjy5IkIPTfumDoF5sAGVG76jNqSShUBI6tYtXL1Kg+NCwcQvBAhYkICCg9gtUEVS5Ms
        WQAyYJlFq9aVInFswSBBYoGCCwpGFGBwCxeuErl0ydIFwM2eMH9i7dolhheWXm1w+UIVBBcu
        XL9+BeklSpYsXQAA/IkFLPhYMGHDhBEbFutPmFrFjBkD1aAErmPIkikDAADAMmbAhDVz9gza
        s2bChvHBFK1WMWnTfE1LIktWMgAAAACgVi0YwGbOrDF6xsjZmDHUQl37M2tasTDYZGWTBQAA
        AADUqDlz5syZNW3buG3Tps0Zt2CPeBXDkoaULIAABA68lqnbNm3BtDHKlGmbNWfOGAV7VMvb
        N1IDBwrslimUNm1jrGnjBi4cOHHOnI0TM05TqoEDBwIINabbmDGZuJErR26bNm65zF07N3Dg
        wIEAMmXilkkcnHPk0KFL9yZXuIEDBw4cKFBduHXk2MFJl25MO4AABA4kWNDgwYMBAQA7}
    set datade6 {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}
    image create photo img-de1
    img-de1 put $datade1
    image create photo img-de2
    img-de2 put $datade2
    image create photo img-de3
    img-de3 put $datade3
    image create photo img-de4
    img-de4 put $datade4
    image create photo img-de5
    img-de5 put $datade5
    image create photo img-de6
    img-de6 put $datade6

    proc gui {} {
        pack [frame .f1]
        pack [canvas .f1.c  -width 234 -height 210 -bg white]\
                -expand 1 -fill both -padx 3 -pady 3
        # les items à remplir
        set mafont "Helvetica 12 bold"
        for {set i 0} {$i<=5} {incr i} {
            set absc(1) [expr 2+$i*29];set absc(2) [expr 29+$i*29]
            set montag de$i
            .f1.c create rectangle $absc(1) 2 $absc(2) 29 -tags "$montag rect"
            .f1.c create text [expr ($absc(1)+$absc(2))/2] 15 -text [expr $i+1] -font $mafont
            set montag de[expr 6+$i]
            .f1.c create rectangle $absc(1) 39 $absc(2) 68 -tags "$montag rect"
            set liste {Br Ca Fu PS GS Ch}
            .f1.c create text [expr ($absc(1)+$absc(2))/2] 54 -text [lindex $liste $i] -font $mafont
        }
        .f1.c create rectangle 178 39 232 68 -tags "de12 rect";.f1.c create text 205 54 -text yahtzee -font $mafont
        # les zones textuelles
        .f1.c create text 220 15 -tags "score sp";.f1.c create text 210 30 -tags bonus
        .f1.c create text 87 90 -text "score";.f1.c create text 117 90 -tags "score st"
        .f1.c create text 190 90 -text "lancer";.f1.c create text 220 90 -tags "nblancers"
        .f1.c create text 220 72 -font "Helvetica 6" -tags yahtzee
        # les dés et les selections
        for {set i 0} {$i<=4} {incr i} {
            set absc(1) [expr 15+$i*43];set absc(2) [expr $absc(1)+28]
            .f1.c create rectangle $absc(1) 100 $absc(2) 128 -outline white
            set montag res$i
            .f1.c create image [expr ($absc(1)+$absc(2))/2] 114 -tags "resultat $montag"
            .f1.c bind $montag <1> "ts $i"
            set montag coch$i
            .f1.c create oval [expr $absc(1)+7] 135 [expr $absc(2)-7] 149 -tags "coche $montag"\
                    -fill white
            .f1.c bind $montag <1> "ts $i"
            .f1.c bind $montag <Enter> ".f1.c itemconfigure $montag -outline green"
            .f1.c bind $montag <Leave> ".f1.c itemconfigure $montag -outline black"
        }
        #les options
        set liste {sstotal maxi son npartie}
        for {set i 0} {$i<=3} {incr i} {
            set absc(1) [expr 5+$i*60];set absc(2) [expr $absc(1)+45]
            set montag opt$i
            .f1.c create rectangle $absc(1) 167 $absc(2) 178 -tags "choix options $montag"\
                    -fill white
            .f1.c create text [expr ($absc(1)+$absc(2))/2] 173 -text [lindex $liste $i]\
                    -tags "choix options $montag"
            .f1.c bind $montag <1> "options $i"
        }
        # les choix
        .f1.c create oval [expr 115-10] [expr 198-10] [expr 115+10] [expr 198+10] -tags entrer -fill white
        .f1.c create text 115 198 -text "ok" -tags entrer
        .f1.c create rectangle 145 188 214 208 -tags lancer -fill white
        .f1.c create text 180 198 -text "lancer" -tags lancer
        .f1.c create oval 20 188 40 208 -tags pargauche -fill white
        .f1.c create text 30 198 -text "<" -tags pargauche
        .f1.c create oval 50 188 70 208 -tags pardroite -fill white
        .f1.c create text 60 198 -text ">" -tags pardroite

        .f1.c bind entrer <1> "appui_entrer";.f1.c bind lancer <1> "appui_lancer"
        .f1.c bind pargauche <1> "parcours -1";.f1.c bind pardroite <1> "parcours +1"
        wm resizable . false false
        bind .f1.c <3> exit
        bind .f1.c <2> auteur
    }

    proc lancer {liste} {
        global rd
        set nb [llength $liste]
        for {set i 0} {$i<$nb} {incr i} {
            set alea [expr int(rand()*6+1)]
            set rd [lreplace $rd [lindex $liste $i] [lindex $liste $i] $alea]
        }
    }

    proc afflancer {liste} {
        global rd
        set nb [llength $liste]
        for {set i 0} {$i<$nb} {incr i} {
            set de [lindex $liste $i]
            set montag res$de
            set monde img-de[lindex $rd $de]
            .f1.c itemconfigure $montag -image $monde
        }
    }

    proc ts {numbouton} {
        global sel rd
        if {$rd!="0 0 0 0 0"} {
            set bool [expr ([lindex $sel $numbouton]+1) % 2]
            set sel [lreplace $sel $numbouton $numbouton $bool]
            set montag coch$numbouton
            if {[.f1.c itemcget $montag -fill] == "white"} {
                .f1.c itemconfigure $montag -fill red
            } else {
                .f1.c itemconfigure $montag -fill white
            }
        }
    }

    proc appui_lancer {} {
        global nbl sel
        if {$nbl<3} {
            set liste ""
            for {set i 0} {$i<=4} {incr i} {
                if {[lindex $sel $i]==0} {
                    lappend liste $i
                }
            }
            if {$liste!=""} {
                incr nbl;lancer $liste;afflancer $liste
                .f1.c itemconfigure nblancers -text $nbl;.f1.c itemconfigure sp -text ""
                if {$nbl==3} {parcours +1}
            }
        }
    }

    proc parcours {nombre} {
        global position nbl
        if {$nbl!=0} {
            incr position $nombre
            set position [expr $position % 13]
            set montag de$position
            foreach obj [.f1.c find withtag rect] {
                if {[.f1.c itemcget $obj -outline]=="green"} {
                    .f1.c itemconfigure $obj -outline black
                }
            }
            if {[.f1.c itemcget $montag -outline]!="red"} {
                .f1.c itemconfigure $montag -outline green
                calculerpoints $position
            } else {
                parcours $nombre
            }
        }
    }

    proc appui_entrer {} {
        global position scoretotal nbl soustotal bon scoremax
        set ajout [.f1.c itemcget sp -text]
        if {$ajout!="" && $nbl!=0} {
            if {$position<=5} {
                incr soustotal $ajout
                if {$soustotal>=63 && $bon==0} {
                    incr scoretotal 35
                    .f1.c itemconfigure bonus -text "bonus"
                }
            }
            if {[test_yahtzee]==1} {
                agir_yahtzee
            } else {
                set montag de$position
                .f1.c itemconfigure $montag -outline red -fill red
                incr scoretotal $ajout
            }
            .f1.c itemconfigure st -text $scoretotal
            .f1.c itemconfigure sp -text ""
            for {set i 0} {$i<=4} {incr i} {
                .f1.c itemconfigure coche -fill white
                .f1.c itemconfigure resultat -image {}
            }
            init
            .f1.c itemconfigure nblancers -text ""
        }
        if {[test_fin]} {
            .f1.c bind entrer <1> "";.f1.c bind lancer <1> "";.f1.c bind pargauche <1> "";.f1.c bind pardroite <1> ""
            .f1.c itemconfigure sp -text "FIN"
            if {$scoretotal>$scoremax} {
                set fic [open ~/.tky.score w+];puts $fic $scoretotal;close $fic
                set scoremax $scoretotal
                animation $scoremax
            }
        }
    }

    proc calculerpoints {choix} {
        global rd yat
        set scorepartiel 0
        if {$choix<6} {
            set nb [expr $choix+1]
            set scorepartiel [expr $nb*[regexp -all $nb $rd]]
        } elseif {$choix!=9 && $choix!=10} {
            for {set i 0} {$i<=5} {incr i} {set r($i) [lindex $rd $i]}
            set montest [expr ($r(0)==$r(1))+($r(0)==$r(2))+($r(0)==$r(3))+($r(0)==$r(4))\
                    +($r(1)==$r(2))+($r(1)==$r(3))+($r(1)==$r(4))+($r(2)==$r(3))+($r(2)==$r(4))\
                    +($r(3)==$r(4))]
            set somme [expr $r(0)+$r(1)+$r(2)+$r(3)+$r(4)]
            if {($choix==6 && $montest>=3) || ($choix==7 && $montest>=6) || $choix==11} {
                set scorepartiel $somme
            } elseif {$choix==8 && $montest==4} {
                set scorepartiel 25
            } elseif {$choix==12 && $montest==10 && $yat==0} {
                set scorepartiel 50
            }
        } elseif {$choix==10} {
            set range [lsort $rd]
            if {$range=="1 2 3 4 5" || $range=="2 3 4 5 6"} {
                set scorepartiel 40
            }
        } elseif {$choix==9} {
            set un [regexp 1 $rd];set deux [regexp 2 $rd];set trois [regexp 3 $rd]
            set quatre [regexp 4 $rd];set cinq [regexp 5 $rd];set six [regexp 6 $rd]
            if {[expr $un+$deux+$trois+$quatre]==4||[expr $deux+$trois+$quatre+$cinq]==4||[expr $trois+$quatre+$cinq+$six]==4} {
                set scorepartiel 30
            }
        }
        .f1.c itemconfigure sp -text $scorepartiel
    }

    proc test_yahtzee {} {
        global rd
        for {set i 0} {$i<=5} {incr i} {
            set r($i) [lindex $rd $i]
        }
        set montest [expr ($r(0)==$r(1))+($r(0)==$r(2))+($r(0)==$r(3))+($r(0)==$r(4))\
                +($r(1)==$r(2))+($r(1)==$r(3))+($r(1)==$r(4))+($r(2)==$r(3))+($r(2)==$r(4))\
                +($r(3)==$r(4))]
        if {$montest==10} {
            return 1
        }
        return 0
    }

    proc agir_yahtzee {} {
        global yat position scoretotal
        if {$position==12} {
            .f1.c itemconfigure de12 -outline red
            incr yat
            incr scoretotal 50
        } elseif {$yat!=0} {
            incr yat
            incr scoretotal 100
            incr scoretotal [.f1.c itemcget sp -text]
            set montag de$position
            .f1.c itemconfigure $montag -fill red
            .f1.c itemconfigure yahtzee -text $yat
        } else {
            set montag de$position
            .f1.c itemconfigure $montag -outline red
            incr scoretotal [.f1.c itemcget sp -text]
        }
    }

    proc options {nombre} {
        global soustotal scoremax scoretotal bon yat
        .f1.c itemconfigure opt -text {}
        if {$nombre==0} {
            #sous-total
            .f1.c create text 30 90 -text "Ss-Tot : $soustotal" -tags opt -fill red
        } elseif {$nombre==1} {
            #maximum
            .f1.c create text 30 90 -text "Max : $scoremax" -tags opt -fill red
        } elseif {$nombre==2} {
            #son
            .f1.c create text 30 90 -text "Son indisp" -tags opt -fill red
        } elseif {$nombre==3} {
            #nouvelle partie
            set scoretotal 0;set soustotal 0;set bon 0;set yat 0;init
            .f1.c itemconfigure coche -fill white;.f1.c itemconfigure resultat -image {}
            foreach obj [.f1.c find withtag rect] {.f1.c itemconfigure $obj -outline black -fill white}
            foreach obj [.f1.c find withtag score] {.f1.c itemconfigure $obj -text ""}
            .f1.c itemconfigure nblancers -text ""
            .f1.c create text 30 90 -text "Nv Partie" -tags opt -fill red
            .f1.c bind entrer <1> "appui_entrer";.f1.c bind lancer <1> "appui_lancer"
            .f1.c bind pargauche <1> "parcours -1";.f1.c bind pardroite <1> "parcours +1"
        }
        after 1000 ".f1.c itemconfigure opt -text {}"
    }

    proc test_fin {} {
        set somme 0
        for {set i 0} {$i<=12} {incr i} {
            set montag de$i
            if {[.f1.c itemcget de$i -outline]=="red"} {
                incr somme
            }
        }
        if {$somme==13} {
            return 1
        } else {
            return 0
        }
    }

    proc animation {score} {
        # à faire
    }

    proc init {} {
        global nbl rd sel position
        set position -1;set nbl 0;set rd "0 0 0 0 0";set sel $rd
    }

    proc main {} {
        global scoretotal soustotal bon yat
        set scoretotal 0;set soustotal 0;set bon 0;set yat 0
        gui
        init
    }

    main

    if {[catch {
            set fic [open ~/.tky.score r];gets $fic scoremax;close $fic
        } erreur]} {
        set fic [open ~/.tky.score w+]
        puts $fic 0
        close $fic
        set scoremax 0
    }

KBK a fait un jeu yahtzee (anglophone) avec Tk il y a cinq ou six ans. Son interface est beaucoup plus laide. Kudos aux deux David pour faire une belle. Maintenant il faut l'internationalisation! Peut-être les auteurs du jeu francophone trouveront des autres idées à http://wiki.tcl.tk/957 ?