Header image for JS code

JS code

A JS code for chemical combinations.

Prompt

Write a powerful, highly optimized JavaScript function embedded with comprehensive data for all non-radioactive elements of the periodic table (including valency, oxidation states, electron configurations, and bonding limits . etc). The function must accept two inputs: A list of target elements (e.g., C, H, O) The maximum or exact number/limit of atoms per compound Based on fundamental chemical laws (such as valency balance, octet/duet rules, formal charges, and real-world stability . etc), programmatically calculate and return a complete list of all valid, chemically sound, and stable compound formulas possible within those constraints.

A system prompt was added to support web rendering

Drag to resize
Drag to resize
Drag to resize