mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Refactor: Use shared prompt from README config
This commit is contained in:
@@ -1,13 +1,9 @@
|
|||||||
export default {
|
export default {
|
||||||
functionName: 'findConvexHull',
|
functionName: 'findConvexHull',
|
||||||
prompt: `
|
prompt: `// Write an async JavaScript function 'findConvexHull' that finds the convex hull of a set of 2D points using the Monotone Chain algorithm.
|
||||||
// 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 'findConvexHull' that finds the convex hull of a set of 2D points using the Monotone Chain algorithm.
|
|
||||||
// - The function must accept an array of points, e.g., [{x: 0, y: 3}, {x: 1, y: 1}, ...].
|
// - The function must accept an array of points, e.g., [{x: 0, y: 3}, {x: 1, y: 1}, ...].
|
||||||
// - You MUST use a dynamic import() to load the 'lodash' library from a CDN for sorting and uniqueness operations.
|
// - You MUST use a dynamic import() to load the 'lodash' library from a CDN for sorting and uniqueness operations.
|
||||||
// - The function should return an array of points representing the convex hull, ordered clockwise.
|
// - The function should return an array of points representing the convex hull, ordered clockwise.`,
|
||||||
`,
|
|
||||||
runTest: async (findConvexHull) => {
|
runTest: async (findConvexHull) => {
|
||||||
const assert = {
|
const assert = {
|
||||||
deepStrictEqual: (a, e, m) => { if (JSON.stringify(a) !== JSON.stringify(e)) throw new Error(m) },
|
deepStrictEqual: (a, e, m) => { if (JSON.stringify(a) !== JSON.stringify(e)) throw new Error(m) },
|
||||||
|
|||||||
Reference in New Issue
Block a user