{
  "name": "parvada_vuelo",
  "savedAt": "2026-07-14T16:58:26.544225",
  "blocks": [
    {
      "def": {
        "template": "{0} = {1}",
        "category": "variables",
        "slots": [
          {
            "options": []
          },
          {
            "options": []
          }
        ],
        "isContainer": false,
        "isReporter": false
      },
      "values": [
        "parvada",
        "[]"
      ],
      "children": []
    },
    {
      "def": {
        "template": "{0} = Turtle()",
        "category": "tortuga",
        "slots": [
          {
            "options": []
          }
        ],
        "isContainer": false,
        "isReporter": false
      },
      "values": [
        "centro"
      ],
      "children": []
    },
    {
      "def": {
        "template": "{0}.hideturtle()",
        "category": "tortuga",
        "slots": [
          {
            "options": []
          }
        ],
        "isContainer": false,
        "isReporter": false
      },
      "values": [
        "centro"
      ],
      "children": []
    },
    {
      "def": {
        "template": "{0}.penup()",
        "category": "tortuga",
        "slots": [
          {
            "options": []
          }
        ],
        "isContainer": false,
        "isReporter": false
      },
      "values": [
        "centro"
      ],
      "children": []
    },
    {
      "def": {
        "template": "{0} = Turtle()",
        "category": "tortuga",
        "slots": [
          {
            "options": []
          }
        ],
        "isContainer": false,
        "isReporter": false
      },
      "values": [
        "centroAnt"
      ],
      "children": []
    },
    {
      "def": {
        "template": "{0}.hideturtle()",
        "category": "tortuga",
        "slots": [
          {
            "options": []
          }
        ],
        "isContainer": false,
        "isReporter": false
      },
      "values": [
        "centroAnt"
      ],
      "children": []
    },
    {
      "def": {
        "template": "{0}.penup()",
        "category": "tortuga",
        "slots": [
          {
            "options": []
          }
        ],
        "isContainer": false,
        "isReporter": false
      },
      "values": [
        "centroAnt"
      ],
      "children": []
    },
    {
      "def": {
        "template": "{0} = {1}",
        "category": "variables",
        "slots": [
          {
            "options": []
          },
          {
            "options": []
          }
        ],
        "isContainer": false,
        "isReporter": false
      },
      "values": [
        "distanciaSeparacion",
        "30"
      ],
      "children": []
    },
    {
      "def": {
        "template": "for {0} in range({1}):",
        "category": "control",
        "slots": [
          {
            "options": []
          },
          {
            "options": []
          }
        ],
        "isContainer": true,
        "isReporter": false
      },
      "values": [
        "i",
        "60"
      ],
      "children": [
        {
          "def": {
            "template": "{0} = Turtle()",
            "category": "tortuga",
            "slots": [
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "ave"
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0}.penup()",
            "category": "tortuga",
            "slots": [
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "ave"
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0}.shape({1})",
            "category": "tortuga",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "ave",
            "\"bird\""
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0}.goto({1}, {2})",
            "category": "tortuga",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "ave",
            "randint(-140, 140)",
            "randint(-140, 140)"
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0}.setheading({1})",
            "category": "tortuga",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "ave",
            "randint(0, 359)"
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0}.append({1})",
            "category": "variables",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "parvada",
            "ave"
          ],
          "children": []
        }
      ]
    },
    {
      "def": {
        "template": "while {0}:",
        "category": "control",
        "slots": [
          {
            "options": []
          }
        ],
        "isContainer": true,
        "isReporter": false
      },
      "values": [
        "True"
      ],
      "children": [
        {
          "def": {
            "template": "{0}.goto({1}, {2})",
            "category": "tortuga",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "centroAnt",
            "centro.xcor()",
            "centro.ycor()"
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0} = {1}",
            "category": "variables",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "sumaX",
            "0"
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0} = {1}",
            "category": "variables",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "sumaY",
            "0"
          ],
          "children": []
        },
        {
          "def": {
            "template": "for {0} in {1}:",
            "category": "control",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": true,
            "isReporter": false
          },
          "values": [
            "ave",
            "parvada"
          ],
          "children": [
            {
              "def": {
                "template": "{0} = {1}",
                "category": "variables",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "sumaX",
                "sumaX + ave.xcor()"
              ],
              "children": []
            },
            {
              "def": {
                "template": "{0} = {1}",
                "category": "variables",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "sumaY",
                "sumaY + ave.ycor()"
              ],
              "children": []
            }
          ]
        },
        {
          "def": {
            "template": "{0} = {1}",
            "category": "variables",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "cx",
            "sumaX / len(parvada)"
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0} = {1}",
            "category": "variables",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "cy",
            "sumaY / len(parvada)"
          ],
          "children": []
        },
        {
          "def": {
            "template": "{0}.goto({1}, {2})",
            "category": "tortuga",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": false,
            "isReporter": false
          },
          "values": [
            "centro",
            "cx",
            "cy"
          ],
          "children": []
        },
        {
          "def": {
            "template": "for {0} in {1}:",
            "category": "control",
            "slots": [
              {
                "options": []
              },
              {
                "options": []
              }
            ],
            "isContainer": true,
            "isReporter": false
          },
          "values": [
            "ave",
            "parvada"
          ],
          "children": [
            {
              "def": {
                "template": "{0} = {1}",
                "category": "variables",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "diffCohesion",
                "(int(ave.towards(centro) - ave.heading() + 540) % 360) - 180"
              ],
              "children": []
            },
            {
              "def": {
                "template": "{0} = {1}",
                "category": "variables",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "diffAlineacion",
                "(int(centroAnt.towards(centro) - ave.heading() + 540) % 360) - 180"
              ],
              "children": []
            },
            {
              "def": {
                "template": "{0} = {1}",
                "category": "variables",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "vecinoCercano",
                "ave.nearest(parvada)"
              ],
              "children": []
            },
            {
              "def": {
                "template": "{0} = {1}",
                "category": "variables",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "distanciaVecino",
                "ave.distance(vecinoCercano)"
              ],
              "children": []
            },
            {
              "def": {
                "template": "if {0}:",
                "category": "control",
                "slots": [
                  {
                    "options": []
                  }
                ],
                "isContainer": true,
                "isReporter": false
              },
              "values": [
                "distanciaVecino < distanciaSeparacion"
              ],
              "children": [
                {
                  "def": {
                    "template": "{0} = {1}",
                    "category": "variables",
                    "slots": [
                      {
                        "options": []
                      },
                      {
                        "options": []
                      }
                    ],
                    "isContainer": false,
                    "isReporter": false
                  },
                  "values": [
                    "alejarse",
                    "int(ave.towards(vecinoCercano) + 180) % 360"
                  ],
                  "children": []
                },
                {
                  "def": {
                    "template": "{0} = {1}",
                    "category": "variables",
                    "slots": [
                      {
                        "options": []
                      },
                      {
                        "options": []
                      }
                    ],
                    "isContainer": false,
                    "isReporter": false
                  },
                  "values": [
                    "diffSeparacion",
                    "(int(alejarse - ave.heading() + 540) % 360) - 180"
                  ],
                  "children": []
                }
              ]
            },
            {
              "def": {
                "template": "else:",
                "category": "control",
                "slots": [],
                "isContainer": true,
                "isReporter": false
              },
              "values": [],
              "children": [
                {
                  "def": {
                    "template": "{0} = {1}",
                    "category": "variables",
                    "slots": [
                      {
                        "options": []
                      },
                      {
                        "options": []
                      }
                    ],
                    "isContainer": false,
                    "isReporter": false
                  },
                  "values": [
                    "diffSeparacion",
                    "0"
                  ],
                  "children": []
                }
              ]
            },
            {
              "def": {
                "template": "{0} = {1}",
                "category": "variables",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "ruido",
                "randint(0, 20) - 10"
              ],
              "children": []
            },
            {
              "def": {
                "template": "{0}.setheading({1})",
                "category": "tortuga",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "ave",
                "ave.heading() + diffCohesion * 0.12 + diffAlineacion * 0.2 + diffSeparacion * 0.4 + ruido"
              ],
              "children": []
            },
            {
              "def": {
                "template": "{0}.forward({1})",
                "category": "tortuga",
                "slots": [
                  {
                    "options": []
                  },
                  {
                    "options": []
                  }
                ],
                "isContainer": false,
                "isReporter": false
              },
              "values": [
                "ave",
                "randint(4, 7)"
              ],
              "children": []
            }
          ]
        }
      ]
    }
  ]
}
