Starter Town Logo

Starter Town Ep. 4: Shopping without a List

June 14th, 2025

You stroll through the Starter Town market, with a little extra coin in your pouch and a lot of misplaced confidence.

Ooh la la… What do we have here?
Ooh la la… What do we have here?

Let’s talk numbers

No one love’s it but when we’re coding, we have to confront it sooner or later. You slick puppy, you knew it was coming.

We use something called operators to handle those pesky numbers. We can think of them like the kitchen tools that flip and stir our tasty data.

+   # addition
-   # subtraction
*   # multiplication
/   # division
**  # exponent
%   # modulo (remainder)

But hold that thought —

As you’re strolling the market, that’s when you see it.
Artisan Cat Collars | Handwoven, triple stitched, and nap tested
You’re sold.

“I’ll take three,” you say proudly.
“And I’ll leave a 10% tip! I’m generous like that.”

Let’s try to use our noodle

Each time we tally up the price, we’re writing an expression: a line of code that calculates a result.

You do the math in your head... or so you think…

total = 12 * 3 + 0.10

The vendor stares. “So… you’re tipping a tenth of a coin? On a 36-coin order?”

You glance at the receipt and then your shrinking pile of coins... Something doesn’t quite add up. You only added 0.10 instead of 10% of the total.

The vendor sighs and pulls a chalkboard from under the stall

The order of operations (PEMDAS)

  • Parentheses
  • Exponents
  • Multiplication & Division
  • Addition & Subtraction

Let’s make this more delicious. Just like assembling a sandwich, the order you math in matters. If you add the peanut butter after you eat the bread… something’s off.

So let’s go back to the chalkboard and figure what these collars should actually cost…

total = 12 * 3 + 0.10               # Wrong
total = (12 * 3) + (12 * 3 * 0.10)  # Better

But wait, let’s clean this up with variables to label the data. Giving our numbers meaning will make it less messy and easier to read.

base_price = 12 * 3
tip = base_price * 0.10
total = base_price + tip

And that leaves us with $39.60 and we didn’t even have to use our noodle.

A few awkward seconds pass. The vendor bags your collars. They’re embroidered, shimmering, perfect.

Now you’re 40 coins down and you look down at your paws…
Now you’re 40 coins down and you look down at your paws…

“Wait a minute, I’m not a house cat. I don’t even wear collars…”


Quest Log Updated.

  • Basic math operators in code (+, -, *, /, etc.)
  • Control calculation flow with the order of operations (PEMDAS)
  • Use variables to organize and label numerical values clearly

Episodes

© 2025 Blackcat School of Interactive Arts. All rights reserved.