Batch of LLM-assisted fixes/feature updates
This commit is contained in:
1 parent
7c6453160a
commit
05aaf394df
16 files changed
+5597
-912
No files matched your search
+24
-21
@@ -1,19 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
class RandomBot {
|
||||
constructor() {
|
||||
this.writePhrases = [
|
||||
" Suddenly, a mysterious figure appeared from the shadows.",
|
||||
" The ground began to shake violently beneath their feet.",
|
||||
" In the distance, an eerie sound echoed through the valley.",
|
||||
" A bright light flashed, blinding everyone momentarily.",
|
||||
" The ancient artifact started glowing with an otherworldly energy."
|
||||
];
|
||||
|
||||
this.votePhrases = [
|
||||
"I think we should proceed with caution.",
|
||||
"Let's take the bold approach!",
|
||||
"The safe path seems best right now.",
|
||||
"We should explore further before deciding.",
|
||||
"My instincts tell me to go left."
|
||||
'Suddenly, a mysterious figure appeared from the shadows.',
|
||||
'The ground began to shake violently beneath their feet.',
|
||||
'In the distance, an eerie sound echoed through the valley.',
|
||||
'A bright light flashed, blinding everyone momentarily.',
|
||||
'The ancient artifact started glowing with an otherworldly energy.',
|
||||
'A gust of wind carried whispers of a forgotten warning.',
|
||||
'Somewhere nearby, a door creaked open on its own.'
|
||||
];
|
||||
|
||||
this.banterPhrases = [
|
||||
@@ -24,27 +20,34 @@ class RandomBot {
|
||||
"Remember when we used to play simple games?",
|
||||
"What's the worst that could happen?",
|
||||
"I wonder if there are cookies in this game.",
|
||||
"Do bots dream of electric sheep?",
|
||||
'Do bots dream of electric sheep?',
|
||||
"Is this thing on?",
|
||||
"I'm having a great time, how about you?"
|
||||
];
|
||||
}
|
||||
|
||||
Write(story_so_far) {
|
||||
Write() {
|
||||
const randomIndex = Math.floor(Math.random() * this.writePhrases.length);
|
||||
return this.writePhrases[randomIndex];
|
||||
}
|
||||
|
||||
Vote(story_so_far, choices) {
|
||||
// Return a random choice number (0-indexed)
|
||||
const randomChoice = Math.floor(Math.random() * choices.length);
|
||||
return randomChoice;
|
||||
/**
|
||||
* Vote for one of the supplied choices. Choices are objects of the form
|
||||
* { index, entry_text } where `index` is the real entry index; return
|
||||
* that index (never the position in the filtered list).
|
||||
*/
|
||||
Vote(storySoFar, choices) {
|
||||
const list = Array.isArray(choices) ? choices : [];
|
||||
if (!list.length) return null;
|
||||
const pick = list[Math.floor(Math.random() * list.length)];
|
||||
if (pick && Number.isInteger(pick.index)) return pick.index;
|
||||
return Number.isInteger(pick) ? pick : 0;
|
||||
}
|
||||
|
||||
Banter(chat_so_far) {
|
||||
Banter() {
|
||||
const randomIndex = Math.floor(Math.random() * this.banterPhrases.length);
|
||||
return this.banterPhrases[randomIndex];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = RandomBot;
|
||||
module.exports = RandomBot;
|
||||
Reference in new issue
Block a user