Category Archives: python

Minefaire 2016

Wow, what a weekend!

I was thrilled to attend Minefaire 2016 near Philadelphia, PA this weekend, where a Guiness world record of attendees met their favorite YouTubers, played games, did build battles, sampled VR wares, and even experienced how Minecraft can be used in education. I presented on using Python in Minecraft as an intro to text-based coding, based on the book Adventures in Minecraft by David Whale and Martin O’Hanlon.

Finally met Joel Levin, @MinecraftTeachr, one of my heroes
Finally met Joel Levin, @MinecraftTeachr, one of my heroes.

It was also a personal thrill to meet so many of my online friends and heroes for the first time! Hard to believe that six or seven years ago, this amazing game was just in its infancy in all its 8-bit blocky splendor, causing people to scratch their heads and predict that this would never take off!

 

 

#Picademy!

picademy_cohort
The whole crew, complete with jazz hands.

Just spent a weekend in Baltimore at #picademy, a 2-day workshop presented by the Raspberry Pi Foundation for 40 teachers. And I have to say it’s near the top of a lifetime of PD experiences. Amazing instructors, an inspiring venue (shout out to the Digital Harbor Foundation), and a cohort of 40 enthusiastic, dedicated, funny, thoughtful, creative teachers. Couldn’t ask for more!

bob_computer_picademy
A picture of me taking a picture….

And school starts this week! I have 20 brand new Raspberry Pi’s, thanks to the generosity of the parents group at the Porter-Gaud School, and I can’t wait to get these Pi’s cranking!

What I hoped to get from Picademy was some practical ways to introduce the Pi’s and some ideas for extending Pi skills in the class. Whoa! I got all that and more! And in the best way possible… by experience. We were thrown in the deep end, coding Sonic Pi, Minecraft, lighting LED’s with Scratch and Python…. and even though I had some experience with some of this, I was challenged and inspired. The great thing was to see people with no background in computer science jumping in and trying to make new and cool stuff. On the second day, we have 5 hours to come up with something original. My amazing partner @scratch_boulder (Mai) and I made a Minecraft phonebooth that was triggered by a button or motion sensor, took a selfie, and then built that selfie in the Minecraft world. So much fun!

mc_selfie
Our selfie worked! Props to @scratch_boulder for being such a great partner!

And now on back to Charleston. Tonight is back-to-school night for the middle school, with games and general mayhem in the gym. School starts For Real in a few days.

But I hope to keep that spark alive and stay in contact with my new tribe. Once more into the breach!

Book Review: How to Code in Minecraft by Jim Christian

howtocodeinminecraft_coverThere’s a lot of stuff on the web and in print on how to code mods in Minecraft, most of which requires a fairly hefty investment of time in learning Java. And that right at the outset eliminates a lot of beginning coders. What we need are some entry points for beginning to intermediate coders, which most people who are hooked on Minecraft are. I’ve found Minecraft appeals to all ages, but particularly to the 8-12 age group.

Enter Jim Christian’s excellent book: How to Code in Minecraft. In 146 colorful, jam-packed with coding and Minecraft goodness pages, Jim has given the beginning and intermediate coder a multitude of entry points into doing more than just playing Minecraft, but actually coding it.  He lays out a steady progression of skills, starting with everyone’s favorite intro coding language, Scratch. He then moves to text-based coding with Python, which I’ve found in classes is a logical progression.  From there, he introduces the popular ComputerCraft mod, which uses the Lua language. Along the way, he shows the reader how to set up a free Minecraft server, how to set up and use various development environments, and points the reader  where to go after mastering the skills in this book.

Jim doesn’t leave out teaching basic programming principles, like variables, functions, loops, and events. But it’s so much fun along the way that it’s an excellent example of what I call “stealth learning”. Sure, you could give kids lessons on those topics, but they’ll be way more engaged if they’re setting traps, setting off fireworks, and creating their own in-game games! Instructions are clear with an abundance of colorful illustrations. Jim also leaves blank pages for notes at the end of each chapter, as well as suggestions for expanding the student’s knowledge with fun challenges and projects.

If you’re looking for a solid, comprehensive introduction to coding in Minecraft for your class, club, after-school program, or for that Minecraftaholic in your family, you’d be hard pressed to do better than this book. My only complaint is that it’s not yet available on Amazon in the US!

How to Code in Minecraft — Jim Christian ISBN 1-78106-519-5

Hacking the HackPack

minecraft-pythonAs promised, here’s the skinny on my current Mython approach. I can’t really claim credit for most of it, as I’m using the Adventures in Minecraft book by Whaley and O’Hanlon, as well as some great starter code by Ben Davies, @ncscomputing, and others in GB.

I have three “hackpacks”, which are packets of sample programs that I print and distribute to students. They basically copy the code and run it. After they complete all those successfully, they then use a “reverse hackpack”, which consists of coding challenges based on the programs they just finished. Most have some minor changes required, but all are extensions and applications of the code they did. When they can successfully do that, I sign off on each challenge. I usually ask them to explain something in the code to be sure that there is understanding of what the code is doing.

There are a few spots that I actually “teach” to the whole class, though I try to limit it to 10 minutes maximum. One of those spots is the while True loop in Python, and the other is for loops. Everything else is addressed individually or in small groups as needed (“just in time” learning).

So far I’ve been very pleased with the level of engagement, effort, and learning. It’s the first iteration, so I’m fine-tuning as I go, of course!

Mython — next time around

hackmythonJust started my unit on coding in Minecraft. It’s 8th grade and their first introduction to text-based coding. Scaffolding — they’ve all done Scratch and LEGO robots in 7th grade, and GameMaker in 8th grade. So this is our first dive into the deep end…..

I’m using what I call Mython (Minecraft and Python), based on the Adventures in Minecraft book by Whaley and O’Hanlon. I gave out a packet of 8-9 introductory Python programs which they typed in. the purpose was to get them used to typing code and learn some basics along the way. The programs are from the Adventures book mainly and do things like display text in the chat, track the player’s position, and build things. I don’t expect them to understand it all.

Today I introduced what I call Reverse Hackpack #1. It’s a series of coding challenges that are slight modifications of the code they already did. They have to figure out how they did something like that in the previous code and then make changes. I’m making badges/stickers for completion, and they have to explain the code to me to earn their badge. Here’s a link to that if you’d like it.

This is my first try at this approach but I’m liking it so far, and the kids seem to be not only enjoying it but learning. As I told them today, “If you’re not frustrated, you’re not learning!”

Wearing Different HATs

If you’re a Raspberry Pi fan, you already got the joke. If not, well…… a HAT for a Raspberry Pi is Hardware Attached to Top. Get it? OK, it’s geeky humor…

skywriterAnyway, I just got three brand-new HATs to play with: the Pimoroni Skywriter HAT, the Piano HAT, and an LCD touchscreen (Pi-size). I’ve only had the chance to play a bit with the Skywriter, which has near-field 3D gesture detection (think I got that right), and I’m dying to get that X-Wing built in Minecraft and then fly it by hand gestures above the HAT. I spent about an hour, getting the Skywriter library, trying to use some code (here’s the project: http://robotsandphysicalcomputing.blogspot.com/2016/01/guesture-controlled-minecraft-x-wing.html), finding it needs an extra Minecraft Pi library called minecraftstuff, figuring out where the minecraft api on the Jessie distro is…. so I’m still grounded. However, we’ll be taking off next week for sure!

Pimoroni-Piano-Raspberry-Pi-HAT-1The Piano HAT allows you to “play” the piano on your Pi. The really cool thing is that you can do all kinds of music with it, but you can also code the keys to do anything else you want — make weird noises, turn lights on and off, turn motors on and off…. Can’t wait to play with that one!

And the LCD screen frees you from a monitor and keyboard for your Pi. I personally find it just too tiny for my eyeballs, but I can see it working with an embedded Pi doing all kinds of cool things — retro gaming, a DJ system….

Did I mention I’m also diving into using Sonic Pi (live music coding) in Minecraft? The Sonic Pi api includes some Minecraft stuff (written in Ruby), so you can lay down some beats with Sonic Pi, then build stuff as you move around in Minecraft, synchronized together! It’s just too cool for words.

So I’m getting ready for next year’s classes when we move much of my curriculum over to the Raspberry Pi. Look out!

Finding the best coding language for beginners (revisited)

pythonProbably the most visited article on my site here is the original post on this topic. I wrote that about a year ago, and my conclusion was that Small Basic fit the bill best. It was written for beginners, had autocomplete, a syntax that made sense out of the box. Plus turtles!

However, I’m revising that assessment now. I still like Small Basic for all those reasons. But the introduction of two new approaches has made me rethink this (and what kind of teacher would I be if I wasn’t always willing reevaluate what I’m doing?). The two new gateways into coding that I’m using are Minecraft and the RaspberryPi. And I can do Python with both.

In some ways, Python isn’t as user-friendly as Small Basic. Indentation can bite you big-time, and while True loops don’t make sense to kids right away. But once you get those concepts at least manageable, and you get used to the syntax, the language itself makes a lot of sense to kids. Also, no curly braces! Plus it’s a language that kids can grow with. It’s a great beginner language, and it scales all the way up to professional. Sure, it’s not Java or C++, but there are jobs out there that require Python. And I have seen students move from Python turtles to Python Minecraft to programming sensors on the Raspberry Pi in Python.

And that’s a huge win. So, for now, I’ve got a new best coding language for beginners!

Mython Launch Success!

mython2Mython is the word I use for MinecraftPi. Today I launched it in my 2 8th grade classes, and I am super-pleased with the results. First, it all worked technically, which is always great! I did have one student who was experiencing some connection difficulties but I think that might have been one of the multiple login/profiles used incorrectly.

Second, kids seemed to enjoy it. By one of the quirks of this year’s schedule, my two classes are split exactly along gender lines. My boys class dove in enthusiastically and basically executed code as fast as I could feed it to them (on two screens). A few were extending the code by the end of our 45 minute class, adding in new blocks. My girls class probably outdid the boys in enthusiasm and made similar progress.

People helped each other find errors and troubleshoot, shrieks of delight filled the air when things worked, the opposite when it didn’t….

To place it in pedagogical perspective, this followed about 3 weeks of drag and drop coding in GameMaker and 2-3 days of introductory Python, using turtles. So this is their first introduction to text-based coding. We are going to spend the next several weeks doing Mython. Thanks again to David Whale and Martin O’Hanlon for their excellent book, Adventures in Minecraft, which is the inspiration for this.

#CSTA15

CJ40XdMUcAA263HSo many firsts last week — first time in Dallas, first time at the Computer Science Teachers Association conference, first time presenting at CSTA, first preso on Minecraft…. Lots of cool stuff to report!

My presentation was on Teaching Coding in the Middle School with Minecraft. You can see the preso in Google Presentation form right here. I have wanted to use the power of Minecraft as a bridge to learning coding for some time, so I spent this school year experimenting with different approaches. My preso is a summation of those, with the proviso that I had some very specific goals in mind, which would probably be different from yours. So YMMV, etc. Spoiler alert: I finally settled on the approach used in Adventures in Minecraft book by Martin O’Hanlon and David Whale. It uses Python, and it seemed to work great with my classes.

My Twitter feed blew up the night before, as word got out about my preso. Got to say it was very cool to get all that support, especially from the aforementioned Martin(@martinohanlon) and David(@whaleygeek).  The actual preso was well attended and it seemed to fill a need, as most people were aware of Minecraft and were interested in seeing what they could do with it in their classes. Keep in mind that this was a CS teachers’ conference, so we were looking at that very narrow strip of MC usage.

I got an invitation at the end of my session to present a pre-conference on Minecraft next summer in Denver at ISTE. Cool!

So what I enjoyed about my first CSTA:

  • being at nerd central — coding, cool machines, cool apps, and
  • cool people! Special shoutout to Dr Sarah Guthals(@sarahguthals) from LearntoMod who has a great product and is an awesome fellow traveler on this coding in Minecraft journey sarahme
  • meeting some people I only knew from reading them, like Alfred Thompson(@alfredtwo) and Mark Guzdial, and Laura Blankenship(@lblanken)

 

 

So what’s next? Definitely a determination to learn more Minecraft — modding, servers, coding cool stuff in Python…. and a determination to connect with other educators doing this or interested in doing it. Would also love to connect with some modders and learn more about that…. got to finish my Digital Youth course on learning to mod in Java, follow up on LearntoMod’s growing product, learn some more javascript…. oh, and get ready for school… learn more GameMaker, App Inventor, Small Basic…. got to go!

Coding in Minecraft redux

aim.bookI’ve spent a good part of this quarter in my 8th grade classes trying out some ways to code in Minecraft, as you know if you’ve been following this blog.  See below for various attempts and approaches. I’ve looked at command blocks, LearntoMod, ComputerCraft (using Lua), ScriptCraft (using Javascript), Youth Digital’s Modding in Minecraft (using Java(!))…. They’ve all got features to recommend them, and I’m sure any of them would be awesome in the right situation. I’m not making any blanket thumbs-ups or thumbs-downs.

But here’s what worked best in my class —- something I got from the book Adventures in Minecraft by Martin O’Hanlon and David Whale.  It’s an amalgam of Python, Minecraft, the Bukkit server, and Raspberry Pi. This odd little mutt suited my purposes really well. I call it Mython.

Technical details — you can get a folder with everything you need here, which includes the Bukkit server and the Minecraft/Python API. You’ll need to run Python 2.x (so far), Minecraft 1.6.4, and the current version of Bukkit. Others have ported it to other servers (Forge and CanaryMod), Python 3.x, and more recent versions of Minecraft. I just wanted something that would run with minimal hacking on my part, as time was running out in the quarter.

I had to do some monkeying around with accounts and permissions on my lab computers, and the results required more logins than I was happy with, but that can be fixed for next year. The important thing is that I was able to achieve my goal of introducing a text-based programming environment that was accessible to my 8th graders and did some fun and cool stuff in Minecraft. Mission accomplished!

Students were able to build magic bridges, instant houses, and “draw” in luscious Minecraft 3D with turtles! And if you know me, you know I’m a big turtle fan.

Not only that, but the authors were incredibly helpful in answering questions that I posted on their forum. So yeah, you can say I’m a fan. Can’t wait to fine tune it for next year!

I asked the students how they liked it compared to the other approaches, and someone said, “It’s about 4000 times better!” Good enough for me!