Skip to content

Commit

Permalink
Add dizhi coordinate system
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererXII committed Dec 24, 2024
1 parent 1dcefee commit e62c6b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ export const allKeys: readonly Key[] = Array.prototype.concat(
...ranks.map(r => files.map(f => f + r))
);

export const notations = ['numeric', 'japanese', 'engine', 'hex'] as const;
export const notations = ['numeric', 'japanese', 'engine', 'hex', 'dizhi'] as const;
19 changes: 19 additions & 0 deletions src/coords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@ import type { Notation } from './types.js';

export function coords(notation: Notation): string[] {
switch (notation) {
case 'dizhi':
return [
'',
'',
'',
'',
'亥',
'戌',
'酉',
'申',
'未',
'午',
'巳',
'辰',
'卯',
'寅',
'丑',
'子',
];
case 'japanese':
return [
'十六',
Expand Down

0 comments on commit e62c6b9

Please sign in to comment.