How to solve (solution) Google’s Blockly Future Programmers Game: Bird Level
Learn how to solve all the levels of the Google’s Blockly Maze (introduction to loops and conditionals).
Google’s Blockly Games is a series of educational games that teach programming. It is based on the Blockly library. All code is free and open source. The Bird Game is a deep-dive into conditionals. Control-flow is explored with increasingly complex conditions. The game engine and source is available as an open source project at Github here.
In this article we’ll share with you the solution to all 10 levels available in the Bird Game of Blockly.
Level #1
The respective JavaScript code of this level is:
Level #2
The respective JavaScript code of this level is:
Level #3
The respective JavaScript code of this level is:
Level #4
The respective JavaScript code of this level is:
Level #5
The respective JavaScript code of this level is:
Level #6
The respective JavaScript code of this level is:
if (noWorm()) < heading(345); >else if (getY() < 80) < heading(90); >else
Level #7
The respective JavaScript code of this level is:
if (getY() > 50) < heading(225); >else if (noWorm()) < heading(300); >else
Level #8
The respective JavaScript code of this level is:
if (getY() < 40) < heading(90); >else if (noWorm()) < heading(345); >else if (getX() > 50 && getY() < 50) < heading(180); >else
Level #9
The respective JavaScript code of this level is:
if (noWorm() && getX() > 20) < heading(180); >else if (noWorm() && getY() > 20) < heading(270); >else if (getY() < 70 && getX() < 40) < heading(90); >else
Level #10
The respective JavaScript code of this level is:
if (noWorm() && getY() < 80 && getX() < 30) < heading(90); >else if (noWorm() && getX() < 80) < heading(0); >else if (noWorm() && getY() > 50) < heading(270); >else if (getY() < 80 && getX() >20) < heading(90); >else if (getX() > 20) < heading(180); >else if (getY() > 20)
Источник