Skip to content

Instantly share code, notes, and snippets.

>>>>+>+++>+++>>>>>+++[
>,+>++++[>++++<-]>[<<[-[->]]>[<]>-]<<[
>+>+>>+>+[<<<<]<+>>[+<]<[>]>+[[>>>]>>+[<<<<]>-]+<+>>>-[
<<+[>]>>+<<<+<+<--------[
<<-<<+[>]>+<<-<<-[
<<<+<-[>>]<-<-<<<-<----[
<<<->>>>+<-[
<<<+[>]>+<<+<-<-[
<<+<-<+[>>]<+<<<<+<-[
<<-[>]>>-<<<-<-<-[
@julsam
julsam / ImagePacker.py
Created March 27, 2011 11:17
These two classes can pack surfaces of different sizes into one big surface.
import pygame
class PackNode(object):
"""
Creates an area which can recursively pack images into itself.
"""
def __init__(self, area):
# if tuple contains two elements, assume they are width and height,
# and origin is (0,0)
if len(area) == 2: