JoC #6: Adding random behaviour

    The solution of every problem is another problem.
          — Goethe

Setting off on our path to create a little computer game, today we look into random behaviour. Random events are, of course, very important for games. If everything were entirely predictable, many games would be boring.

So, sit back and watch to see how we get Trick the Turtle to stagger around randomly.

Download video

And now do it yourself!

Concepts discussedif statement, random numbers, Greenfoot API documentation

JoC, Teacher Commentary 5: Early coding examples

    ‘When I use a word,’ Humpty Dumpty said, in rather a scornful tone,
    ‘it means just what I choose it to mean — neither more nor less.’

    ‘The question is,’ said Alice, ‘whether you can make words mean so
    many different things.’

    ‘The question is,’ said Humpty Dumpty, ‘which is to be master — that’s all.’

        — Lewis Carroll, Through The Looking Glass

 

Welcome back to the teachers out there. Here are a few remarks about Episodes 4 and 5 of the Joy of Code series.

If you have any questions or comments, let me know in the comments section here on the blog, and I will respond to them in the next episode of the teacher commentary.

Download video

 

JoC #5: If statements

    The sooner you fall behind, the more time you’ll have to catch up.
        — (unknown)

Continuing straight on from the last episode, we now make the turtle turn at the edge of the world.

Download video

Concepts discussed: method return value, boolean, if statement

Nothing to download – we continue with the scenario from last time.

 

JoC #4: Finally – some code!

    Good things, when short, are twice as good.
        — Gracián 

Yes, finally we’re getting into some coding!

Download the brand-new trick-the-turtle scenario (below), watch today’s episode, and then have a go yourself!

Download video

Concepts discussedmethod call, parameter, method definition

Scenario download: trick-the-turtle-v1.zip    (save and unzip before opening)

JoC, Teacher Commentary 3: Objects and classes

    Treat people as if they were what they ought to be, and you help them to become
    what they are capable of becoming.
            — Goethe

So, here we go, the first instalment of a Teacher Commentary.

If, you may ask, this is the first one, why then is it called “Teacher Commentary 3”?

Fair question, but there is method in this madness. I have decided to number them not sequentially, but in sync with the main Joy of Code episodes. Each Teacher Commentary will get the number of the episode it refers to. Since this commentary talks about episode 3, it is Teacher Commentary 3 (or TC-3, as I will soon start to call them in the headings).

Sometimes the teacher commentaries may not be tightly associated with an episode, but they will still fit in somewhere in the sequence, so they will get whatever number we’re up to in the main episode sequence.

One more rhetorical question before we get to the video: What is a “teacher commentary”?

The TC videos are meant for people who are not only concerned with learning object-oriented programming, or Greenfoot, or Java, but with teaching it. It talks to you as a teacher.

If you are not a teacher, you’re of course welcome to look at it as well, but I’m not sure how interesting this will be for you. Maybe your time is better spent moving on to the next main episode. (You won’t miss anything important.) Your choice.

Download video

 

JoC #3: Classes and objects

    If a man writes a book, let him set down only what he knows.
    I have guesses enough of my own.

          — Goethe

Alright, now it finally starts getting interesting! After the previous talk about installation, now we’re getting started actually doing stuff.

Watch this episode to get the first feel for working with Greenfoot, and see what classes and objects are all about.

Download video

Concepts discussed: class, object, method, instance, return value, return type, void, int, boolean

And, as I said in the video: Follow @JoyOfCode on Twitter to get updates when new episodes are posted.

Scenario download for this episode: hedgehogs.zip      (save and unzip before opening)

The Joy of Code, #2: Installing Greenfoot

     A professor is someone who talks in other people’s sleep.
          — attributed to W.H.Auden

Straight on the heels of the first episode comes the second: Installing Greenfoot.

We’re still not quite ready to write code, but we’re getting there. Setting up the environment is important, so we’ll do that first.

Download video

I made one mistake in the video: For running on Mac OS, Mac OS X 10.5 (Leopard) is required as a minimum OS version (not Tiger, as I said in the video).

The links mentioned in the video are:

The Joy of Code, #1: Introduction

    Everything that is worth doing is worth doing well.  
        — proverb 

Here is the first instalment of the Joy of Code programming tutorial. No coding yet — this intro just shows you what you’re getting into if you choose to follow this tutorial.

Download video

If you are itching to get your hands dirty and start coding: great! That’s the kind of reader I like. Don’t worry, we’ll get there very soon.

Links mentioned in the video:

Greenfoot scenarios shown in video:

(Note: At this stage you are not expected to do anything with these scenarios yet. These are just here for those of you curious to play without waiting for me to introduce things.)

Download video

The Joy Of Code: Join us for a free online programming course with Java and Greenfoot

Want to find out how to write a computer game? Interested in learning programming? Curious about object-oriented programming and Java? Heard about Greenfoot, but don’t really know what it is? Teaching programming to others?

If any of these is you — read on!

We will soon start here, in this blog, a programming course. It will be done mostly in video format (often screencasts of actual programming sessions). We will start at the very beginning — assuming you know nothing about programming at all — and then progress through a sequence of many important topics. We will, assuming things go well, eventually arrive at quite sophisticated concepts and hopefully write some really cool programs along the way.

There will be two “streams” to this course: The main stream, aimed at novice (or intermediate) programmers, and — occasionally weaved in — an “educators’ stream” with commentary for teachers. The teacher commentary will talk about how to teach programming (rather than learning it).

So, I hope to hit three possible audiences with this:

  • Folk who want to learn about programming. Maybe you don’t know any programming at all, or you know some already but want to learn more.
  • People who know about programming, but want to learn about Greenfoot.
  • Teachers of introductory programming classes who want to see and discuss ideas about teaching programming.

For this blog, we will use Java and Greenfoot. If you dont know what that is — don’t worry. The first couple of posts will show you.

Above, I said “we” will soon start. It’s “we” because I hope I won’t be alone here. I would like as many of you as possible to get involved. The course has not been developed yet, and I will make it up as I go along. While I do that, I’d like you (yes: you!) to give me feedback in comments. Ask questions, tell me what’s unclear, tell me what I should explain again or in more detail, tell me what else you’d like me to talk about.

If things go well, this can become interactive, and paced and guided by viewers — that’s you.

I hope that over the first few weeks I’ll manage to get a handful of readers/viewers who join in and help me move this along.

The course will start in a few days. So: Bookmark this page, subscribe to the RSS feed, tie a knot in your handkerchief, set a calendar reminder, or whatever it is that will remind you, and come back soon!

 

Copyright, license and redistribution

It’s necessary to add some license info here – these questions always come up eventually. So: I will publish these videos here on my blog and on Youtube. Additionally, I will make the videos available for download.

All videos are Copyright © Michael Kölling.

You are explicitly permitted to download, use, show and distribute these videos for the following purposes:

  • For any personal use.
  • For the purpose of teaching a class of students, where you are the instructor.

You are not permitted the following (unless with explicit written permission):

  • Re-publication to the general public, via websites or on other media (CDs, etc.).
  • Redistribution for profit.

That is: You cannot do two things: Sell my videos for money, and duplicate them on your own web site.

The reason for the second is that I’d like people to come to one place here, because I hope to have some discussion with viewers on the site here in the comments. I do not want to split up out viewer community.