Coder Social home page Coder Social logo

tictactoe-voc's Introduction

Tic Tac Toe

This is a native Android app written in Python, using the BeeWare suite.

The Python code is compiled to Java bytecode using VOC, and the Android APK is packaged using briefcase.

Requirements

  • JDK
  • Android SDK

How to run

Ensure that you have Android SDK installed.

Install the Python development requirements:

pip install -r requirements-dev.txt

Plug in your Android device or start an emulator.

Build and run the app:

python setup.py android
(cd android && ./gradlew run)

Game screenshot

Want to know more?

If you liked this, you might like:

tictactoe-voc's People

Contributors

donkirkby avatar eliasdorneles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tictactoe-voc's Issues

Which version of Python?

Thanks for building this demo, but I can't get it to work for me. I saw that the cookiecutter templates are different for different Python versions, so I thought maybe that matters for your app. Which Python version did you run it with?

I'm using Python 3.5.2, and I've narrowed down the error to a generator expression. I replaced the MyApp.play() method with this:

def play(self, i, j):
    letters = ['a', 'b', 'c']
    print('calc letters')
    print(any(x == 'd' for x in letters))
    print('Done.')

When I tap on a square, I see this in my logcat:

04-02 22:34:44.918 23051-23051/org.pybee.demo.tictactoe I/Python: calc letters
04-02 22:34:44.926 23051-23051/org.pybee.demo.tictactoe D/AndroidRuntime: Shutting down VM
04-02 22:34:44.932 23051-23051/org.pybee.demo.tictactoe E/AndroidRuntime: FATAL EXCEPTION: main
                                                                          Process: org.pybee.demo.tictactoe, PID: 23051
                                                                          RuntimeError: python.tictactoe.app.MyApp.genexp_7f3d89a9e1d0
                                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                                              at org.python.types.Function.invoke(Function.java:388)
                                                                              at org.python.types.Method.invoke(Method.java:47)
                                                                              at python.tictactoe.app.ButtonClick.onClick$py(app.py:18)
                                                                              at python.tictactoe.app.ButtonClick.onClick(app.py)
                                                                              at android.view.View.performClick(View.java:6306)
                                                                              at android.widget.TextView.performClick(TextView.java:11201)
                                                                              at android.view.View$PerformClick.run(View.java:23962)
                                                                              at android.os.Handler.handleCallback(Handler.java:751)
                                                                              at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                              at android.os.Looper.loop(Looper.java:154)
                                                                              at android.app.ActivityThread.main(ActivityThread.java:6823)
                                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                                              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1557)
                                                                              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)

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.