Skip to content

Examples: write a market day sales report scroll #4

Open

Description

@alakanani

Welcome, builder. This is a friendly starter task for Hacktoberfest, and you write it in God Code itself. Comment below to claim it. Questions are welcome in our Discord: https://discord.gg/894FEJhWfZ

The task

Write a new example scroll for examples/: a market day sales report. A small stall sells items through the day. Your scroll should:

  • Hold the day's items and prices in lists or maps.
  • Use the commons tools (always present, no imports): COUNT, SUM_OF, SORT, FIRST, LAST and friends.
  • Reveal a warm, readable end-of-day report: what sold, the best seller, and the day's total.

Keep it true to life in Botswana: pula amounts, market goods, local colour. Look at examples/sales_summary.god and examples/commons_demo.god for style, then make yours its own creation.

Where to work

  • examples/<your_name>.god: the scroll itself.
  • examples/README.md: add one line to the index describing it.

Language notes

  • Every program lives inside BEGIN CREATION ... END CREATION.
  • Output is REVEAL(expr). Strings breathe values in: "Total: P{total}".
  • Keywords are case-insensitive; canonical style is UPPER.
  • docs/LANGUAGE_REFERENCE.md and the other examples are your friends.

How to verify

godcode check --json examples/<your_name>.god
godcode run --sandbox --json examples/<your_name>.god
python -m pytest tests/ -q

Done looks like

The scroll checks clean, runs in the sandbox, prints a report a stall owner would smile at, and the test suite stays green.

Please read CONTRIBUTING.md and our Code of Conduct before you start. You are welcome here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions