first commit

This commit is contained in:
ysj7705 committed 2026-06-22 15:17:05 +09:00
commit 8bf1d1b928
47 files changed
+8648

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import type { GameAction } from './types'
export function pushAction(history: GameAction[], action: GameAction): GameAction[] {
return [...history, action]
}
export function popAction(history: GameAction[]): { action: GameAction | null; history: GameAction[] } {
if (history.length === 0) return { action: null, history }
const action = history[history.length - 1]!
return { action, history: history.slice(0, -1) }
}