• Viernes 17 de Mayo de 2024, 05:55

Autor Tema:  Codigo Fuente Del Sodoku  (Leído 1427 veces)

kllejero911

  • Nuevo Miembro
  • *
  • Mensajes: 1
    • Ver Perfil
Codigo Fuente Del Sodoku
« en: Viernes 2 de Junio de 2006, 14:57 »
0
Alguien me puede ayudar con el codigo fuente del sodoku en delphi porfavor ?? :comp:

Enko

  • Miembro de PLATA
  • *****
  • Mensajes: 1562
  • Nacionalidad: 00
    • Ver Perfil
Re: Codigo Fuente Del Sodoku
« Respuesta #1 en: Viernes 2 de Junio de 2006, 23:40 »
0
En este foro no se hacen tareas.

Si tienes problemas al escribir tu código, no dudes en preguntar lo que te haga falta.

zeraf_

  • Nuevo Miembro
  • *
  • Mensajes: 11
    • Ver Perfil
Re: Codigo Fuente Del Sodoku
« Respuesta #2 en: Martes 6 de Junio de 2006, 05:30 »
0
Código: Text
  1.  
  2. void ubicar(int i, int j, matriz mat)
  3. {
  4.   int x;
  5.   if (i < 9) {
  6.     if (j < 9) {
  7.       if(mat[i][j] == -1) {
  8.         for(x = 1; x <= 9; x++) {
  9.           if(NOenfila(x, i, mat) && NOencolumna(x, j, mat) && NOenmatriz(x, i, j, mat)) {
  10.             mat[i][j] = x;
  11.             ubicar(i, j+1, mat);
  12.             mat[i][j] = -1;
  13.           }
  14.         }
  15.       }
  16.       else
  17.         ubicar(i, j+1, mat);
  18.     }
  19.     else
  20.       ubicar(i+1, 0, mat);
  21.   }
  22.   else
  23.      mostrar(mat);
  24. }
  25.  
  26.  

Es tarea pasarlo a Delphi, y terminarlo  :P .  :comp:

 :scream: