All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with.
This short post is about a simple idea that was turn into a Scratch solution. I had developed a computational thinking based paper game with my son around following an algorithm to draw lines randomly using dice to select direction and length of the line.
Here is a Scratch program to do something similar. It is random in three ways
- The time taken is random.
- The direction is selected randomly
- the length of the line is selected randomly
I managed to do something I have want to do for a long time this week, thanks to the recent purchase of NAO robots by the University of Northampton, I have managed to include a physical example of Social Robots into my teaching. The aim of the session was to teach about social AI, revolving around the using social cues, to a certain extent, using natural language through chatbots, for us to communicate with machines.
The robots were used as an example of a social robot, the way we want to play with or work with them, without having to going through a steep learning curve on how to use them. Students were encouraged to consider why this was and that anthropomorphisation plays a part (NAO basically has some of the characteristics of a small child). The fact that it responds to voice commands, its looks, has a childlike voice, that it always moving (even slightly when standing) and the way it moves; were spotted by the group as ways it attracts us to it - it is really hard not to talk to it like a child sometimes (but perhaps that is just me).
This session also included the use of chatbots (one example, ALICE used is shown here) and AIML, Artificial Intelligence Markup Language, (a link to more about AIML is included below). Just as a bit of background, chatbots (also called variously, chatterbots, conversational agents, etc) are programs that hold a conversation with us using through either text or speech. The chatbots were used to show how we can create intelligent-like behave by in effect providing responses to questions. Followed by, how we then take this further by using the responses people give, while using the chatbot, to 'fine-tune' the model.
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with.
This post is co-authored by my son Thomas as a joint project to get a X-Wing into Minecraft. The goal was get Python to build and move the X-Wing. It builds on ideas from the book Adventures in Minecraft (see link at the bottom) on using Python and Minecraft using a Raspberry Pi. 1. Static X-Wing To start with we just placed the X-Wing above the player by placing blocks in the shape (roughly) of the X-Wing.
Find the position of the player;
To avoid building on top the player the starting position of the X-Wing is set by:
add 5 to the x position of the player;
add 10 to the y position of the player(The bit I have to keep reminding myself is the y-axis is vertical.);
add 5 to the z position of the player;
Using these values build using, Wool blocks, the X-Wing - 0 for white, and 14 for red blocks.
It is admittedly quite a simple code (see below) and the finished X-Wing can be seen in figure 1.
from mcpi.minecraft import Minecraft
from mcpi import block
mc=Minecraft.create()
pos=mc.player.getTilePos()
x=pos.x+5
y=pos.y+10
z=pos.z+5
mc.setBlock(x,y,z,block.WOOL.id,0)
mc.setBlock(x-1,y,z,block.WOOL.id,0)
mc.setBlock(x-2,y,z,block.WOOL.id,14)
mc.setBlock(x-3,y,z,block.WOOL.id,0)
mc.setBlock(x+1,y,z,block.WOOL.id,0)
mc.setBlock(x,y+1,z,block.WOOL.id,0)
mc.setBlock(x+1,y+1,z,block.WOOL.id,0)
mc.setBlock(x+2,y,z,block.WOOL.id,0)
mc.setBlock(x+2,y+1,z,block.WOOL.id,0)
#wings
mc.setBlock(x+1,y+2,z-1,block.WOOL.id,14)
mc.setBlock(x+1,y+2,z+1,block.WOOL.id,14)
mc.setBlock(x+1,y-1,z-1,block.WOOL.id,14)
mc.setBlock(x+1,y-1,z+1,block.WOOL.id,14)
mc.setBlock(x+1,y+3,z-2,block.WOOL.id,0)
mc.setBlock(x+1,y+3,z+2,block.WOOL.id,0)
mc.setBlock(x+1,y-2,z-2,block.WOOL.id,0)
mc.setBlock(x+1,y-2,z+2,block.WOOL.id,0)
2. Get it to move. We want it to move across the screen, for the moment, happy for it to just be animated.
The block approach is ok for the static version, but could lead to mistakes with getting the co-ordinates right if we were not careful. There is an other option to be found in chapter 8 of the book of using MinecraftShape were the shape is defined as relative values to a starting block, so for what we were doing they don't change but the shape can move in across the world.
Essentially the same as before but using shape;
place the shape in the world;
move it vertical (looks like it is taking off);
move it horizontal (this bit can be seen in the video).