How it works
- Describe one small computation, including an input and its expected result.
- Choose Python or JavaScript and specify edge cases or dependencies to avoid.
- Read the complete code, run it in an isolated environment and add tests for your own data.
Examples
Sample results for the inputs shown, so you can see the format and quality before you try it.
Task, inputs and expected result: Define unique_keep_order(values), returning distinct integers in first-seen order. Example [3,1,3,2,1] gives [3,1,2]. Include the empty-list case.
Language: Python 3
Constraints or edge cases: Do not mutate the input list.
Task, inputs and expected result: Define sumByCategory(rows), adding integer cents for each category. [{category:"books",cents:300},{category:"food",cents:125},{category:"books",cents:50}] yields {books:350,food:125}. Empty rows yields {}.
Language: JavaScript (Node.js)
Constraints or edge cases: Accept zero and negative cents; do not mutate rows.
Task, inputs and expected result: Define merge_intervals(intervals) for inclusive integer pairs. [[1,3],[2,5],[8,9]] gives [[1,5],[8,9]]. Merge overlap, but not merely adjacent pairs. Empty list gives [].
Language: Python 3
Constraints or edge cases: Accept unsorted intervals; leave the input unchanged.
Tips for better results
- Use a concrete expected value; “sort this well” cannot serve as a test.
- Start with pure functions so a draft cannot accidentally change files or call services.
- Review assertions as carefully as the implementation; a generated test can repeat the same mistake.
- For a larger Python-specific task, use the Python code generator and split the work into smaller functions.
FAQ
Has the generated code been executed?
The tool itself does not execute your generated result. Run it in an isolated environment and review it before use.
Which languages are supported?
This tool is limited to Python 3 and JavaScript for Node.js, using their standard libraries.
Can it build a production application?
It is intended for small computations. Authentication, storage, deployment and production security need separate design and review.
What does it cost to use this tool?
It is free after an email signup for Something Big. Daily usage limits apply; you can unsubscribe from the newsletter.
More free AI tools
Related prompts
Prefer to use ChatGPT or Claude directly? These free prompts do similar jobs.