Skip to content

Commit cf767d0

Browse files
committed
6.xiangsu
1 parent 74f11f5 commit cf767d0

File tree

1 file changed

+25
-0
lines changed
  • python_game/6.xiangsu

1 file changed

+25
-0
lines changed

python_game/6.xiangsu/1.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import pygame
2+
from pygame.locals import *
3+
from sys import exit
4+
from random import randint
5+
6+
pygame.init()
7+
screen = pygame.display.set_mode((1024,800),0,32)
8+
9+
while True:
10+
for event in pygame.event.get():
11+
if event.type == QUIT:
12+
exit()
13+
14+
rand_col = (randint(0,255),randint(0,255),randint(0,255))
15+
for _ in xrange(100):
16+
rand_pos = (randint(0,1024),randint(0,799))
17+
screen.set_at(rand_pos,rand_col)
18+
19+
pygame.display.update()
20+
21+
22+
23+
24+
25+

0 commit comments

Comments
 (0)