Duck Cards

The card format

What a Duck Card means, how a row is read, and what a reader should send. Short enough to read in one sitting, and exact enough to build on.

Status

This is duck-cards/0. Its words come from Studio's plan vocabulary, r001, and a row becomes a duck-intent-plan/0 plan.

Nothing reads cards yet. Not Microduck Studio, and nothing else this project knows of. The format is written down first, so that every deck printed before a reader exists agrees with that reader when it comes.

The deck file, duck-cards.json, holds the same information as data. Every card on this site is drawn from it.

A card

Trick

Kick, right

kick_right

  • Studio
  • Pad: RB
61
Band
The category. The colour is for sorting at a glance; the word is there for black and white printers.
Picture
What the duck does, for readers and for children who cannot read yet.
Name
The card in Studio's own words, wherever Studio has a word for it.
Code word
The label a reader sends, spelled the way Studio's plan spells it.
Where it runs
Studio, when the duck in Studio's Play screen can do it. Pad and a button, when the gamepad can.
Code and number
An AprilTag and its number. The number is the card.

Reading a row

A row is one line of cards, read left to right like a sentence.

  1. Start and End mark the row. Both are optional. When they are on the table, nothing before Start or after End is read.
  2. An action card is a step. Walk, Trick and Sound cards each make one step, in the order they lie.
  3. Under changes the card above. A Speed or Look card placed directly below a card adds to that card's step. Under a card that cannot take it, a reader ignores it and says so.
  4. Repeat makes a bracket. Repeat opens one and End repeat closes the nearest one still open. The count is written on the Repeat card, and a reader that cannot read handwriting asks for it. Brackets can sit inside brackets.
  5. When it falls starts a second row. If the duck falls, the first row stops. Once the duck is back on its feet, the second row runs from its first card, and then the program ends.
  6. Your cards mean what the deck file says. A reader that has no meaning for one stops at it and says which card it was.

Into a Studio plan

A row becomes the steps of a duck-intent-plan/0 plan, the format Studio's plan editor reads from a router. Each action card is one step, and the card's name is the step's clause. A card under it adds a label to that step. Control cards shape the steps and never become one. A plan has no events, so a When it falls row stays with the reader.

The row on the Duck Cards page becomes this:

{
  "format": "duck-intent-plan/0",
  "request": "Start. Say hello. Walk forward, slowly. Turn left. Kick with the right foot. End.",
  "model": "duck-cards/0",
  "steps": [
    {
      "clause": "Hello",
      "labels": {
        "action": "make_sound",
        "sound": "greet"
      }
    },
    {
      "clause": "Walk forward",
      "labels": {
        "action": "walk_forward",
        "speed": "slow"
      }
    },
    {
      "clause": "Turn left",
      "labels": {
        "action": "turn_left"
      }
    },
    {
      "clause": "Kick, right",
      "labels": {
        "action": "kick_right"
      }
    }
  ]
}

Studio's bench runs a plan with one trick at most, and only as its last step: on the bench a trick is a network that takes over when the walking ends, and it does not hand the duck back. A row with a trick anywhere else still becomes a plan, and Studio says why it will not run it. Sound and Look steps stay in the plan, but the bench plays no sound and sends no head pose.

On a robot

A reader that drives a real Microduck sends robotd's own calls, the way Microduck Studio's source does when it runs a plan on a duck: robot.move for each walking step, robot.do with the skill's name for a trick, and robot.sound with its tag for a sound. On a robot a trick can sit anywhere in a row, and a row can hold more than one, because the robot takes the duck back to walking when a trick ends. A Look card needs a head pose, robot.head, and Studio's source does not send one to a robot yet. Every card names its call.

Wait for each trick to finish before sending the next step: a trick runs to its end once it starts, and stopping the duck does not cancel it. Send intents only, never motor positions. The robot's own software decides what is safe to carry out.

Nobody has run a card on a real Microduck yet, because nobody has a Microduck yet.

The code

Every card carries an AprilTag from the tag36h11 family. The tag's id is the card's number.

NFC

Optional. Any NFC Forum Type 2 sticker with room for two records will do, and an NTAG213 has room for every card in the deck. Write the records in this order:

Record 1, URI:
https://microduckstudio.com/cards/spec/#card-61

Record 2, MIME type application/vnd.duckcards+json:
{"format":"duck-cards/0","tag":61,"code":"kick_right"}

A phone that taps the card opens its row in the table below. Lock the sticker after writing it, if your app offers to, so a curious tap cannot change a card.

