-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaleatory_engine.py
More file actions
41 lines (36 loc) · 1.5 KB
/
aleatory_engine.py
File metadata and controls
41 lines (36 loc) · 1.5 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
import random
class AleatoryEngine:
"""
A narrative constraint engine for Aleatory Journalism.
Generates non-linear interview prompts based on divinatory systems.
"""
def __init__(self):
self.major_arcana = [
"The Fool", "The Magician", "The High Priestess", "The Empress",
"The Emperor", "The Hierophant", "The Lovers", "The Chariot",
"Strength", "The Hermit", "Wheel of Fortune", "Justice",
"The Hanged Man", "Death", "Temperance", "The Devil",
"The Tower", "The Star", "The Moon", "The Sun",
"Judgement", "The World"
]
self.constraints = [
"Ask about a structure in their life that had to collapse.",
"Ask about a beginning they were unprepared for.",
"Ask about a victory that felt like a defeat.",
"Ask about a silent influence they have never acknowledged.",
"Ask about what they are currently waiting for.",
"Ask about the shadow side of their primary talent."
]
def draw(self):
"""Returns a tuple: (Card, Narrative Constraint)"""
card = random.choice(self.major_arcana)
constraint = random.choice(self.constraints)
return {
"card": card,
"constraint": constraint,
"methodology": "Aleatory Journalism by Finbarre Snarey"
}
def get_prompt():
"""Helper function for quick access."""
engine = AleatoryEngine()
return engine.draw()