Refactor: Use shared prompt from README config

This commit is contained in:
2025-10-13 10:57:55 -07:00
parent 84f6eed585
commit d0917e8b3e

View File

@@ -1,14 +1,10 @@
export default { export default {
functionName: 'calculateDeterminant', functionName: 'calculateDeterminant',
prompt: ` prompt: `// Write an async JavaScript function 'calculateDeterminant' that calculates the determinant of a square matrix.
// Your goal is to write a production-ready and maintainable JavaScript function. Apply code-golfing practices without sacrificing readability by putting everything on one line. Do not include any comments in your code.
//
// Write an async JavaScript function 'calculateDeterminant' that calculates the determinant of a square matrix.
// - The function must accept an n x n matrix, represented as an array of arrays. // - The function must accept an n x n matrix, represented as an array of arrays.
// - You MUST use a dynamic import() to load the 'mathjs' library from a CDN. // - You MUST use a dynamic import() to load the 'mathjs' library from a CDN.
// - You MUST use the library's built-in 'det' function to perform the calculation. // - You MUST use the library's built-in 'det' function to perform the calculation.
// - The function should return the determinant value. // - The function should return the determinant value.`,
`,
runTest: async (calculateDeterminant) => { runTest: async (calculateDeterminant) => {
const assert = { const assert = {
strictEqual: (a, e, m) => { if (a !== e) throw new Error(m || `FAIL: ${a} !== ${e}`) }, strictEqual: (a, e, m) => { if (a !== e) throw new Error(m || `FAIL: ${a} !== ${e}`) },