Ask Your Question

Revision history [back]

How can I animate this in Jupyter Notebook? Any animation will do

def ModularColor(L): n = len(L) board = Graphics()

for i in range(2*n):
    for j in range(2*n):
        k = (i+j)%n
        color = L[k]
        corners=[(j,i), (j+1,i), (j+1,i+1), (j,i+1)]
        chessboard=polygon2d(corners, axes=false, color=color,)
        board+=chessboard
return board

KULAYS=['dodgerblue', 'mediumseagreen', 'gold', 'orangered'] ModularColor(KULAYS)

How can I animate this in Jupyter Notebook? Any animation will do

Please help to animate this:

def ModularColor(L):
    n = len(L)
    board = Graphics()

Graphics()
 for i in range(2*n):
     for j in range(2*n):
         k = (i+j)%n
         color = L[k]
         corners=[(j,i), (j+1,i), (j+1,i+1), (j,i+1)]
         chessboard=polygon2d(corners, axes=false, color=color,)
         board+=chessboard
 return board

KULAYS=['dodgerblue', 'mediumseagreen', 'gold', 'orangered'] ModularColor(KULAYS)

ModularColor(KULAYS)