Category Archives: programming

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!

 

ComputerCraft or LearntoMod?

creeperI spent some block periods (90 minutes) with my 8th graders, introducing Lua in ComputerCraft. I learned a lot my first period, as in what not to do: don’t let the students roam free and then expect them to bear down and do coding in the computer in Lua. Lesson learned.

The next class I made a flat world, set up each student with a computer next to a sign with his/her name, and used a disallow block to limit the building. Voila. I really should have anticipated that issue but didn’t. So students got into their computers, I showed them the intricacies of the command line, the terminal, the lua editor …. all those DOS-like things that they have never seen in their lives. Yes, the editor is clunky and colorless, and the pixellation of the characters is Minecrafty. Once we got through that we did some HelloWorld, some HelloUser, and even a GuessTheNumber game. So we learned variables, IO, random math, and if statements. Nice!

However, one of my students asked me what it all had to do with Minecraft. Very fair question. Answer: nothing really, but we’re just starting and tomorrow we’ll start with turtles. They know turtles because we went to Turtle Island, a wonderful world/mod made my Michael Harvey.

But that student’s question really started me thinking (btw, thanks, Ben!). We could do almost all of that in Small Basic, which has a much better editor, Intellisense, and turtles (though those turtles are not 3D). So I’ve also had some students dabble in LearntoMod, and that learning takes place in a familiar Minecraft world, and you learn to mod stuff that you use all the time in Minecraft: weapons, tools, zombies, creepers, etc.

Hmm. So Monday I’m going to try a little LearntoMod with those classes, and we’ll see what happens. I have my suspicions, but I’ve been wrong before.

Minecraft Coding

minecraftI’ve spent a good part of my spring break investigating coding in Minecraft. Actually, I’ve been looking at all kinds of avenues to do this over the past several months. Why? Because Minecraft is an amazingly awesome piece of software,  kids love it,  and it can be a fantastic gateway to learning coding.

There are so many approaches, however. I’m not the only one who noticed the above, and there are a raft of avenues out there touting their awesomeness for teaching coding through Minecraft. I’ve looked at many of them, and there is no One Way to do it. So much depends on the age and experience of the kids you’re teaching, what you feel comfortable with, etc. I’m doing it in my 8th grade classes, as a bridge between GameMaker and Small Basic. So kind of a first introduction to text-based programming. Or as I call it: Taking the Training Wheels Off.

After looking at modding in Java, writing plugins in Java, some Snap and Javascript, I think I’ve found what’s going to work for me in my situation. The Computercraft mod uses the Lua scripting language, and Lua is just simple enough that I think it’s workable for an intro to text-based coding. Shameless plug — I’ll be presenting on Teaching Programming in the Middle School Using Minecraft at the CSTA conference in Dallas this July.

Stay tuned for more.

Teenage Mutant Ninja Turtle Graphics

squarePinwheelIn my last post, I wrote about my decision to go with Small Basic as the best introduction to text-based coding in my classes. We make the jump in 8th grade CS, after having spent a month or so with GameMaker.

As I explained to my students, it was now time to take the training wheels off. We started with your basic TextWindow stuff: Hello World, getting user’s name and saying hello, calculating the user’s age in dog years, a simple savings calculator, a tip calculator. We slogged through my examples and students picked up some of the basics — variables, if statements, math calculation. All well and good. Not exciting but a good start.

After 2-3 days of that, I introduced the GraphicsWindow. We did shapes, fills, lines, background colors. Interest rose, as they could see the results of their code and the added benefits of color. The other day I introduced the Turtle… and BOOM! Knowledge and enthusiasm explosion.

I introduced FOR loops (with some trepidation, since I’ve found it’s a tricky concept for most middle schoolers). I casually demoed making some cool art with FOR loops. EVERYONE wanted to know how I did it. Showed them the simple code and challenged them to change it up, make it more colorful, experiment with different angles and movements. I had already introduced GetRandomColor, and kids went crazy. Some wanted to have a Turtle Art Exhibit.

Next up… making the art interactive. But I feel even more convinced that Small Basic is the right choice.

And the winner is…

sb_logo… so far: Small Basic. Here’s why:

  • English-like commands
  • Intellisense
  • Auto-complete
  • Turtles!
  • Limited # of objects
  • Can be a path to Visual Studio (has a “graduate” feature to VB)
  • It makes sense to me

I admit to being a bit skeptical before trying it. I didn’t like the dot notation and thought kids would get confused by it. I didn’t like the length of some of the commands (like GraphicsWindow.GetRandomColor!). And frankly, I was prejudiced against it because it was a Microsoft product.

So I devoted some hours to poring over tutorials, learning some basic coding, making my own game, learning keyboard controls, etc. Once I got immersed in it (“down the rabbit hole”), I started to love it. Now I have had some experience with Visual Basic years ago, and perhaps that’s what made it make sense to me.

Tried it with my 8th graders, and they caught on to the basics pretty quickly. Intellisense was a HUGE plus, as was autocomplete. And turtles, FTW!

Is it perfect? No. You could easily make a case for Python or Processing. And I haven’t eliminated them from the possibilities. But for now, I’m liking what I’m seeing.

Finding the best coding language for beginners

if-kids-in-third-grade-can-handle-coding-so-can-youThe title is a red herring. First, what do we mean by beginners? Second, I don’t think there is a “best” language, even if we could define who those beginners are. Here are some thoughts from the trenches, though.

I started a new job this fall teaching CS in grades 7-9, so I’ve covered a pretty wide spectrum of “beginners” with various backgrounds and levels of understanding CS. Here’s what I’ve done by grade:

7th grade — HTML, Scratch, LEGO Robotics (and a little 3D modelling using MinecraftEDU.
8th grade — HTML, GameMaker, a bit of Minecraft exploring, Small Basic.
9th grade — Blitz Basic, S2 Robots, App Inventor.

We’re trying to find the right combination of challenge and enjoyment, correct scaffolding, what works, what doesn’t…. It’s been quite a ride. Things that I thought would be a slam dunk because I’d done them before, like Scratch, were more challenging than I expected. Things that I thought my 8th graders would love, like GameMaker, weren’t loved. Small Basic, which I thought would be too confusing, went really well once we got into turtle graphics.

To be fair, I’ve had to learn an incredible amount of stuff. I’d never heard of Blitz Basic till I started here. Never dabbled in Small Basic and have never used the SR robots and the Propeller language. My lab is a dual boot environment, with a Mac platform and Boot Camp for Win7. It took a few weeks to get everything running smoothly technically. Which is all to say that I was teaching stuff that I was learning just ahead of the kids.

More conclusions in the next post…..

Javascript & JQuery

book coverReading this fabulous book by Jon Duckett. I’ve had a nodding acquaintance with JS just from doing some web design and dev. I decided it was time to formalize and solidify my understanding so I bought this book. If you’re a visual learner like me, you’ll probably get a lot out of this book. Some concepts I can get just from reading, looking at code, writing code, etc. But I’m finding that a well-designed visual approach really helps me understand things better. And since I’m a teacher, I’m always looking for ways that will help others get the concepts. This book is full of such examples.

It’s beautifully designed as well. Kind of a coffee table style. Lots of white space, large charts, color photos, etc. But it’s not just the design, though that certainly helps. The author takes the time to explain each concept carefully, with many commented examples. The scaffolding is also logical, as he introduces concepts clearly and then builds upon them.

Highly recommended.

Twitter as a neurological extension of my brain

world_connectionsI was going to title this “Why Twitter is awesome” and then thought that sounded cheesy. Then I thought about what I love about Twitter and came up with the above title, which is the opposite of cheesy. Probably pretentious.

But there’s something about that scrolling feed of ideas, thoughts, lesson plans, jokes, pictures, movies, and questions that directly feeds into my own thought processes. Part of it is due to the people I follow. I try to surround myself with people who are interested in the same things I’m interested in: learning, making, coding, and thinking about the intersection of learning and technology. Then I curate my Scoop on Learning on the Digital Frontier and post those as Twitter feeds. People who think those are interesting retweet or follow. And I meet more interesting people. And I learn more.

It seems to fit my thirst for learning, my hyper-focused mind, my always-on curiosity. Now I can’t imagine life without it.

Escaping the Echo Chamber…chamber….chamber…

It just feels like it’s time. I’ve been in edtech for over 15 years now. I applaud the efforts of those who are trying to reform the educational system and make it reflect the modern world. But truthfully, I yearn to do something more than retweet what others are saying. And a lot of what goes around is simply that. I hear very few contrarian voices (maybe Gary Stager is the most prominent exception). There’s an awful lot of preaching to the choir.

So I’m pruning my Twitter feeds,  my RSS feeds, my Zite reading, and concentrating on actual learning projects that are  jazzing me. At this point, I’m looking at the Arduino, the Raspberry Pi, webmaking, and robotics. The common thread is that all of these are about doing something. I’d rather move into Mad Scientist Mode and see what students are coming along for the ride. My experience has been that nothing gains student involvement like passion, and they can inherit some of that passion from other passionate people, like their teachers.

Who’s with me?
echo chamber 7

Teaching HTML in middle school

We’re kicking it old-skool! OK, sorry for the lame attempt to be hip. But a blog post by Tess Rinearson about teaching computer science in middle school recommended teaching HTML the Old Way. We’re talking Notepad, folks.

I was happy to read this, because that’s exactly what I’m doing right now with my Digital Multimedia class, which is one of our offerings in our arts block.  The current unit is an introduction to web design. Yes, I realize there are many WYSIWYG tools out there that will enable anyone to create a spiffy web page without knowing a single HTML tag. Dreamweaver is awesome, and we’re going to use it after we learn some HTML, some CSS, and a dollop of Javascript. But my question is always, “What happens when the design you want doesn’t work or won’t display the way you want it to?” Dragging and dropping can only get you so far, and in fact, can compound the original problem by generating more HTML code and further fouling up the works.

Knowing how to get “under the hood” is a necessary skill, and even an elementary knowledge of HTML can help the troubleshooting process. Plus, and this is the part I love, it gives the students a measure of control over the technology they are using. And it can be an important gateway experience for further computer science study. From a gender perspective, about half the class is female. So I hope that I am helping them have a positive experience with coding that will carry on later. It’s a win-win.

Questions I asked my class:

What’s the coolest thing about learning HTML?

“Links and fonts.” — Clark

“The links.” — Greg

“You can put virtually anything you want on a website with the coding, and how it all works together.” — David

“The image with the link. That you can use an image to be a link you click on.” — Chandler

“You can pretty much do everything you see on a normal website with HTML.” — Danny

What’s the hardest thing so far?

“That you have to have all the tags, the closing tags, everything right.” — Sam

“If you make a mistake, you don’t know till you save it. Then you have to go through all the code and find it.” — Mali

What did you learn about the internet that you never knew before learning this?

“You look at all these websites, and you realize that there’s all this coding behind it for them to work.” — Victoria

“You look at a website and it looks all different and pretty, and then you see the code and what makes it look like that.” — Chandler

“I learned that it’s pretty simple, and really anybody can do it.” — Drew

“A lot of websites use code that they get from other websites, but there has to be one that did it first.” — Ethan

 

html code