The deck file

duck-cards.json is plain JSON, and a deck of your own starts as a copy of it.

format
duck-cards/0. A reader refuses a format it does not know.
vocabulary and plan_format
The Studio vocabulary the cards' labels come from, and the plan a row becomes.
categories
Each has an id, a name, a line about it, and codes, its range of numbers.
cards
Each card has a tag number, a code word, a name, a category, a kind (action, modifier, control, event or yours), the plan labels it adds to a step, and whether it is printed in the starter deck. A card of your own can add a does sentence that says what it means.
example
The row shown on the Duck Cards page, and how it reads aloud.
license
CC BY 4.0, for the cards, their pictures and the lessons.

Every card

Studio's words and the gamepad's buttons in this table are read out of Microduck Studio's source before every publish, and the site will not publish while a card disagrees with them.

Every card, by code number. Vocabulary r001.
CodeCardStudio plan stepUnder itRuns in StudioPadOn a robot
0Walk forward
walk_forward action
action walk_forwardSpeed, LookYesL stickrobot.move
1Walk back
walk_backward action
action walk_backwardSpeed, LookYesL stickrobot.move
2Turn left
turn_left action
action turn_leftSpeed, LookYesR stickrobot.move
3Turn right
turn_right action
action turn_rightSpeed, LookYesR stickrobot.move
4Stop
stop action
action stopLookYesNonerobot.move at zero
20Slow
slow goes under
speed slowGoes under Walk forward, Walk back, Turn left or Turn rightYesNonescales robot.move
21Fast
fast goes under
speed fastGoes under Walk forward, Walk back, Turn left or Turn rightYesNonescales robot.move
22Normal
normal goes under, not in the starter deck
speed normalGoes under Walk forward, Walk back, Turn left or Turn rightYesNonescales robot.move
40Look left
look_left goes under
head look_leftGoes under Walk forward, Walk back, Turn left, Turn right or StopNoYrobot.head
41Look right
look_right goes under
head look_rightGoes under Walk forward, Walk back, Turn left, Turn right or StopNoYrobot.head
42Look up
look_up goes under
head look_upGoes under Walk forward, Walk back, Turn left, Turn right or StopNoYrobot.head
43Look down
look_down goes under
head look_downGoes under Walk forward, Walk back, Turn left, Turn right or StopNoYrobot.head
44Straight ahead
straight goes under
head straightGoes under Walk forward, Walk back, Turn left, Turn right or StopNoYrobot.head
60Kick, left
kick_left action
action kick_leftNothingYesLBrobot.do kick_left
61Kick, right
kick_right action
action kick_rightNothingYesRBrobot.do kick_right
62Sit or stand
sit_or_stand action
action sit_or_standNothingYes▼robot.do sit_toggle
63Roll
roll action
action rollNothingYesXrobot.do roulade
64Peck the ground
peck_ground action
action peck_groundNothingYesArobot.do ground_pick
80Hello
greet action
action make_sound, sound greetNothingNoNonerobot.sound greet
81Chirp
chirp action
action make_sound, sound chirpNothingNoNonerobot.sound chirp
82Coo
coo action
action make_sound, sound cooNothingNoNonerobot.sound coo
83Alarm
alarm action
action make_sound, sound alarmNothingNoNonerobot.sound alarm
84Wheee
wheee action
action make_sound, sound wheeeNothingNoLTrobot.sound wheee
85Inquire
inquire action, not in the starter deck
action make_sound, sound inquireNothingNoNonerobot.sound inquire
86Peck
peck action, not in the starter deck
action make_sound, sound peckNothingNoNonerobot.sound peck
100Start
start control
Not in Studio's planMarks where the row begins.NoNoneNone
101End
end control
Not in Studio's planMarks where the row ends.NoNoneNone
102Repeat
repeat control
Not in Studio's planOpens a bracket. The count is written on the card.NoNoneNone
103End repeat
end_repeat control
Not in Studio's planCloses the nearest open Repeat.NoNoneNone
120When it falls
when_falls when
Not in Studio's planStarts a second row that runs after a fall.NoNoneNone
200Your card
card_1 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone
201Your card
card_2 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone
202Your card
card_3 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone
203Your card
card_4 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone
204Your card
card_5 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone
205Your card
card_6 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone
206Your card
card_7 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone
207Your card
card_8 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone
208Your card
card_9 yours
Not in Studio's planYours to decide, and to write down in the deck file.NoNoneNone

Changing the format