-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinteractive.js
More file actions
executable file
·64 lines (53 loc) · 1.65 KB
/
Copy pathinteractive.js
File metadata and controls
executable file
·64 lines (53 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env node
/**
* Interactive Game Launcher
*
* Simple launcher for human vs AI games for debugging.
* Usage: node interactive.js [--seed 12345] [--max-steps 500]
*/
const { InteractiveGame } = require('./src/interactive-game');
async function main() {
const args = process.argv.slice(2);
// Parse arguments
let seed = Math.floor(Math.random() * 1000000);
let maxSteps = 1000; // Más pasos por defecto para partidas completas
for (let i = 0; i < args.length; i++) {
if (args[i] === '--seed' && args[i+1]) {
seed = parseInt(args[i+1]);
i++;
} else if (args[i] === '--max-steps' && args[i+1]) {
maxSteps = parseInt(args[i+1]);
i++;
} else if (args[i] === '--help' || args[i] === '-h') {
console.log(`
Interactive Game Launcher - Human vs AI Debugging
Usage: node interactive.js [options]
Options:
--seed NUM Use specific random seed (default: random)
--max-steps NUM Maximum game steps (default: 1000)
--help, -h Show this help
Features:
• Choose your side (Persia or Greece)
• Choose opponent AI type
• See cards with event names
• Turn-by-turn gameplay
• Perfect for debugging AI behavior
Examples:
node interactive.js
node interactive.js --seed 12345
node interactive.js --max-steps 1000
`);
process.exit(0);
}
}
try {
const game = new InteractiveGame({ seed, maxSteps });
await game.start();
} catch (error) {
console.error('\n❌ Error:', error.message);
process.exit(1);
}
}
if (require.main === module) {
main();
}