We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to copy a stream such that the new stream can be interacted with as if it were an initial state? Code:
stream.write(>start {"formatid":"gen9randombattle"}); stream.write(>player p1 {"name":"Player 1"}); stream.write(>player p2 {"name":"Player 2"});
>start {"formatid":"gen9randombattle"}
>player p1 {"name":"Player 1"}
>player p2 {"name":"Player 2"}
function randomGame(stream, depth){ const streams = PS.getPlayerStreams(stream);
omniscient = streams.omniscient; spectator = streams.spectator; p1 = streams.p1; p2 = streams.p2; p3 = streams.p3; p4 = streams.p4; const logging = (depth == 0); const p1bot = new RandomBattlePlayer(p1, logging); const p2bot = new RandomBattlePlayer(p2, logging); void p1bot.start(); void p2bot.start(); void (async () => { for await (const chunk of omniscient) { var lastmessage = chunk.split('|'); if (lastmessage.slice(-2, -1) == 'win' && logging){ console.log(lastmessage.slice(-2, -1) + ' ' + lastmessage.slice(-1)); return lastmessage.slice(-1); } } })();
}
// Somehow copy stream 2 so that the battle states are the same, but different RNG seed.
winner = randomGame(stream, 0); winner2 = randomGame(stream2, 0);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is it possible to copy a stream such that the new stream can be interacted with as if it were an initial state? Code:
stream.write(
>start {"formatid":"gen9randombattle"}
);stream.write(
>player p1 {"name":"Player 1"}
);stream.write(
>player p2 {"name":"Player 2"}
);function randomGame(stream, depth){
const streams = PS.getPlayerStreams(stream);
}
// Somehow copy stream 2 so that the battle states are the same, but different RNG seed.
winner = randomGame(stream, 0);
winner2 = randomGame(stream2, 0);
The text was updated successfully, but these errors were encountered: