Programming Basics for Duncan part III: If and Loops

Your most basic and common decision-making statement is the if command. It always takes this form:

IF (some test that returns a boolean true/false) THEN (do something)

So you have a test and a something(s) to do if the test resolves to true. This is where we use the comparitors from last chapter:

IF x=5 THEN do something
Continue reading “Programming Basics for Duncan part III: If and Loops”

Programming Basics for Duncan part II: Primitives

It’s fun to call them primitives because it makes you feel smart but what we are talking about are the most basic things in a program.

Values

The most basic thing in a program is a value. It is what it is. It can be a number, 5 if my favourite, a letter like K or k or perhaps a decimal like 0.7. Or maybe a boolean value like 1 or 0. It is only one thing. It is a single answer to a question. It is not a word, those a strings, which are a list of values.

Continue reading “Programming Basics for Duncan part II: Primitives”

Programming Basics for Duncan Part I: Hello World

The classic first program on any platform is to output the string “Hello World”. Hang on, string? Yes, it’s a string of characters: H-e-l-l-o-space-W-o-r-l-d. Technically, it’s an array but you don’t need to know about that now.

Continue reading “Programming Basics for Duncan Part I: Hello World”

Cruzin’ Day IV: Poison & Magic

This post is part of a series. You can go back to the first one at Cruzin’ then Cruzin’: Day 2. There’s our sojourn in Mexico and this is part four.

Continue reading “Cruzin’ Day IV: Poison & Magic”

Cruzin’ III: Mexico Adventures

This post is part of a series. You can read Cruzin’ and Cruzin’: Day Two that occur before this one

What’s surprising about this trip is that, even though it’s open-bar, I’m not hungover and am waking for the sunrise each day. I never do this at home.

View from cabin of lights on the mainland
There’s the old 08 again.

That over there, that’s the mainland, Met-hi-co. But we’re not going there, we are heading for a little place called Cozmel, an island apparently constructed and operated by cruise-lines.

Continue reading “Cruzin’ III: Mexico Adventures”