Can we create an environment that's easy and engaging enough to teach kids how to program?
It's Minecraft. It's super popular.
Console-based games aren't thaaaat exciting for kids, hence the trend toward robotics and visual programming, like with Minecraft.
Raspberry Pi edition of Minecraft (Minecraft Pi Edition) has a Python API.
But not everyone has a raspberry pi at home, so there's a Bukkit plugin for Minecraft: https://github.com/zhuowei/RaspberryJuice - lets you use the python API with the PC version of Minecraft
In [ ]:
from mcpi import minecraft
mc = minecraft.Minecraft.create(ip, port, my_name)
# send a chat message
mc.....
# teleport
mc.player.getPos() # returns a Vec3 instance; could also get pitch/orientation of player
mv.player.setPos(pos_vector)
# place blocks
from mcpi import block
mc.setBlock(x, y, z, block.STONE)
mv.setBlocks(x0, y0, z0, x1, y1, z2, block.STONE)
# detect blocks
mc.getBlock(x, y, z)
mc.getBlocks(x0, y0, z0, x1, y1, z1)
In [ ]:
# clear all the things
mc.setBlocks(0, 0, 4, 100, 100, 100, block.AIR)
In [ ]:
# introduce writing and using functions
wall()
tower(height)
sphere(radius)
pyramid(width, height)
house()
lava(x, y, z)
water(x, y z)
In [ ]:
# create your own teleporter by watching for the player stepping on a certain block, then changing their position
Martin O'Hanlon
Community Projects