Turtle Power Part I: Config File Tweaks

Once I learned the basics of Turtle programming through Craig Wentworth’s fantastic ComputerCraft Code Academy, I was excited to start experimenting.

Here’s the very simple setup I started with.  Left to right, that’s my computer w/command prompt, floppy disk drive, and turtle.

2014-08-16_13.20.24

The plan was to write a program and save it to a floppy disk so that it could later be copied to the turtle.  It’s possible to program a turtle directly, but I thought the disk seemed more useful for a classroom setting because it would allow the program to be easily copied to multiple turtles, and because the disk could be placed in a chest for students to come upon and use at a particular point in the lesson.

I learn best by doing, so I didn’t bother much with research, deciding instead to jump right in.  It was a bit of a bumpy road!  But fun.  And frustrating.

One issue I ran into right away was the need to provide the turtle with fuel before it could move.  Not really a big deal since I was in creative mode (with unlimited access to resources) but it seemed likely that the refueling process would become repetitive and I preferred to find a way around it.

Luckily it was an easy fix.  I just navigated to the ComputerCraft config file (you can see the path in the screenshot below) and changed one setting.

config files Right at the bottom of the file, you’ll see “# Set whether Turtles require fuel to move.”  The value is “true” by default and you’ll want to change that to “false.”

nofuel

Then don’t forget to repeat on the client side config files!

If you have a lot of client computers, it could definitely get to be a hassle to modify config files, so it’s worth reviewing all the available settings to see if you might want to change any others at the same time.  Alternately, you could just modify your own client config file while you’re messing around with Turtles and then switch back to turtlesNeedFuel=true when you’re ready to go live with your class.

Make note of the “Enable the ‘http’ API on computers.”  That setting will come in very handy in the future.  “Enable Command Block peripheral support” is another very interesting and powerful capability that I don’t yet know enough about to post on but am looking forward to understanding better.

In the meantime, you’ll notice that the config setting for ComputerCraftEdu allows Beginner’s Turtles to move without fuel by default.

educonfig filesSo if you find that the Beginner’s Turtles meet your teaching needs (See ComputerCraft v. ComputerCraftEdu), you can bypass the fuel requirement without changing anything.

Good to know.

Exploring ComputerCraft Code Academy

ComputerCraft Code Academy is a MinecraftEdu world created by Craig Wentworth and available for easy download through the server launcher or directly from the MinecraftEdu World Library.  It’s an excellent introduction to programming and ComputerCraft (not ComputerCraftEdu).

Students work through four puzzle challenges of increasing difficulty and are then free to experiment with writing their own programs in the building and mining areas.  Information, tutorials, and needed items are all given automatically by non-player characters (NPCs), so the lesson is entirely self-contained and self-paced.

The Code Academy is set up so that up to 40 students can play at the same time, completing the challenges in parallel.  Here I am at the entrance to classroom 19, where I will need to complete my first challenge in order to proceed.

2014-08-15_15.33.52

Clicking on an NPC named Embrera introduces me to the challenge and points me in the right direction, letting me know I need to click on the instruction panel in the wall to my left to begin.

 The instructions reveal that the first challenge is to reset the password to a locked door and then use the new password to open it.  The link at the bottom leads to a Google Docs tutorial that walks me through the process step by step.

MinecraftEdu_1_6_4_classroom__stable_build_14_ 3

 This excerpt from the tutorial shows the code that makes the password function to open the door.  I don’t need to be able to understand the whole program at this point but it’s a good introduction, and it provides additional information to students who have a more advanced understanding of coding.

Open_Sesame_-_Google_Docs

 After changing the password, I was able to open the door and move on to the next challenge, the Turtle Maze!

MinecraftEdu_1_6_4_classroom__stable_build_14_ 4

 An NPC introduces me to my first turtle and gives me instructions for using a command prompt to move it through the maze.

2014-08-15_14.29.12

The maze is challenging and throws a few surprises my way.  But I feel accomplished at the end, all the more so when I learn that I’ve earned my own turtle, the fuel it needs to run, and even a few bonus items!

2014-08-15_14.30.33

 Now the real fun begins–programming!

2014-08-15_14.31.30

 The tutorial walks me through the DigUp program which turns a blank wall into a stairway.

Turtle_Program_-_Google_Docs

Once my turtle is named and fueled up, I’m ready to give it a try.

2014-08-15_14.42.47

 Normally I would be able to jump over the short walls to either side, but these are bounding blocks that I can’t go beyond.  There’s only one way out, and it’s through that wall.

2014-08-15_14.47.28

 A view of the other student lanes. 

2014-08-15_15.42.47

 It works! 

2014-08-15_14.51.58

Going up.
2014-08-15_14.52.54

Surprise!  At the top, another NPC with another challenge!  This time I need to write the program myself, with a few hints but no instructions.

2014-08-15_14.53.33

Here goes nothing!  Ready to run my DigDown program.

MinecraftEdu_1_6_4_classroom__stable_build_14_

All right!

2014-08-15_15.24.36

Well, this is when I ran into a major snag.  Even though my turtle successfully dug a stairway through the wall, there’s not enough clearance at the entrance for me to get through.  So I’m stuck at the top!  And because I’m playing as a student rather than a teacher, I can’t get myself out of this fix.  So I’ll never reach  the free building area below.

<Sigh>

2014-08-15_15.43.44

So you’d want to make sure your instructions address this issue explicitly before using this world in your classroom, or use the Minecraft Teachers Google Groups Forum to troubleshoot the issue.  Of course, if this happened in a class setting, the teacher would be able to use his or her superpowers to give me a new turtle so I could try again, or teleport me directly down to the build area with the others.  

Overall, though, this world is really well-designed and accomplishes its learning objectives quite nicely.  This was actually my first introduction to turtles, and I learned a lot about how they work and how they can be used.  Can’t wait to start writing my own programs!