Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html >
- <head>
- <meta charset="UTF-8">
- <title>My chess engine</title>
- <meta name='viewport' content='width=device-width'>
- <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'>
- <link rel='stylesheet prefetch' href='http://www.willangles.com/projects/chessboard/css/chessboard-0.3.0.css'>
- <link rel="stylesheet" href="../static/css/style.css">
- </head>
- <body>
- <script src="http://www.willangles.com/projects/chessboard/js/chess.js"> </script>
- <div id="board"></div>
- <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
- <script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script>
- <script src='http://www.willangles.com/projects/chessboard/js/chessboard-0.3.0.js'></script>
- <script src="{{ url_for('static', filename='js/index.js') }}"></script>
- </body>
- </html>
- function send_move_to_engine(input) {
- $.ajax({
- type: "POST",
- url: "/send_move",
- data: { move: input },
- success: on_success
- });
- }
- function on_success(response) {
- game.move(response); //this is the functions which doesnt update gui sometimes
- console.log(response); //this response gets written to the log each time
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement