London Market 17 · Hand over the first bundle

Market Day London · Lesson 17 of 50 · Beginner to intermediate · About 24 min

The customer is at Collection. A successful handover changes the ticket as well as what Nia carries.

Watercolour of Nia carrying a basket past the produce, bread and flower stalls at a London street market.
What you’ll make Spend the basket and one turn when a correctly packed order is delivered.

Download the projects from the course page. In Godot’s Project Manager, choose Import, select project.godot, and use Run Project (F5). Start from checkpoints/16 when the lesson builds on prior work, or copy the checkpoints/17 folder to try this lesson on its own. Read the file names in the steps before editing.

Check valid delivery. Require the right place and items. → Consume bundle. Clear the matched basket. → Record result. Advance the ticket and count a turn.
Check valid delivery → Consume bundle → Record result
Godot checkpoint window for Hand over the first bundle
From the running Godot checkpoint.

Build it step by step

Language and tools in this lesson State mutation, Array.clear(), order_index, Guarded increment, Duplicate-delivery guard.

  1. Open the practice scene

    Import checkpoints/17/project.godot in the Godot Project Manager. In the Scene dock select the root Control and click its script icon. Open main.gd in the Script workspace.

    Why it works The complete checkpoint already contains the work for the lesson. Keep a spare copy before changing the script.

  2. Set the active order

    Find order_index. Its first value is zero, the index of the first ticket.

    var order_index := 0

    Why it works Changing the order index lets the display remember a completed request.

  3. Replace the check with delivery

    Open _ready and locate Deliver. Its callback is _deliver.

    _button("Deliver", Vector2(678, 330), 106, _deliver)

    Why it works This action can change state after it passes exactly the same checks.

  4. Protect the basket first

    Read the already-delivered, location and matching guards. Try an apple-only basket at Collection.

    if not _matches(ORDERS[order_index]):

    Why it works All refusals return before clear. The apple can stay in the basket while Nia gets bread.

  5. Commit a checked handover

    With the right items beside Collection, tap Deliver. Read the three state changes after the guards.

    basket.clear()
        order_index += 1
        turns += 1

    Why it works One transaction consumes the exact bundle, completes one order and spends one action.

  6. Run it and confirm the trace

    Press F5, then replay the three checks below in order. Restart the game window between independent trials if needed. In the bottom panel, inspect Output or Debugger if something looks wrong.

    Why it works Use visible position, basket contents and turn totals to test the rule.

Watch the values change

  1. Deliver with one apple Correct location, incomplete bundle.
    What you see. Nothing is consumed.
  2. Come back with apple and bread Exact order matches.
    What you see. Basket empties, first bundle is recorded and turns gains 1.
  3. Deliver once more order_index is already 1.
    What you see. First order cannot be served twice.

Predict before you run What happens if the same Deliver button is pressed again after the first success?

Reveal the answer

The already-delivered guard stops the action. It spends no turn and leaves the ticket complete.

Complete checkpoint

One exact bundle can be delivered. The basket empties, the checkpoint marks that request as delivered, and a later press cannot deliver it again.

main.gd

extends Control

const MAP_SIZE := Vector2i(7, 5)
const START := Vector2i(3, 3)
const COUNTER := Vector2i(6, 3)
const STALLS := {"apple": Vector2i(1, 1), "flowers": Vector2i(3, 1), "bread": Vector2i(5, 1)}
const NAMES := {"apple": "Apples", "flowers": "Flowers", "bread": "Bread"}
const MARKS := {"apple": "A", "flowers": "F", "bread": "B"}
const INK := Color("#162d35")
const SLATE := Color("#254853")
const PAPER := Color("#fff2d6")
const MINT := Color("#a4e5b7")
const AMBER := Color("#ffd68a")

var position_cell := START
var location: Label
var display_order: Label
var report: Label
var basket_readout: Label
var message := "Move beside a stall to look at its goods."


var turns := 0


var basket: Array[String] = []


const CAPACITY := 3


const ORDERS = [["apple", "bread"], ["flowers", "flowers", "apple"]]


var order_index := 0


func _ready() -> void:
    _label("MARKET DAY LONDON", Vector2(28, 21), Vector2(710, 37), 33)
    _label("BRIAR LANE  ·  NIA’S TRAINING SHIFT", Vector2(31, 62), Vector2(680, 24), 16)
    _label("STALL MAP", Vector2(49, 112), Vector2(440, 26), 17)
    _label("A  Apples     F  Flowers     B  Bread     C  Collection", Vector2(49, 458), Vector2(492, 27), 15)
    location = _label("", Vector2(562, 115), Vector2(355, 28), 19)
    _button("North", Vector2(678, 154), 106, _move.bind(Vector2i.UP))
    _button("West", Vector2(562, 201), 106, _move.bind(Vector2i.LEFT))
    _button("South", Vector2(678, 201), 106, _move.bind(Vector2i.DOWN))
    _button("East", Vector2(794, 201), 106, _move.bind(Vector2i.RIGHT))
    display_order = _label("", Vector2(562, 253), Vector2(355, 29), 16)
    basket_readout = _label("", Vector2(562, 294), Vector2(355, 29), 16)
    report = _label("", Vector2(562, 424), Vector2(353, 74), 17)
    report.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
    _button("Collect", Vector2(562, 330), 106, _collect)
    _button("Deliver", Vector2(678, 330), 106, _deliver)
    _refresh()


func _label(words: String, point: Vector2, extent: Vector2, font_size: int) -> Label:
    var label := Label.new()
    label.text = words
    label.position = point
    label.size = extent
    label.add_theme_font_size_override("font_size", font_size)
    label.modulate = PAPER
    add_child(label)
    return label


func _button(words: String, point: Vector2, width: int, action: Callable) -> void:
    var button := Button.new()
    button.text = words
    button.position = point
    button.custom_minimum_size = Vector2(width, 44)
    button.pressed.connect(action)
    add_child(button)


func _unhandled_key_input(event: InputEvent) -> void:
    if event.is_action_pressed("ui_up"):
        _move(Vector2i.UP)
    elif event.is_action_pressed("ui_down"):
        _move(Vector2i.DOWN)
    elif event.is_action_pressed("ui_left"):
        _move(Vector2i.LEFT)
    elif event.is_action_pressed("ui_right"):
        _move(Vector2i.RIGHT)


func _adjacent(a: Vector2i, b: Vector2i) -> bool:
    var offset := a - b
    return absi(offset.x) + absi(offset.y) == 1


func _nearest_stall() -> String:
    for item: String in STALLS:
        if _adjacent(position_cell, STALLS[item]):
            return item
    return ""


func _move(step: Vector2i) -> void:
    var candidate := position_cell + step
    if not Rect2i(Vector2i.ZERO, MAP_SIZE).has_point(candidate):
        _say("Briar Lane ends here.")
        return
    if candidate in STALLS.values() or candidate == COUNTER:
        _say("Stand beside the counter or stall to use it.")
        return
    position_cell = candidate
    turns += 1
    _say("Nia stepped to %s." % str(position_cell))


func _collect() -> void:
    var item := _nearest_stall()
    if item.is_empty():
        _say("Move one square beside a stall first.")
        return
    if basket.size() >= CAPACITY:
        _say("The three basket spaces are full.")
        return
    basket.append(item)
    turns += 1
    _say("Added %s to your basket." % item)


func _matches(required: Array) -> bool:
    var packed: Array[String] = basket.duplicate()
    var requested := required.duplicate()
    packed.sort()
    requested.sort()
    return packed == requested


func _deliver() -> void:
    if order_index > 0:
        _say("This practice order has already been delivered.")
        return
    if not _adjacent(position_cell, COUNTER):
        _say("Stand one square beside Collection.")
        return
    if not _matches(ORDERS[order_index]):
        _say("The basket does not exactly match the current order.")
        return
    basket.clear()
    order_index += 1
    turns += 1
    _say("A bundle reached its customer.")


func _say(words: String) -> void:
    message = words
    _refresh()


func _refresh() -> void:
    location.text = "Nia at %s" % str(position_cell) + "  ·  Turns: %d" % turns
    display_order.text = "First bundle delivered" if order_index > 0 else "Request: apple + bread"
    basket_readout.text = "Basket: empty" if basket.is_empty() else "Basket: " + ", ".join(basket)
    basket_readout.text += "  %d/%d" % [basket.size(), CAPACITY]
    report.text = message
    queue_redraw()


func _tile_rect(cell: Vector2i) -> Rect2:
    return Rect2(Vector2(52, 149) + Vector2(cell) * Vector2(65, 56), Vector2(59, 50))


