Many names of equal length across kinds and files, so ties decide the order.
(dir: string)
| 59 | |
| 60 | /** Many names of equal length across kinds and files, so ties decide the order. */ |
| 61 | function writeTieProject(dir: string): void { |
| 62 | const files: Record<string, string> = {}; |
| 63 | for (let f = 0; f < 6; f++) { |
| 64 | const lines: string[] = []; |
| 65 | for (let i = 0; i < 12; i++) { |
| 66 | const n = (f * 7 + i * 5) % 12; |
| 67 | lines.push(`export function load${n}Item${f}(): void {}`); |
| 68 | lines.push(`export class Item${n}Loader${f} { loadItem${n}(): void {} }`); |
| 69 | lines.push(`export interface Item${n}Shape${f} { loadItem${n}Shape(): void; }`); |
| 70 | lines.push(`export const ITEM_${n}_LOADER_${f} = ${i};`); |
| 71 | } |
| 72 | lines.push('export function load_item_snake(): void {}'); |
| 73 | lines.push('export function loadXitemXsnake(): void {}'); |
| 74 | lines.push('export class LOADITEMLOUD {}'); |
| 75 | lines.push('export function größeLaden(): void {}'); |
| 76 | lines.push('export function GrößeLaden(): void {}'); |
| 77 | lines.push('export function ÉtatLoader(): void {}'); |
| 78 | lines.push('export function étatLoader(): void {}'); |
| 79 | lines.push('export function 𝑥ItemLoader(): void {}'); |
| 80 | files[`src/part${(f * 5) % 6}/items${f}.ts`] = lines.join('\n') + '\n'; |
| 81 | } |
| 82 | for (const [rel, text] of Object.entries(files)) { |
| 83 | fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true }); |
| 84 | fs.writeFileSync(path.join(dir, rel), text); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | const PATTERNS = [ |
| 89 | 'Item', 'item', 'ITEM', 'Loader', 'Load', 'load', 'Item1', 'Item1loader', 'Loaditem', 'Shape', 'Oader', 'O', |