Code Monkey home page Code Monkey logo

puzzles's Introduction

HTML5 Puzzles

Play the puzzles in your browser


This is an unmaintained, unfinished (but working) HTML5/JavaScript port of Simon Tatham's Portable Puzzle Collection from 2013. All puzzles are playable; some limitations are in the to-do list below.

[Note that the source puzzle collection has its own JavaScript build, which was originally released around the same time as this port. Since it's maintained, it's probably a better starting point if you want to experiment.]

I prioritized making the puzzles work as well as possible on tablets, phones, and other devices with small and/or touch screens. A virtual keyboard is included for (most) puzzles that need it.

The portable puzzle source code (in the puzzles directory) is written in C. Cross-compilation to JS uses Emscripten. See the porting notes for more details.

The ports have been observed working successfully on:

  • Chrome
  • Firefox
  • Internet Explorer 9 (and later, presumably)
  • Internet Explorer 8 (albeit slowly)
  • iPad (tested on iPad 1 with iOS 5 and Mobile Safari 5)
  • Android 2.3

To Do

  • Custom puzzle settings ("configs")

  • Auto-save/restore puzzle state (cookie or localStorage)

  • Save to/load from other puzzle ports (the file format is portable)

  • Link to specific game ids

  • "Right-mouse" support for touch devices for certain puzzles that require it (e.g, Magnets). Maybe use long-press like the Android port does? And/or a "right mouse lock" virtual key?

  • Drag and drop from virtual keyboard into puzzles. Would dramatically improve usability on the Latin-square puzzles. (Requires support in puzzles code -- maybe add as #ifdef STYLUS option?)

  • Virtual keyboards: Undead needs custom keys (g, v, z). Solo needs hex digits in some variations. All of the number games would benefit from hiding unusable keys based on current config (like the Android port does).

  • Combine and closure-compile the non-Emscripten JS

  • Experiment with moving C code into a WebWorker, to avoid locking up the browser during puzzle generation.

Building

This port requires Emscripten 1.29.6. Newer Emscripten versions won't work because this code hasn't been updated to track emcc command-line and runtime changes.

You should be able to build all the puzzles with make TOOLPATH=/path/to/emscripten/1.29.6/bin/. Other build targets are in the top-level Makefile; their names should be self-explanatory.

See the porting notes for additional discussion of this code.

puzzles's People

Contributors

medmunds avatar sagetoluwa10 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.