Giter Club home page Giter Club logo

logic_game's Introduction

Lewis Carroll's Game of Logic

A web application game based on a book about logic of famous writer Lewis Carroll.

apology.html renders messages as an apology to user with Jace Browning's meme generator API. The function that do the trick is in helpers.py.

Also in helpers.py is the function that decorate routes in application.py to require login.

changepassword.html allows the user to change the password currentily in database when the user registered.

falacies.html is a tutorial page with tooltips from Javascript to help the user follow the text explanation on the svg boards.

game.html is the page where the game actually happens. The user choose a logic problem in the dropdown menu, activating all the processes. On the board, the player has to fill the answer to the logic problem and then submit it by clicking the button.

index.html has the presentation page.

layout.html has the html layout to the other pages.

login.html is the login page.

propositions.html is another tutorial page with tooltips from Javascript to help the user follow the text explanation on the svg boards.

register.html is the page where the user registers.

syllogisms.html is another tutorial page with tooltips from Javascript to help the user follow the text explanation on the svg boards.

syllogisms.html, propositions.html and falacies.html are parallel to the first 3 sections of the book.

In the static folder we have the image used with the memegen API, the sounds used as sound effects in the game, the style.css files that give the pages its visual effects and makes the page responsive to other devices besides desktop environments. Also, the Javascript files which control tooltips, the sound effects, the color of the board's compartments, and compare the answer submitted by the user and the answer received from the server.

application.py is the control file, with all the functions refered to the html pages, the database processes and the interchange between the browser's Javascript code.

logic.db is the sqlite3 database with the problems informations: the propositions, the logical elements displayed by the tooltips, the color to be matched answer on the board.

Design choices

Along the way, a handful of design choices had to be made. A major one was choosing between process the user's answer on python or Javascript. Because the game has more than one stage (1.choosing the problem, 2.marking the board, 3.submitting the answer), instead of going back and forth server side and client side, the choice made was to getting all the problem needed information from server when the user chooses a problem and send this information in a list to the client side, then letting Javascript do the rest of the work.

Another important design choice was the tooltips, to convey information of the board. Because the limitations of html's svg tag, the Javascript tooltip was the only properly working element. Truth be told, it actually came to be the right choice, since it allows to change very easily the information on the board when a different problem is chosen. It is also interesting in the sense that not all the information is displayed at once on the board, but only the compartment information where the mouse cursor is on, giving more focus and participation to the user.

Because Flask's session.clear function breaks flash function, flash was used only to tell the user he is logged in. Any problem ocurring uses the memegen API. Registration, logging out are self explanatory for the user when redirected to the due route. Password change had to be redirected to index page, so the flash function could inform the user.

logic_game's People

Contributors

caramujosan avatar dependabot[bot] 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.