Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Generative Pattern Designer | Creative Coding and Generative Art
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Python for Creators and Makers

bookChallenge: Generative Pattern Designer

You have explored how loops and color lists can be combined to create dynamic, generative art patterns. By using nested loops, you can systematically control the placement of elements—such as squares in a grid—while color lists allow you to vary the appearance in visually engaging ways. This approach gives you the flexibility to generate intricate designs with just a few lines of code, and by changing variables, you can easily experiment with new patterns and color combinations. In this challenge, you will use these techniques to build a customizable grid of colored squares, reinforcing your understanding of loops, lists, and creative coding with matplotlib.

Tarefa

Swipe to start coding

Write a script that uses nested loops and matplotlib to draw a grid of colored squares. Use a list of colors and assign them to squares in a repeating sequence. Allow the grid size and color list to be easily changed by modifying variables.

  • Use nested loops to iterate over the rows and columns of the grid.
  • Assign a color to each square using the provided color list in a repeating sequence.
  • Draw each square using matplotlib.
  • The grid size and color list must be customizable by changing the corresponding variables.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 5
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you give me an example of how to create a grid of colored squares using matplotlib?

How can I customize the size and colors of the squares in the grid?

What are some creative ways to experiment with patterns using loops and color lists?

close

bookChallenge: Generative Pattern Designer

Deslize para mostrar o menu

You have explored how loops and color lists can be combined to create dynamic, generative art patterns. By using nested loops, you can systematically control the placement of elements—such as squares in a grid—while color lists allow you to vary the appearance in visually engaging ways. This approach gives you the flexibility to generate intricate designs with just a few lines of code, and by changing variables, you can easily experiment with new patterns and color combinations. In this challenge, you will use these techniques to build a customizable grid of colored squares, reinforcing your understanding of loops, lists, and creative coding with matplotlib.

Tarefa

Swipe to start coding

Write a script that uses nested loops and matplotlib to draw a grid of colored squares. Use a list of colors and assign them to squares in a repeating sequence. Allow the grid size and color list to be easily changed by modifying variables.

  • Use nested loops to iterate over the rows and columns of the grid.
  • Assign a color to each square using the provided color list in a repeating sequence.
  • Draw each square using matplotlib.
  • The grid size and color list must be customizable by changing the corresponding variables.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 5
single

single

some-alt