Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
def print_board(tablero):
|
2 |
output = ""
|
3 |
for i in range(len(tablero)):
|
@@ -56,11 +58,6 @@ def buscar_vacio(tablero):
|
|
56 |
|
57 |
return None
|
58 |
|
59 |
-
|
60 |
-
# Interfaz
|
61 |
-
|
62 |
-
import gradio as gr
|
63 |
-
|
64 |
def function(cadena):
|
65 |
|
66 |
tablero = []
|
@@ -72,47 +69,28 @@ def function(cadena):
|
|
72 |
|
73 |
return print_board(tablero)
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
["100048000050000900006000300000570200803000000000900000000000041670000000000200000"],
|
90 |
-
["708000300000601000400000000060000025300080000000100090090500002000070400000000000"],
|
91 |
-
["403000002000601000800000000000500790200030000010000000000840000090000600070000050"],
|
92 |
-
["010620000500000043000090000700000080005000004000100000000003600090000200800007000"],
|
93 |
-
["403000002000601000800000000000500970200030000010000000000840000090000600070000050"],
|
94 |
-
["805000002000901000300000000060700400200050000000000060000380000010000900040000070"],
|
95 |
-
["000020040070006000010500000200000080000300700409000000000600103800090000000000500"],
|
96 |
-
["805000002000901000300000000060700400200050000000000060000380000040000700010000090"],
|
97 |
-
["000040001030600000800000000109005000000000870000200000070000260500094000000000300"],
|
98 |
-
["307004020000100800900000000000030090050800000040600000000000501200070000000000600"],
|
99 |
-
["000903100607000080200000000050000400000060020010000000800070000000300500000400009"],
|
100 |
-
["805000002000401000300000000060700400200050000000000090000380000010000700090000060"],
|
101 |
-
["704000002000801000300000000050600100200040000000000090000370000090000500080000060"],
|
102 |
-
["704000002000801000300000000050600100200040000000000090000370000080000600090000050"],
|
103 |
-
["001000007000890000000000600260030000000500074900000000000104050830000000000000200"],
|
104 |
-
["200040500010000030000000000006000802070309000000100000400050600000700090008000000"],
|
105 |
-
["805000002000901000300000000060700400200050000000000060000380000010000700040000090"],
|
106 |
-
["080000063000040200000000000010803500700000900000600000209070000000000035400000000"],
|
107 |
-
["090300020000070500010000000708600400000902000500000000000100063400080000000000000"],
|
108 |
-
["780400120600075009000601078007040260001050930904060005070300012120007400049206007"]]
|
109 |
|
110 |
demo = gr.Interface(
|
111 |
fn=function,
|
112 |
-
inputs=
|
113 |
-
outputs=
|
114 |
-
title="Resolver
|
115 |
-
examples=examples
|
|
|
116 |
)
|
117 |
|
118 |
-
demo.launch(
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
def print_board(tablero):
|
4 |
output = ""
|
5 |
for i in range(len(tablero)):
|
|
|
58 |
|
59 |
return None
|
60 |
|
|
|
|
|
|
|
|
|
|
|
61 |
def function(cadena):
|
62 |
|
63 |
tablero = []
|
|
|
69 |
|
70 |
return print_board(tablero)
|
71 |
|
72 |
+
value1 = gr.Textbox(lines=2, label="Sudoku", placeholder="Ingrese la cadena del sudoku")
|
73 |
+
value2 = gr.Textbox(lines=10, label="Solución", placeholder="Solución...")
|
74 |
+
|
75 |
+
examples=[
|
76 |
+
["400030000000600800000000001000050090080000600070200000000102700503000040900000000"],
|
77 |
+
["708000300000201000500000000040000026300080000000100090090600004000070500000000000"],
|
78 |
+
["708000300000601000500000000040000026300080000000100090090200004000070500000000000"],
|
79 |
+
["307040000000000091800000000400000700000160000000250000000000380090000500020600000"],
|
80 |
+
["500700600003800000000000200620400000000000091700000000000035080400000100000090000"],
|
81 |
+
["400700600003800000000000200620500000000000091700000000000043080500000100000090000"],
|
82 |
+
["040010200000009070010000000000430600800000050000200000705008000000600300900000000"],
|
83 |
+
["705000002000401000300000000010600400200050000000000090000370000080000600090000080"],
|
84 |
+
["000000410900300000300050000048007000000000062010000000600200005070000800000090000"],
|
85 |
+
["780400120600075009000601078007040260001050930904060005070300012120007400049206007"]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
demo = gr.Interface(
|
88 |
fn=function,
|
89 |
+
inputs=value1,
|
90 |
+
outputs=value2,
|
91 |
+
title="Resolver Sudoku",
|
92 |
+
examples=examples,
|
93 |
+
description="Resuelve un Sudoku a partir de una cadena"
|
94 |
)
|
95 |
|
96 |
+
demo.launch(debug=True)
|