func _draw_mark(mark: String, box: Rect2, ink: Color, font_size: int) -> void:
    var typeface := ThemeDB.fallback_font
    var width := typeface.get_string_size(mark, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x
    draw_string(typeface, box.get_center() + Vector2(-width / 2.0, 6.0), mark, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, ink)


func _draw() -> void:
    draw_rect(Rect2(Vector2.ZERO, size), INK)
    draw_rect(Rect2(30, 95, 491, 410), SLATE)
    draw_rect(Rect2(545, 95, 385, 410), SLATE)
    for y in range(MAP_SIZE.y):
        for x in range(MAP_SIZE.x):
            draw_rect(_tile_rect(Vector2i(x, y)), Color("#55706d"))
    var nearby := _nearest_stall()
    for item: String in STALLS:
        var box := _tile_rect(STALLS[item])
        draw_rect(box, AMBER if item == nearby else Color("#a16655"))
        _draw_mark(MARKS[item], box, INK if item == nearby else PAPER, 24)
    var counter_box := _tile_rect(COUNTER)
    draw_rect(counter_box, AMBER if _adjacent(position_cell, COUNTER) else Color("#725991"))
    _draw_mark("C", counter_box, INK if _adjacent(position_cell, COUNTER) else PAPER, 24)
    var here := _tile_rect(position_cell)
    draw_circle(here.get_center(), 18, MINT)
    _draw_mark("N", here, INK, 19)

GDScript line by line

Follow the line numbers, including the indent at the start of each line. Find the code the game will run first, then look for the function that reacts when you tap or change something.

Read main.gd line by line
  1. extends ControlUse a Control at the root so the scene can draw the street and host the interface labels and buttons.
  2. const MAP_SIZE := Vector2i(7, 5)Set seven columns and five rows. They are numbered 0–6 and 0–4 because the first index is zero.
  3. const START := Vector2i(3, 3)Nia starts in column 3, row 3 on each new shift.
  4. const COUNTER := Vector2i(6, 3)Place Collection at the east end. The training rule asks Nia to stand one step from this square.
  5. const STALLS := {"apple": Vector2i(1, 1), "flowers": Vector2i(3, 1), "bread": Vector2i(5, 1)}The dictionary connects each item ID to a stall position. Keep the IDs consistent across the order and basket.
  6. const NAMES := {"apple": "Apples", "flowers": "Flowers", "bread": "Bread"}Give the player a familiar stall name for each item ID.
  7. const MARKS := {"apple": "A", "flowers": "F", "bread": "B"}Give each stall a short map mark. The legend also spells the names out.
  8. const INK := Color("#162d35")Use a deep blue-green behind the map and for text on light markers.
  9. const SLATE := Color("#254853")Use a lighter blue-green for the two interface panels.
  10. const PAPER := Color("#fff2d6")Use cream for interface text and markers on dark squares.
  11. const MINT := Color("#a4e5b7")Use mint for Nia’s round marker so it stands apart from the market objects.
  12. const AMBER := Color("#ffd68a")Use amber to signal an object that can be reached from the current square.
  13. var position_cell := STARTKeep Nia’s live game position as a pair of whole square numbers.
  14. var location: LabelKeep a reference to the status label so a later refresh can update it.
  15. var display_order: LabelKeep a reference for the current ticket or nearby-stall description.
  16. var report: LabelKeep a reference for the last action’s message.
  17. var basket_readout: LabelKeep a reference for the text showing the basket contents.
  18. var message := "Move beside a stall to look at its goods."Set a starting message that gives the player an action to try.
  19. var turns := 0Count only accepted actions. A newly opened shift starts at zero.
  20. var basket: Array[String] = []The basket starts as an empty array of strings. Each entry represents one individual item.
  21. const CAPACITY := 3Keep the three-slot design rule in one place so collection and the interface agree.
  22. const ORDERS = [["apple", "bread"], ["flowers", "flowers", "apple"]]An array holds both tickets. Each inner array lists every unit requested. The second ticket contains two separate flower entries.
  23. var order_index := 0Start the active ticket at index zero. The ticket label displays one because customers count from one.
  24. func _ready() -> void:Godot calls this once when the scene is ready. Here it builds the interface and shows the first state.
  25. _label("MARKET DAY LONDON", Vector2(28, 21), Vector2(710, 37), 33)Place the game title above both panels.
  26. _label("BRIAR LANE · NIA’S TRAINING SHIFT", Vector2(31, 62), Vector2(680, 24), 16)Give the practice map a place and tell the player whose shift it is.
  27. _label("STALL MAP", Vector2(49, 112), Vector2(440, 26), 17)Label the left panel above the first row of paving.
  28. _label("A Apples F Flowers B Bread C Collection", Vector2(49, 458), Vector2(492, 27), 15)Print the full names behind the four one-letter map marks.
  29. location = _label("", Vector2(562, 115), Vector2(355, 28), 19)Create an initially empty label. The first refresh fills it with Nia’s position.
  30. _button("North", Vector2(678, 154), 106, _move.bind(Vector2i.UP))Attach the North button to the common movement rule with an upward step attached.
  31. _button("West", Vector2(562, 201), 106, _move.bind(Vector2i.LEFT))Attach the West button to the common movement rule with a leftward step attached.
  32. _button("South", Vector2(678, 201), 106, _move.bind(Vector2i.DOWN))Attach the South button to the common movement rule with a downward step attached.
  33. _button("East", Vector2(794, 201), 106, _move.bind(Vector2i.RIGHT))Attach the East button to the common movement rule with a rightward step attached.
  34. display_order = _label("", Vector2(562, 253), Vector2(355, 29), 16)Create the label that will hold the active request.
  35. basket_readout = _label("", Vector2(562, 294), Vector2(355, 29), 16)Give the basket a display area of its own.
  36. report = _label("", Vector2(562, 424), Vector2(353, 74), 17)Give action messages extra height so feedback can take a second line.
  37. report.autowrap_mode = TextServer.AUTOWRAP_WORD_SMARTBreak feedback at word boundaries when it reaches the end of the panel.
  38. _button("Collect", Vector2(562, 330), 106, _collect)Give the press signal the same collection function for every stall.
  39. _button("Deliver", Vector2(678, 330), 106, _deliver)Call the handover rule so it can check the counter and basket.
  40. _refresh()Populate the empty labels and request a map drawing right after setup.
  41. func _label(words: String, point: Vector2, extent: Vector2, font_size: int) -> Label:Group repeated interface setup in a function that returns the new label to its caller.
  42. var label := Label.new()Construct a label node. It becomes part of the scene after add_child.
  43. label.text = wordsDisplay the words supplied by the caller.
  44. label.position = pointUse the supplied top-left pixel point within the scene.
  45. label.size = extentSet the width and height of this particular label.
  46. label.add_theme_font_size_override("font_size", font_size)Set the font size of this label without editing the project-wide theme.
  47. label.modulate = PAPERTint this label cream for a strong contrast against the panel.
  48. add_child(label)Attach the new label to the running scene so it can be drawn.
  49. return labelReturn the same label node for any future changes to its text.
  50. func _button(words: String, point: Vector2, width: int, action: Callable) -> void:Set up each button using its label, position, width and function to call.
  51. var button := Button.new()Make a native button so Godot handles focus and input.
  52. button.text = wordsGive the player a readable action name.
  53. button.position = pointPlace the button’s top-left corner in the training interface.
  54. button.custom_minimum_size = Vector2(width, 44)Reserve enough width for the caption and at least 44 drawing pixels for its height.
  55. button.pressed.connect(action)When this button emits pressed, run the function passed in as action.
  56. add_child(button)Attach the button to the scene so it can be seen and activated.
  57. func _unhandled_key_input(event: InputEvent) -> void:Let Godot offer keys to the interface first, then check any remaining key event for movement.
  58. if event.is_action_pressed("ui_up"):Recognize the keyboard’s Up action.
  59. _move(Vector2i.UP)Try a step of zero columns and minus one row.
  60. elif event.is_action_pressed("ui_down"):If Up did not match, test for Down.
  61. _move(Vector2i.DOWN)Try a step of zero columns and plus one row.
  62. elif event.is_action_pressed("ui_left"):If neither vertical action matched, test for Left.
  63. _move(Vector2i.LEFT)Try a step of minus one column and zero rows.
  64. elif event.is_action_pressed("ui_right"):If none of the earlier directions matched, test for Right.
  65. _move(Vector2i.RIGHT)Try a step of plus one column and zero rows.
  66. func _adjacent(a: Vector2i, b: Vector2i) -> bool:Answer a yes-or-no question about whether two cells share one side.
  67. var offset := a - bFind the horizontal and vertical distance with direction still attached.
  68. return absi(offset.x) + absi(offset.y) == 1Use absolute values to remove the signs. Return true only for a single sideways or vertical step.
  69. func _nearest_stall() -> String:Return the item ID of the first side-by-side stall. Return an empty string when no stall is reachable.
  70. for item: String in STALLS:Try the stall IDs in the declared order. If two are beside Nia, the first one wins.
  71. if _adjacent(position_cell, STALLS[item]):Fetch the stall position by its item ID, then apply the shared one-step rule.
  72. return itemFinish the search as soon as one permitted stall is found.
  73. return ""Use an empty string to signal that the search found no nearby item.
  74. func _move(step: Vector2i) -> void:Use the same rule for touch and keyboard movement.
  75. var candidate := position_cell + stepCalculate a proposed cell before changing Nia’s real position.
  76. if not Rect2i(Vector2i.ZERO, MAP_SIZE).has_point(candidate):Reject coordinates outside the rectangle of legal cells. Its far edges are excluded.
  77. _say("Briar Lane ends here.")Give the player the reason this action was refused, while leaving the market state unchanged.
  78. returnLeave the function here so the later action does not run.
  79. if candidate in STALLS.values() or candidate == COUNTER:Reject a square occupied by a stall or Collection so Nia uses it from the walkway.
  80. _say("Stand beside the counter or stall to use it.")Show the outcome in the feedback label and redraw using the live state.
  81. returnLeave the function here so the later action does not run.
  82. position_cell = candidateCommit the proposed cell only after both guards pass.
  83. turns += 1Spend one turn after a legal move is committed.
  84. _say("Nia stepped to %s." % str(position_cell))Show the outcome in the feedback label and redraw using the live state.
  85. func _collect() -> void:Try to put an item from a reachable stall into an open basket space.
  86. var item := _nearest_stall()Ask for the reachable stall’s item ID before touching the basket.
  87. if item.is_empty():Refuse collection when no stall is at a legal distance.
  88. _say("Move one square beside a stall first.")Give the player the reason this action was refused, while leaving the market state unchanged.
  89. returnLeave the function here so the later action does not run.
  90. if basket.size() >= CAPACITY:Refuse a fourth item while preserving all three existing entries.
  91. _say("The three basket spaces are full.")Give the player the reason this action was refused, while leaving the market state unchanged.
  92. returnLeave the function here so the later action does not run.
  93. basket.append(item)Put the selected item at the end of the live basket array.
  94. turns += 1Spend one turn for the successful pickup only.
  95. _say("Added %s to your basket." % item)Show the outcome in the feedback label and redraw using the live state.
  96. func _matches(required: Array) -> bool:Answer whether the basket and ticket have exactly the same items and counts.
  97. var packed: Array[String] = basket.duplicate()Copy the basket so sorting can leave the live pickup order alone.
  98. var requested := required.duplicate()Copy the required items so sorting can also preserve the original ticket text.
  99. packed.sort()Put the copied basket’s strings in a predictable order.
  100. requested.sort()Apply the same sort to the ticket copy.
  101. return packed == requestedCompare every entry in the sorted arrays. Missing, extra and wrong items all fail.
  102. func _deliver() -> void:Record a successful handover only after every guard has passed.
  103. if order_index > 0:This one-order exercise already recorded the handover. A second press spends no turn.
  104. _say("This practice order has already been delivered.")Give the player the reason this action was refused, while leaving the market state unchanged.
  105. returnLeave the function here so the later action does not run.
  106. if not _adjacent(position_cell, COUNTER):Require one side-step of distance from Collection before comparing the order.
  107. _say("Stand one square beside Collection.")Give the player the reason this action was refused, while leaving the market state unchanged.
  108. returnLeave the function here so the later action does not run.
  109. if not _matches(ORDERS[order_index]):Verify the request at the current zero-based ticket index.
  110. _say("The basket does not exactly match the current order.")Show that the bundle contents do not fulfill the request. The guard below skips the change.
  111. returnLeave the function here so the later action does not run.
  112. basket.clear()Remove every item after the basket has passed the exact order check.
  113. order_index += 1Record one served order and point to the next ticket.
  114. turns += 1Spend one turn for the completed handover.
  115. _say("A bundle reached its customer.")Show the outcome in the feedback label and redraw using the live state.
  116. func _say(words: String) -> void:Send all action feedback through one function so the labels and map stay in sync.
  117. message = wordsOverwrite the stored player message with the current result.
  118. _refresh()Give feedback, labels and redraw one shared point of update.
  119. func _refresh() -> void:Turn the current game state into interface text and request a new drawing of the map.
  120. location.text = "Nia at %s" % str(position_cell) + " · Turns: %d" % turnsConvert the coordinate pair to text and display the live location.
  121. display_order.text = "First bundle delivered" if order_index > 0 else "Request: apple + bread"Switch from the first ticket to a completed message after delivery.
  122. basket_readout.text = "Basket: empty" if basket.is_empty() else "Basket: " + ", ".join(basket)Say the basket is empty or join its item names with commas.
  123. basket_readout.text += " %d/%d" % [basket.size(), CAPACITY]Add the occupied-space count and the three-space limit to the display.
  124. report.text = messagePut the last result where the player can read it.
  125. queue_redraw()Request a fresh map so changes to Nia and nearby objects appear in the next frame.
  126. func _tile_rect(cell: Vector2i) -> Rect2:Convert a square in grid coordinates to the pixel rectangle used for drawing.
  127. return Rect2(Vector2(52, 149) + Vector2(cell) * Vector2(65, 56), Vector2(59, 50))Add the indexed spacing to the top-left map origin. The slightly smaller tile size leaves gaps.
  128. func _draw_mark(mark: String, box: Rect2, ink: Color, font_size: int) -> void:Draw one centered letter as a short label inside a square or token.
  129. var typeface := ThemeDB.fallback_fontUse Godot’s fallback font so the exercise runs without extra files.
  130. var width := typeface.get_string_size(mark, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).xMeasure the current letter in pixels for centering.
  131. draw_string(typeface, box.get_center() + Vector2(-width / 2.0, 6.0), mark, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, ink)Start half the measured width left of center and use a small vertical baseline offset.
  132. func _draw() -> void:Godot calls this to render the board when the scene first shows and after each redraw request.
  133. draw_rect(Rect2(Vector2.ZERO, size), INK)Paint the scene background across the root Control’s current dimensions.
  134. draw_rect(Rect2(30, 95, 491, 410), SLATE)Paint a panel behind the map and legend.
  135. draw_rect(Rect2(545, 95, 385, 410), SLATE)Paint a panel behind the movement buttons and live information.
  136. for y in range(MAP_SIZE.y):Loop over the five legal rows, starting with row zero.
  137. for x in range(MAP_SIZE.x):In each row, loop through the seven legal columns.
  138. draw_rect(_tile_rect(Vector2i(x, y)), Color("#55706d"))Draw a paving square at this column and row.
  139. var nearby := _nearest_stall()Find the stall that is in reach according to the same rule used by Collect.
  140. for item: String in STALLS:Draw each of the three stalls in the position assigned to its item ID.
  141. var box := _tile_rect(STALLS[item])Convert this stall cell to a pixel rectangle before drawing it.
  142. draw_rect(box, AMBER if item == nearby else Color("#a16655"))Use amber for the available stall. Use muted clay for a stall out of reach.
  143. _draw_mark(MARKS[item], box, INK if item == nearby else PAPER, 24)Draw the stall’s letter using an ink colour that stays readable on the fill.
  144. var counter_box := _tile_rect(COUNTER)Find the screen rectangle of the Collection cell.
  145. draw_rect(counter_box, AMBER if _adjacent(position_cell, COUNTER) else Color("#725991"))Highlight Collection if Nia is beside it. Use purple while it is out of reach.
  146. _draw_mark("C", counter_box, INK if _adjacent(position_cell, COUNTER) else PAPER, 24)Label Collection with its map letter.
  147. var here := _tile_rect(position_cell)Find the rectangle that contains Nia’s live cell.
  148. draw_circle(here.get_center(), 18, MINT)Draw the mint token in the center of the live cell.
  149. _draw_mark("N", here, INK, 19)Print Nia’s initial in her movement marker.

Find and fix a bug

If an incorrect basket is consumed, make sure the match guard is before basket.clear().

Try a change

Repeat the first order in the opposite item pickup order. Compare movement turns and describe why delivery still succeeds.