Code Monkey home page Code Monkey logo

admiral-arithmetic's Introduction

Admiral Arithmetic

Project for EnlighteNUS, a hackathon organized by NUS-IEEE on 23rd-24th February, 2019.

With the theme being Education, we decided to make a teaching tool to help kids learn basic arithmetic: A modified real-time spinoff of the common two-player board game Battleships where opportunities are created when a player successsfully solves simple, randomly generated math problems.

Picture of GUI

Code:

  • client.py (client code for RPi)
  • server.py (server code for another RPi)

Setup:

  • connect to server
  • initialize variables
  • get question list from server
  • get user input for ship positions
  • submit confirmation
  • wait for both players confirmation

Loop:

  • display qn no., current qn,
  • wait for user input; thread with death/win
  • if wrong, say wrong and go back to user input
  • else, wait for user input on attack vector & start 5-second timer
  • while timer<=5 || invalid/no input, wait for user input, else, send random attack vector

Interrupts:

  • Attack interrupt (software interrupt when attack is made) (uses threading)
    • update P1 array after receiving data of P2 attack
  • Hardware interrupt (button to change LED display to opponents)

admiral-arithmetic's People

Contributors

rohan-av avatar rssujay avatar tck1997 avatar rusdihaizim avatar jwyf avatar

Stargazers

 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.