# Polymorphic Blocks

Polymorphic Blocks are a novel block-based UI, in which a connector's shape visually represents the structure of the data being passed through the connector. We use Polymorphic Blocks to add visual type information to block-based programming environments like Blockly or Scratch. We also use Polymorphic Blocks to represent logical proofs. In this context, if we erase all symbols, our UI becomes a puzzle game, where solving the puzzle amounts to building a proof. We show through a user study that our Logical Puzzle Game is faster, more fun, and more engaging than an equivalent pen-and-paper interface.

Update 4/26/16: Anthony Morphett from University of Melbourne is using (and extending!) Polymorphic Blocks in a project for teaching mathematics.

Polymorphic Blocks: Formalism-Inspired UI for Structured Connectors (CHI 2015)
with Stephen R. Foster and William G. Griswold

This first video is a 30 second introduction to Polymorphic Blocks (if you cannot see the video below, here is a link)

The second video is much longer, and should probably be watched after having looked at our CHI paper. This video shows the UI that results from instantiating Polymorphic Blocks to two domains: logical proofs, which leads to a Proof Puzzle Game, and typed programs, which leads to an interface for visually representing types in Blockly (if you cannot see the video below, here is a link)

You can try the Proof Puzzle Game here.

Here are a few things to note:

• If you get confused about how to play, you can always watch the sample videos above to see live GamePlay.
• There is a button called "Show/Hide Logic". This button is not currently meant to be used during regular GamePlay, and was not available in our experimental setup. Instead, it's there to ease understanding of how the puzzle pieces are related to logic. This button could eventually be used for educational purposes. Feel free to try it out.
• The puzzles follow a progression. The current puzzle number is shown at the top right of the screen. We recommend you follow the progression, but if you really want to jump to a particular puzzle directly, here is a link that gets you to puzzle 0, and you can change the "0" in the URL to get to other puzzles directly.
• We have a version of the game that makes users login, logs a whole bunch of information, and also saves the current puzzle, so if you leave and come back, you get back to where you left off. If you are interested in this version, let us know.
• If you run into any problems, or have suggestions, do not hesitate to contact us.

The instructions in the following shell file should install a local working copy of Polymorphic Blockly.

Here are a few things to note:

• This is based on an old version of Blockly.
• The commands in the shell file work for us under linux, and others have used them successfully too. They will probably work under any OS as long as you have python (to run the closure compiler).
• If you run into any problems, or have suggestions, do not hesitate to contact us.