{
"metadata": {
"name": "ipythonblocks_demo"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"ipythonblocks
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is a demo of the `ipythonblocks` module available at [https://github.com/jiffyclub/ipythonblocks](https://github.com/jiffyclub/ipythonblocks). `ipythonblocks` provides a `BlockGrid` object whose representation is an HTML table. Individual table cells are represented by `Block` objects that have `.red`, .`green`, and `.blue` attributes by which the color of that cell can be specified.\n",
"\n",
"`ipythonblocks` is a teaching tool that allows students to experiment with Python flow control concepts and immediately see the effects of their code represented in a colorful, attractive way. `BlockGrid` objects can be indexed and sliced like 2D NumPy arrays making them good practice for learning how to access arrays."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from ipythonblocks import BlockGrid"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"grid = BlockGrid(10, 10, fill=(123, 234, 123))"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 2
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"grid"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"