Irc User List (Chapter 12, Example 4) - Raspberry Pi A User Manual

Hide thumbs Also See for Raspberry Pi A:
Table of Contents

Advertisement

268

IRC User List (Chapter 12, Example 4)

#!/usr/bin/env python
# IRC User List
# Written by Tom Hudson for the Raspberry Pi User Guide
# http://tomhudson.co.uk/
import sys, socket, time
RPL_NAMREPLY
RPL_ENDOFNAMES = '366'
irc = {
}
user = {
raspberryPosition = [int(x*20),int(y*20)]
raspberrySpawned = 1
playSurface.fill(blackColour)
for position in snakeSegments:
pygame.draw.rect(playSurface,whiteColour,Rect ↵
(position[0], position[1], 20, 20))
pygame.draw.rect(playSurface,redColour,Rect ↵
(raspberryPosition[0], raspberryPosition[1], 20, 20))
pygame.display.flip()
if snakePosition[0] > 620 or snakePosition[0] < 0:
gameOver()
if snakePosition[1] > 460 or snakePosition[1] < 0:
for snakeBody in snakeSegments[1:]:
if snakePosition[0] == snakeBody[0] and ↵
snakePosition[1] == snakeBody[1]:
gameOver()
fpsClock.tick(30)
= '353'
'host':
'chat.freenode.net',
'port':
6667,
'channel':
'#raspiuserguide',
'namesinterval': 5
'nick':
'botnick',
'username':
'botuser',
P A R T V
A P P E N D I X E S

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Raspberry pi b

Table of Contents