Using the Gug-inator

To use the Gug-inator, you’ll issue subcommands. Here’s an example:

$ python3.5 food Monday
$ python3.5 mood bluce nopaz

In the first example, we use the food subcommand. In the second example, we use the mood subcommand.

Pretty easy, right?

There are three subcommands which are described below. You’d think this would be enough to help you take care of your pet, but I really don’t trust you to do that, Norm.

If you get stuck and don’t know what a subcommand does, just use the --help flag:

$ python3.5 --help
usage: [-h] {food,walk,mood} ...

optional arguments:
  -h, --help        show this help message and exit

    food            Identify food
    walk            Calculate walk
    mood            Handle mood

You can use it with the subcommands, too:

$ python3.5 food --help
usage: food [-h] day

positional arguments:
  day         The day of the week

optional arguments:
  -h, --help  show this help message and exit

How to Feed Gug

Through months of trial and error, I’ve finally figured out how to feed Gug [1]. It turns out that his hunger is predictable, and it’s based on the day of the week! You can use the food subcommand of the Gug-inator to find out how to feed him like so:

$ python3.5 food Monday
Gug wants one gallon of saurkraut

Easy enough right?

Days and Foods
Day Food
Sunday frozen corn
Monday one gallon of saurkraut
Tuesday hot dog water
Wednesday drywall
Thursday grass clippings
Friday old bananas
Saturday dirt

Here are a couple of neat features of this subcommand:

  • Capitalization doesn’t matter [2]

    $ python3.5 food mOnDaY
    Gug wants one gallon of saurkraut
  • If you enter a day that is not a day (including, but not limited to “Blernsday” or “Babberday”), the program will show an error message:

    $ python3.5 food Babberday
    Error! Babberday is not a valid day of the week

How to Walk Gug

Gug loves to go on walks! If he doesn’t, he gets very grumpy and starts disassembling all of my precious -inators. He’s a picky creature though. Whenever you walk him, make sure you travel at least 6 blocks East/West and at least 8 blocks North/South. If you don’t, he will be upset. And that will be your (literal) mess to clean up.

Here’s an example of a route I take sometimes:

A typical walk with Gug

Sometimes I like to pick up a frozen yogurt and Gug likes looking at the kitchen gadgets at IKEA.

As you can see, we travel a total of 8 blocks north-south, and 8 blocks east-west. How do we calculate that?

Calculating distance traveled
Path Distance Traveled Total Distance Traveled
(0,0) -> (0,3) 3 blocks North 0 East/West, 3 North/South
(0,3) -> (2,3) 2 blocks East 2 East/West, 3 North/South
(2,3) -> (2,2) 1 block South 2 East/West, 4 North/South
(2,2) -> (3,2) 1 block East 3 East/West, 4 North/South
(3,2) -> (3,3) 1 block North 3 East/West, 5 North/South
(3,3) -> (4,3) 1 block East 4 East/West, 5 North/South
(4,3) -> (4,1) 2 blocks South 4 East/West, 7 North/South
(4,1) -> (2,1) 2 blocks West 6 East/West, 7 North/South
(2,1) -> (2,0) 1 block South 6 East/West, 8 North/South
(2,0) -> (0,0) 2 blocks West 8 East/West, 8 North/South

But I know that’s complicated, Norm. That’s what the walk subcommand is for! Here are a couple of examples:

$ python3.5 walk 0,0 0,3 2,3 2,2 3,2
(3, 4)

$ python3.5 walk 0,0 0,3 2,3 2,2 3,2 3,3 4,3 4,1 2,1 2,0 0,0
(8, 8)

As you can see, the East/West distance is shown first, then the North/South. The Gug-inator is able to handle a couple of other cases too:

  • If you don’t use integers for coordinates, you’ll get an error message:

    $ python3.5 walk 0,0 0,bob
    Error! 0,bob is an invalid coordinate
    $ python3.5 walk 0,0 0,3.4
    Error! 0,3.4 is an invalid coordinate
  • If you don’t format coordinates correctly, you’ll get an error message:

    $ python3.5 walk 0,0 0,,3
    Error! 0,,3 is an invalid coordinate

How to put Gug to bed

Gug simply can’t go to sleep if he hasn’t heard his goodnight song.


Or, more simply:

['Db', 'Bb', 'Db', 'F', 'Db', 'F', 'Ab', 'Ab', 'Ab', 'Ab']

Since he refuses to speak [3], you can figure out what to play based on his mood. I don’t understand Gug’s emotions. They all look angry to me. However, you can tell his mood based on the color of his eyes. Each of his eye colors specifies an offset into the song:

Eye color and song offsets
Eye Color Offset
bluce 0
turporple 1
aquamablue 2
nopaz 3

It’s a good thing you have high-tech cameras for eyes, Norm. I can’t see those other-dimensional colors like you can.

His left eye color tells you when to start the song. If it’s bluce, you’d start at the beginning of the song. If it’s aquamablue, you’d leave off the first two notes.

His right eye color tells you when to stop the song. If it’s bluce, you’d stop at the end of the song. If it’s nopaz, you’d leave off the last three notes.

Use the mood subcommand to figure out what to play for Gug:

$ python3.5 mood bluce bluce
['Db', 'Bb', 'Db', 'F', 'Db', 'F', 'Ab', 'Ab', 'Ab', 'Ab']

$ python3.5 mood aquamablue nopaz
['Db', 'F', 'Db', 'F', 'Ab']

This subcommand has a couple of features, too:

  • Capitalization doesn’t matter:

    $ python3.5 mood AquamaBlue NOpaz
    ['Db', 'F', 'Db', 'F', 'Ab']
  • You’ll get an error message if you use an invalid color:

    $ python3.5 mood aquamablue red
    Error! red is not a valid color
    $ python3.5 mood red aquamablue
    Error! red is not a valid color
    $ python3.5 mood red blue
    Error! blue is not a valid color

So, Norm, break out your bells and play whatever the Gug-inator feels like. Otherwise he’ll never go to sleep.

[1]By the way, please pick up another barrel of Neosporin at Costco. I used all of the last one it after Gug’s last feeding.
[2]I know how much trouble you have with the Shift key, Norm.
[3]I know he can. He pretends like he can’t but I’ve heard him order pizza on the phone more than once.