feat:绘制图形

This commit is contained in:
2025-09-12 16:56:00 +08:00
parent 3b4b2dcd64
commit 6acc5d676c
27 changed files with 76464 additions and 112 deletions
+26
View File
@@ -0,0 +1,26 @@
import fs from 'fs';
// 读取grade3.json文件
const data = JSON.parse(
fs.readFileSync('miniprogram/demo/grade3.json', 'utf8'),
);
// 提取所有汉字
const hanzi = Object.keys(data);
// 生成TypeScript代码
const output = `/**
* 从 grade3.json 中提取的所有汉字
* 总共 ${hanzi.length} 个汉字
*/
export const SUPPORT_HANZI: string[] = [
${hanzi.map((h) => `'${h}'`).join(', ')}
];
`;
// 写入文件
fs.writeFileSync('miniprogram/constants/copyWords.ts', output);
console.log(`Generated copyWords.ts with ${hanzi.length} hanzi`);
console.log('First 10:', hanzi.slice(0, 10));
console.log('Last 10:', hanzi.slice(-10));