# set a size
size(200, 200)
# draw a rectangle
rect(10, 10, 100, 100)
# create a new page
newPage(200, 300)
# set a color
fill(1, 0, 1)
# draw a rectangle
rect(10, 10, 100, 100)
# create a new page
newPage(200, 200)
# set a color
fill(0, 1, 0)
# draw a rectangle
rect(10, 10, 100, 100)

# get all pages
allPages = pages()
# count how many pages are available
print(len(allPages))

# use the `with` statement
# to set a page as current context
with allPages[1]:
    # draw into the selected page
    fontSize(30)
    text("Hello World", (10, 150))

# loop over allpages
for page in allPages:
    # set the page as current context
    with page:
        # draw an oval in each of them
        oval(110, 10, 30, 30)