← Projects

Inventory logic

Build private inventory operations that count items, preserve input state, and reject invalid removals. The result is a small tested Luau module you can download and adapt later.

Runs here · Luau

Loading project… · Milestone 1 of 3

Summarize named inventory stock

Return the sum of numeric quantities in an item dictionary, including zero quantities. Dictionary order must not affect the result.

Acceptance criteria

  • Every named item contributes its quantity.
  • An empty dictionary returns zero.
Project milestones
  1. Available to preview
  2. Available to preview
  3. Available to preview
Prerequisites
Optional extension

Add a capacity policy and item-ID allowlist. Write rejection tests before changing the implementation.

Project notes and references

This module does not authenticate users, persist data, or implement a production economy.

A real server must own state, validate remote requests, handle concurrent actions, and apply a reviewed data schema.

Luau library ↗

Luau keyword highlighting · Ctrl/⌘ + Enter: Run · Esc: leave editor

Run experiment shows actual behavior. Check milestone uses the acceptance criteria and records trusted progress.

Output

Your output will appear here.

Visible examples

Two materials · { { wood = 3, stone = 2 } } → 5

Empty · { {} } → 0

Sharing is an explicit choice in your portfolio editor. Label exported work “Learning project”; existing publication rules apply.