Search This Blog

Thursday, August 11, 2016

Python, Minecraft = PyCraft. A fun place for your children to learn to code.


Python is a fun easy language to learn and use everyday. Ive used it for years and swear by it over ALL the other programming languages out there when it comes to getting the job done. I teach it to some more gifted children in my area. I find that they react best to a visual result. For instance the turtle program is a drawing program that comes with the python libraries  and is a great way to show kids the neat ways each line of your code can execute a new pattern in the drawing.

for intstance:
 *******************************************************
 import turtle
t=turtle.Turtle()
for x in range (100):
    t.forward(200)
    t.right(91)

*******************************************************

will have a much larger impact then:

*******************************************************

import time
a, b = 0, 1
while b < 10000:
    print(b,end='')
    a, b = b, a+b
    time.sleep(.5)

*******************************************************

I had purchased a Raspberry Pi to play around with some of my coding and my kids started hogging the Minecraft game on it. I showed them how to clear a path in the game with a little code and they were hooked.  Next thing I know they are spending hours in front of YouTube watching guys like DanTDM playing the full version of Minecraft. I thought that looks so much better than the Pi version. So I purchased it for my laptop and the kids instantly took over. I searched the interwebs and found a gentleman by the name of Alex Pruss (http://alexanderpruss.blogspot.com/) who has taken the API for minecraft and ported it over for the current game. (as current as he can keep up with)

So I tested it on several different platforms and found it to be quite rewarding to play with. I told my wife that I would like to try to make a teaching curriculum out of this and I'll bet a lot of children would be interested. So I had a couple of test classes and I couldn't believe how quickly it filled up.
With my test classes being considered a success, I found a minecraft hosting company that would accommodate my modding needs and went to work creating the environment.

Here are some renderings we did when testing out the server.


There will be more to come, This project is only in its second month and we are starting to get some signups.

So Far the lessons can be critiqued and revised until I develop a template for them.
The first lesson is a fundamental of the structure of the script. I show them how to import the module, connect to the minecraft API and print the players position. I am trying to keep this pointing to 8 year old and older so I am having them write the script in either notepad or pasting them in the form provided on the website Homeschooling site.
 Keeping in mind all the time that a lot of these kids are so very new to computers in general I need to show them things like opening a text pad, saving, where to find the asterisk or equal sign.
So my first two lessons are simple, oh so very simple. But by the end of the second lesson they can create a block of almost any kind out of thin air and have started sending in repeated scripts for me to look over and put online.
This is where you can see the kids accelerate and try different arrangement of blocks.

I have not finalized it yet but I am currently working on the 3rd lesson.
In the 3rd lesson I supply them with software that will allow them to 'push' their scripts to the online game. So they can start finding and correcting their errors on their own.




I expect this will be a work in progress and I will document everything along the way.

No comments:

Post a Comment