All pastes #1940178 Raw Edit

pong demo

public python v1 · immutable
#1940178 ·published 2010-09-14 01:27 UTC
rendered paste body
#!/usr/bin/env python# This Python file uses the following encoding: utf-8from time import sleep'''unicode pong - by yossidemo to see what this looks like'''puck = u''negpuck = u''paddle = u' 'board = [0,0,0,0,0,0,0]path =  [1,1,2,2,3,3,4]p1 = 1p2 = 4def draw():        game = ''        for i in xrange(7):                if i!=3:                        game += puck[board[i]]                else:                        game += negpuck[board[i]]        return paddle[p1] + game + paddle[p2]position = -1for i in xrange(19):        sleep(.5)        board[position] = 0        if i >= 7 and i < 13:                position -= 1        else:                position += 1        board[position] = path[position]        p2 = path[position]        print draw()