-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
33 lines (23 loc) · 950 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
####################################################################
# #
# Name: Seyyed Sadegh Hosseini #
# Project: Numbers Puzzle (AI First Project) #
# Teacher: Dr. Hossein Ebrahimpour #
# Date: 2019-Oct-24 #
# #
####################################################################
from flask import Flask, render_template
from flaskwebgui import FlaskUI
from init import init
from solve_puzzle import solve_puzzle
app = Flask(__name__)
ui = FlaskUI(app)
d = init()
@app.route("/")
def index():
return render_template("index.html", data=d)
@app.route("/solve")
def solve():
solved = solve_puzzle(d)
return render_template("solve.html", data=solved)
ui.run()