MCPcopy Create free account
hub / github.com/Noumena-Network/code / pickInspirationWords

Function pickInspirationWords

src/buddy/observer.ts:221–229  ·  view source on GitHub ↗
(seed: number, count: number)

Source from the content-addressed store, hash-verified

219const recentReactions: string[] = []
220
221function pickInspirationWords(seed: number, count: number): string[] {
222 let state = seed >>> 0
223 const seen = new Set<number>()
224 while (seen.size < count) {
225 state = (Math.imul(state, 1664525) + 1013904223) >>> 0
226 seen.add(state % INSPIRATION_WORDS.length)
227 }
228 return [...seen].map(index => INSPIRATION_WORDS[index]!)
229}
230
231function pushRecentReaction(reaction: string): void {
232 recentReactions.push(reaction)

Callers 1

generateCompanionSoulFunction · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected