-
Notifications
You must be signed in to change notification settings - Fork 0
/
listsexamples.py
executable file
·76 lines (40 loc) · 1002 Bytes
/
listsexamples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import pygame
import math
import random
c = ["over" , "under" , "around"]
x = [0, 1, 2, 3, 4]
print(c[1])
print(x[0])
# Iterating through the list
for item in x:
print(item)
# NOTE: You do not need to use index [item]!
# Adding something to the list:
x.append("I'm a string!")
for item in x:
print(item)
GREEN = (60, 179, 113, 0)
RED = (112, 0, 0, 50)
PURPLE = (75,0,130, 50)
WHITE = (255, 255, 255)
GREY = (100, 100, 100)
pygame.init()
# screen
width = 1000
height = 1000
size = (width , height)
screen = pygame.display.set_mode(size)
pygame.display.set_caption("Alex Yu's Simple Drawing!")
done = False
clock = pygame.time.Clock()
while done != True:
# main loop
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
elif event.type == pygame.KEYDOWN:
done = True
screen.fill(WHITE)
pygame.draw.rect(screen, GREEN, [30,30,30,30], 900)
pygame.display.flip()
clock.tick(5)