Applicability
Skill areas: Speaking and Listening, Collaboration, Roles
Ages: 11-13 yrs old
Grade level: 6th, 7th, and 8th
Students collaboratively write AI to solve any maze.
Understand the importance of dividing up work, collaborating with others, designing before building, and adjusting designs based on new input
Follow rules for collegial discussions and decision-making, track progress toward specific goals and deadlines, and define individual roles as needed. Pose questions that connect the ideas of several speakers and respond to others’ questions and comments with relevant evidence, observations, and ideas. Acknowledge new information expressed by others, and, when warranted, qualify or justify their own views in light of the evidence presented.
This activity requires students to have the Code Connection app open and running with their Minecraft Education Edition. Graph is also useful for this activity, but it is not necessary. This is the second part in a 2-part series on Artificial Intelligence.
This activity consists of 2 parts:
Have students get into groups of 2-3. If you are using graph paper, pass out copies of mazes made in the previous class section to each group. Mazes should look something like this:
Have students write the algorithm to solve each maze individually first. For example:
Now, have students extrapolate a generic algorithm that could be used to solve any of the mazes they were given.
Lead a class discussion on some of the generic algorithms that were created, then allow students to turn those algorithms into code.
Have them use logic with their agent to allow their agent to solve any maze. For example, if the “Exit” is identified with a gold block on the ground, the following code should be able to solve the maze:
player.onChat("solveMaze", function () {
while (agent.inspect(AgentInspection.Block, DOWN) != GOLD_BLOCK) {
while (agent.detect(AgentDetection.Block, FORWARD)) {
agent.turn(TurnDirection.Left)
}
agent.move(FORWARD, 1)
}
})
Finally, have each student enter each maze within the world and test their algorithm on each maze. Allow them to adjust their algorithm as needed.
Lead a class discussion on the final algorithms that were created. There should be a general consensus.
Intended outcomes: