From 8570c7e9ac6770af0e71814d57d74913fb43b24e Mon Sep 17 00:00:00 2001 From: jsboige Date: Sun, 31 May 2026 22:36:19 +0200 Subject: [PATCH] fix(Sudoku): add convention print #1946 to 3 silent C# cells Sudoku-1-Backtracking-Csharp: Console.WriteLine after BacktrackingDotNetSolver def Sudoku-11-Choco-Csharp: Console.WriteLine after IKVM DLL loading Sudoku-14-BDD-Csharp: Console.WriteLine in exercise stub + Papermill re-exec (33/33 cells, 0 errors) Sudoku-1/11: Papermill .net-csharp #!import error (structural, code is correct). Outputs will populate when executed in Jupyter Lab. Co-Authored-By: Claude Opus 4.8 --- .../Sudoku/Sudoku-1-Backtracking-Csharp.ipynb | 7 +- .../Sudoku/Sudoku-11-Choco-Csharp.ipynb | 13 +- .../Sudoku/Sudoku-14-BDD-Csharp.ipynb | 1262 ++++++++++++----- 3 files changed, 897 insertions(+), 385 deletions(-) diff --git a/MyIA.AI.Notebooks/Sudoku/Sudoku-1-Backtracking-Csharp.ipynb b/MyIA.AI.Notebooks/Sudoku/Sudoku-1-Backtracking-Csharp.ipynb index 011be66b3..2a4424a79 100644 --- a/MyIA.AI.Notebooks/Sudoku/Sudoku-1-Backtracking-Csharp.ipynb +++ b/MyIA.AI.Notebooks/Sudoku/Sudoku-1-Backtracking-Csharp.ipynb @@ -375,7 +375,10 @@ "\n", " return true;\n", " }\n", - "}\n" + "}\n", + "\n", + "Console.WriteLine(\"Classe BacktrackingDotNetSolver definie avec succes\");\n", + "" ] }, { @@ -762,4 +765,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} +} \ No newline at end of file diff --git a/MyIA.AI.Notebooks/Sudoku/Sudoku-11-Choco-Csharp.ipynb b/MyIA.AI.Notebooks/Sudoku/Sudoku-11-Choco-Csharp.ipynb index a876b13bb..5616186ed 100644 --- a/MyIA.AI.Notebooks/Sudoku/Sudoku-11-Choco-Csharp.ipynb +++ b/MyIA.AI.Notebooks/Sudoku/Sudoku-11-Choco-Csharp.ipynb @@ -116,7 +116,18 @@ } }, "outputs": [], - "source": "// Charger les DLLs IKVM runtime (requis pour Choco-solver)\n// Les DLLs doivent etre dans le meme repertoire que le notebook\n#r \"IKVM.Runtime.dll\"\n#r \"IKVM.Java.dll\"\n#r \"IKVM.CoreLib.dll\"\n\n// Charger la DLL Choco-solver pré-compilée\n#r \"org.chocosolver.solver.dll\"" + "source": [ + "// Charger les DLLs IKVM runtime (requis pour Choco-solver)\n", + "// Les DLLs doivent etre dans le meme repertoire que le notebook\n", + "#r \"IKVM.Runtime.dll\"\n", + "#r \"IKVM.Java.dll\"\n", + "#r \"IKVM.CoreLib.dll\"\n", + "\n", + "// Charger la DLL Choco-solver pré-compilée\n", + "#r \"org.chocosolver.solver.dll\"\n", + "Console.WriteLine(\"DLLs Choco-solver et runtime IKVM chargees\");\n", + "" + ] }, { "cell_type": "markdown", diff --git a/MyIA.AI.Notebooks/Sudoku/Sudoku-14-BDD-Csharp.ipynb b/MyIA.AI.Notebooks/Sudoku/Sudoku-14-BDD-Csharp.ipynb index be541ea3a..993ea7a86 100644 --- a/MyIA.AI.Notebooks/Sudoku/Sudoku-14-BDD-Csharp.ipynb +++ b/MyIA.AI.Notebooks/Sudoku/Sudoku-14-BDD-Csharp.ipynb @@ -163,34 +163,161 @@ }, "outputs": [ { - "output_type": "stream", - "name": "stdout", - "text": "Classe BDDNode definie avec succes.\r\n" - }, - { - "output_type": "stream", - "name": "stdout", - "text": "Operations disponibles :\r\n" - }, - { - "output_type": "stream", - "name": "stdout", - "text": " - True/False : Terminaux (feuilles)\r\n" - }, - { - "output_type": "stream", - "name": "stdout", - "text": " - Create(var, low, high) : Cree un noeud de decision\r\n" - }, - { - "output_type": "stream", - "name": "stdout", - "text": " - Evaluate(assign) : Evalue le BDD\r\n" - }, - { - "output_type": "stream", - "name": "stdout", - "text": " - CountNodes() : Compte les noeuds\r\n" + "data": { + "text/html": [ + "\r\n", + "
\r\n", + " \r\n", + " \r\n", + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Classe BDDNode definie avec succes.\r\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Operations disponibles :\r\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " - True/False : Terminaux (feuilles)\r\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " - Create(var, low, high) : Cree un noeud de decision\r\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " - Evaluate(assign) : Evalue le BDD\r\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " - CountNodes() : Compte les noeuds\r\n" + ] } ], "source": [ @@ -342,84 +469,122 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "=== Exemple 1 : Constante TRUE ===\r\n" + "output_type": "stream", + "text": [ + "=== Exemple 1 : Constante TRUE ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds : 1\r\n" + "output_type": "stream", + "text": [ + "Noeuds : 1\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Valeur : True\r\n" + "output_type": "stream", + "text": [ + "Valeur : True\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "=== Exemple 2 : Variable x ===\r\n" + "output_type": "stream", + "text": [ + "=== Exemple 2 : Variable x ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "x?\r\n |-> |(True)\r\n |-> |(False)\r\n" + "output_type": "stream", + "text": [ + "x?\r\n", + " |-> |(True)\r\n", + " |-> |(False)\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds : 3\r\n" + "output_type": "stream", + "text": [ + "Noeuds : 3\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Eval(x=true) : True\r\n" + "output_type": "stream", + "text": [ + "Eval(x=true) : True\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Eval(x=false) : False\r\n" + "output_type": "stream", + "text": [ + "Eval(x=false) : False\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "=== Exemple 3 : x AND y ===\r\n" + "output_type": "stream", + "text": [ + "=== Exemple 3 : x AND y ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "x?\r\n |-> |y?\r\n | |-> | |(True)\r\n | |-> | |(False)\r\n |-> |(False)\r\n" + "output_type": "stream", + "text": [ + "x?\r\n", + " |-> |y?\r\n", + " | |-> | |(True)\r\n", + " | |-> | |(False)\r\n", + " |-> |(False)\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds : 5\r\n" + "output_type": "stream", + "text": [ + "Noeuds : 5\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Eval(x=true, y=true) : True\r\n" + "output_type": "stream", + "text": [ + "Eval(x=true, y=true) : True\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Eval(x=true, y=false) : False\r\n" + "output_type": "stream", + "text": [ + "Eval(x=true, y=false) : False\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Eval(x=false, y=true) : False\r\n" + "output_type": "stream", + "text": [ + "Eval(x=false, y=true) : False\r\n" + ] } ], "source": [ @@ -530,9 +695,11 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "BDDOperations OK (Apply/And/Or/Not).\r\n" + "output_type": "stream", + "text": [ + "BDDOperations OK (Apply/And/Or/Not).\r\n" + ] } ], "source": [ @@ -650,74 +817,102 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "=== Test 1 : x AND NOT x ===\r\n" + "output_type": "stream", + "text": [ + "=== Test 1 : x AND NOT x ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Resultat : False\r\n" + "output_type": "stream", + "text": [ + "Resultat : False\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Attendu : False\r\n" + "output_type": "stream", + "text": [ + "Attendu : False\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds : 1\r\n" + "output_type": "stream", + "text": [ + "Noeuds : 1\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "=== Test 2 : x OR NOT x ===\r\n" + "output_type": "stream", + "text": [ + "=== Test 2 : x OR NOT x ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Resultat : True\r\n" + "output_type": "stream", + "text": [ + "Resultat : True\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Attendu : True\r\n" + "output_type": "stream", + "text": [ + "Attendu : True\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds : 1\r\n" + "output_type": "stream", + "text": [ + "Noeuds : 1\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "=== Test 3 : Distributivite ===\r\n" + "output_type": "stream", + "text": [ + "=== Test 3 : Distributivite ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds (gauche) : 7\r\n" + "output_type": "stream", + "text": [ + "Noeuds (gauche) : 7\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds (droite) : 7\r\n" + "output_type": "stream", + "text": [ + "Noeuds (droite) : 7\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Equivalent (x=T,y=T,z=F) : True == True\r\n" + "output_type": "stream", + "text": [ + "Equivalent (x=T,y=T,z=F) : True == True\r\n" + ] } ], "source": [ @@ -808,9 +1003,11 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "MDDNode OK (Pretty/ToString/Evaluate).\r\n" + "output_type": "stream", + "text": [ + "MDDNode OK (Pretty/ToString/Evaluate).\r\n" + ] } ], "source": [ @@ -938,9 +1135,11 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "RowMDDBuilder OK (memoization bitmask).\r\n" + "output_type": "stream", + "text": [ + "RowMDDBuilder OK (memoization bitmask).\r\n" + ] } ], "source": [ @@ -1035,64 +1234,88 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "Construction du MDD pour une ligne Sudoku...\r\n" + "output_type": "stream", + "text": [ + "Construction du MDD pour une ligne Sudoku...\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Attention: 9! = 362880 permutations valides\r\n" + "output_type": "stream", + "text": [ + "Attention: 9! = 362880 permutations valides\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "MDD construit!\r\n" + "output_type": "stream", + "text": [ + "MDD construit!\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Nombre de noeuds : 5611771\r\n" + "output_type": "stream", + "text": [ + "Nombre de noeuds : 5611771\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "=== Test 1 : Ligne valide ===\r\n" + "output_type": "stream", + "text": [ + "=== Test 1 : Ligne valide ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Resultat : True\r\n" + "output_type": "stream", + "text": [ + "Resultat : True\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Attendu : True\r\n" + "output_type": "stream", + "text": [ + "Attendu : True\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "=== Test 2 : Ligne invalide (doublon de 1) ===\r\n" + "output_type": "stream", + "text": [ + "=== Test 2 : Ligne invalide (doublon de 1) ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Resultat : False\r\n" + "output_type": "stream", + "text": [ + "Resultat : False\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Attendu : False\r\n" + "output_type": "stream", + "text": [ + "Attendu : False\r\n" + ] } ], "source": [ @@ -1212,9 +1435,11 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "MDDOperations OK (Product).\r\n" + "output_type": "stream", + "text": [ + "MDDOperations OK (Product).\r\n" + ] } ], "source": [ @@ -1329,69 +1554,97 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "=== Test du Produit MDD ===\r\n" + "output_type": "stream", + "text": [ + "=== Test du Produit MDD ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Grille 2x2 (valeurs 1-2)\r\n" + "output_type": "stream", + "text": [ + "Grille 2x2 (valeurs 1-2)\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "MDD Ligne 0 (2 cellules, valeurs 1-2) :\r\n" + "output_type": "stream", + "text": [ + "MDD Ligne 0 (2 cellules, valeurs 1-2) :\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds : 7\r\n" + "output_type": "stream", + "text": [ + "Noeuds : 7\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "MDD Contrainte (r0_c0 != 1) :\r\n" + "output_type": "stream", + "text": [ + "MDD Contrainte (r0_c0 != 1) :\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "r0_c0?\n 1 -> | (INVALID)\n 2 -> | (VALID)\r\n" + "output_type": "stream", + "text": [ + "r0_c0?\n", + " 1 -> | (INVALID)\n", + " 2 -> | (VALID)\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "MDD Produit (ligne 0 INTERSECT r0_c0 != 1) :\r\n" + "output_type": "stream", + "text": [ + "MDD Produit (ligne 0 INTERSECT r0_c0 != 1) :\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Noeuds : 5\r\n" + "output_type": "stream", + "text": [ + "Noeuds : 5\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Test (r0_c0=1, r0_c1=2) : False (attendu: False)\r\n" + "output_type": "stream", + "text": [ + "Test (r0_c0=1, r0_c1=2) : False (attendu: False)\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Test (r0_c0=2, r0_c1=1) : True (attendu: True)\r\n" + "output_type": "stream", + "text": [ + "Test (r0_c0=2, r0_c1=1) : True (attendu: True)\r\n" + ] } ], "source": [ @@ -1542,19 +1795,25 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "Classe SudokuMDDSolver definie avec succes.\r\n" + "output_type": "stream", + "text": [ + "Classe SudokuMDDSolver definie avec succes.\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "Note: Cette implementation utilise le backtracking classique\r\n" + "output_type": "stream", + "text": [ + "Note: Cette implementation utilise le backtracking classique\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "car les MDD complets pour Sudoku seraient trop volumineux.\r\n" + "output_type": "stream", + "text": [ + "car les MDD complets pour Sudoku seraient trop volumineux.\r\n" + ] } ], "source": [ @@ -1720,574 +1979,803 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", - "text": "=== Puzzle Sudoku Facile ===\r\n" + "output_type": "stream", + "text": [ + "=== Puzzle Sudoku Facile ===\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\nSolution trouve en 0,61 ms :\r\n" + "output_type": "stream", + "text": [ + "\n", + "Solution trouve en 0,50 ms :\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "-------+-------+-------\r\n" + "output_type": "stream", + "text": [ + "-------+-------+-------\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "-------+-------+-------\r\n" + "output_type": "stream", + "text": [ + "-------+-------+-------\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "-------+-------+-------\r\n" + "output_type": "stream", + "text": [ + "-------+-------+-------\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "6 " + "output_type": "stream", + "text": [ + "6 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "9 " + "output_type": "stream", + "text": [ + "9 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "5 " + "output_type": "stream", + "text": [ + "5 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "4 " + "output_type": "stream", + "text": [ + "4 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "1 " + "output_type": "stream", + "text": [ + "1 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "7 " + "output_type": "stream", + "text": [ + "7 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "| " + "output_type": "stream", + "text": [ + "| " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "3 " + "output_type": "stream", + "text": [ + "3 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "8 " + "output_type": "stream", + "text": [ + "8 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "2 " + "output_type": "stream", + "text": [ + "2 " + ] }, { - "output_type": "stream", "name": "stdout", - "text": "\r\n" + "output_type": "stream", + "text": [ + "\r\n" + ] }, { - "output_type": "stream", "name": "stdout", - "text": "-------+-------+-------\r\n" + "output_type": "stream", + "text": [ + "-------+-------+-------\r\n" + ] } ], "source": [ @@ -2600,7 +3088,15 @@ }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Exercice a completer : solveur BDD avec propagation de contraintes\r\n" + ] + } + ], "source": [ "// A COMPLETER : Solveur BDD avec propagation de contraintes\n", "\n", @@ -2650,7 +3146,9 @@ "// string puzzle = \"003020600900305001001806400008102900700000008006708200002609500800203009005010300\";\n", "// var propagator = new BDDConstraintPropagator();\n", "// var solution = propagator.Solve(puzzle);\n", - "// Console.WriteLine(solution != null ? \"Solution trouvee !\" : \"Echec !\");" + "// Console.WriteLine(solution != null ? \"Solution trouvee !\" : \"Echec !\");\n", + "Console.WriteLine(\"Exercice a completer : solveur BDD avec propagation de contraintes\");\n", + "" ] } ],