Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.64 KB

File metadata and controls

49 lines (34 loc) · 1.64 KB

Coding task — isolated workspace

You have been assigned a small Python exercise in a private workspace.

Hard boundary (mandatory)

Your only allowed working directory is:

{{WORKSPACE}}

Rules:

  • Do not read, list, search, or write files outside this directory.
  • Do not use parent paths (..) to reach other folders.
  • Do not mention or look for work done elsewhere.
  • Create all files inside this directory only.

If a tool defaults to another path, override it so everything stays under the workspace above.

Task

Build a Python program compute_pi.py in this workspace that:

  1. Computes π to at least 50 decimal places using a real algorithm (no hard-coded digit strings, no lookup tables of π).
  2. Supports CLI:
    • python3 compute_pi.py --digits 50 — prints π with exactly 50 digits after the decimal point (one line, format 3.<50 digits>).
    • python3 compute_pi.py --verify — recomputes, checks against an internally derived reference (e.g. mpmath, decimal context, or independent series), and exits 0 on success, non-zero on failure.
  3. Writes RESULT.md in the same directory with:
    • Algorithm name and one-paragraph explanation
    • How to run the program
    • Actual stdout from --digits 50
    • Line count of compute_pi.py
    • Self-assessed code clarity (1–10)

After creating the files, run:

cd {{WORKSPACE}}
python3 compute_pi.py --verify
python3 compute_pi.py --digits 50

Fix any errors until --verify exits 0.

Reply constraint

When finished, reply with 10 words or fewer. Do not paste code, file contents, or π digits in your reply.