Coder Social home page Coder Social logo

turojs's Introduction

TUROjs—PyTUROCHAMP as a Python web app

Install Flask and python-chess:

pypy3 -m pip install Flask --user
pypy3 -m pip install python-chess --user

(Of course you can also use regular Python 3, but PyPy is much faster.)

Start the web app:

pypy3 ptc_web.py

Open this URL in your web browser:

http://localhost:5000/

Start play by dragging a white piece. If you want to switch sides, press the Get Move button. If you click the button repeatedly, the computer will play itself.

Reload the page to start a new game.

You can also select different engines: Bare, Bernstein, Plankalkül, and SOMA. The selection can be changed during a game, so e.g. each move can be played by a different engine.

Speech synthesis browser support

The Web Speech API is used to announce computer moves. This works best in the desktop versions of Firefox and Safari (i.e., the TUROjs welcome message is read too), whereas in desktop Chrome move announcement works but the welcome message on page load is blocked.

In mobile browsers, there is no speech output when it is not directly triggered by user interaction (e.g. pressing a button) and therefore it gets blocked in TUROjs completely. The only exception is Firefox on Android.

Other packages used

turojs's People

Contributors

mdoege avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.