This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# Calculator | |
from __future__ import division | |
import ui | |
import clipboard | |
from console import hud_alert | |
shows_result = False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Card Game | |
# | |
# In this game, you have to find matching pairs of cards. | |
# This scene consists entirely of layers and demonstrates some | |
# interesting animation techniques. | |
from scene import * | |
from random import shuffle | |
from functools import partial | |
import sound |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cascade Game | |
# | |
# This is a complete game that demonstrates drawing images | |
# and text, handling touch events and combining simple drawing | |
# with layer animations. | |
# | |
# The game is also known as "Same Game". | |
# It may appear simple at first, but getting a good score | |
# actually requires some strategy. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clock | |
# | |
# An analog clock that demonstrates drawing basic | |
# shapes with the scene module. | |
from scene import * | |
from time import localtime | |
ipad = False #will be set in the setup method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ColorMixer | |
# A simple RGB color mixer with three sliders. | |
import ui | |
import clipboard | |
from random import random | |
from console import hud_alert | |
def slider_action(sender): | |
# Get the root view: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Image Effects | |
# Demonstrates some effects using different modules | |
# from the Python Imaging Library (PIL). | |
# | |
# Tip: You can touch and hold an image in the output | |
# to copy it to the clipboard or save it to your | |
# camera roll. | |
import Image, ImageOps, ImageFilter | |
from Image import BILINEAR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Image Warp | |
# | |
# Demonstrates an interesting use of the image_quad function | |
# to distort an image based on touch. | |
from scene import * | |
from math import sqrt, sin, pi, floor | |
import Image | |
M = 16 # number of vert. and horiz. quads in the mesh (16*16=256) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Markdown Conversion | |
# | |
# This script demonstrates how you can convert Markdown documents | |
# to HTML and view the results in the built-in browser. | |
import os, tempfile, codecs | |
import console, clipboard, webbrowser | |
from markdown2 import markdown | |
DEMO = ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MPL Plot | |
# A simple demo of using matplotlib in Pythonista. | |
import console | |
console.clear() | |
print 'Generating plot... (this may take a little while)' | |
import numpy | |
import matplotlib.pyplot as plt | |
import math |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Particles | |
# | |
# Create colorful bubbles by moving your fingers. | |
from scene import * | |
from random import random | |
from colorsys import hsv_to_rgb | |
class Particle (object): | |
def __init__(self, location): |
OlderNewer