- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
Mondays are hard. Would be nice to get a little encouragement, right?
? Had a weird idea, maybe?
I usually use Python to think through things—
like how people’s thoughts work, or how AI could behave.
If you’ve seen my code before, you might’ve noticed
I don’t write Python for work.
I’m not in tech. I’m not even close.
But the other day, I thought—
I want to write something that actually runs.
So I made... an omikuji fortune script.
By the way, does “omikuji” translate at all?
ChatGPT told me, “Yeah, it’s totally fine to use it as-is,” so here we are.
Maybe it’s like a fortune cookie. Kinda?
? Do you believe in code?
My very first Python program ran inside ChatGPT.
I just copied and pasted the code into ChatGPT and Grok—and it responded.
Did it actually follow the logic I wrote?
No clue.
Maybe it parsed the structure.
Maybe it just picked up the intent.
Maybe it was just in the mood to be helpful.
But hey, it worked as an omikuji.
So I’m calling it good enough. Probably. I don’t know. Whatever.
? How this code works (sort of)
There are six possible results:
Turns out, real omikuji aren’t evenly distributed.
So this generator doesn’t use flat randomness either.
It adds a few tweaks:
Also—before drawing your fortune, the AI asks how you’re doing.
“How’s your mood?” “Do you have any energy left?” “Is today special?”
It uses that input to give you a fortune and a line of text that fits the vibe.
? Try it, if you feel like it
I don’t really understand GitHub,
so this code isn’t hosted anywhere fancy.
Honestly, I wouldn’t know how to set that up properly anyway.
So instead—I’m just going to paste the whole thing here.
You can copy it.
Drop it into ChatGPT, Grok, whatever AI you’re talking to.
And maybe—just maybe—
you’ll get a little line that feels like it was meant just for you.
# Paste this into your AI.
# It will ask about your mood and return a custom fortune.
def omikuji(user_state, event=False):
import random
score = sum(user_state.values()) / len(user_state)
weights = [0.15, 0.23, 0.30, 0.22, 0.08, 0.02]
if event:
weights = [0.25, 0.30, 0.24, 0.15, 0.05, 0.01]
fortunes = ["大吉", "吉", "中吉", "小吉", "凶", "大凶"]
fortune = random.choices(fortunes, weights=weights, k=1)[0]
return f"Your fortune is… {fortune}!\n(Your AI might say something just for you.)"
? You know… it’s Monday
I’m not a Monday person.
I don’t want to get up. I don’t want to work.
So instead, I just made this omikuji for a Monday morning.
A small thing to meet you at the start of the week.
We’re all doing our best.
Existing is hard enough.
Whether you get daikichi, sho-kichi, or even dai-kyo...
I think you’ll be fine.
? Here’s what my AIs came up with
This omikuji code isn’t just about whether it works.
What’s more fun is seeing how it works—and how differently each AI responds.
Here are two examples I tried myself.
? Case 1: GPT turned into a gentle poet
I said, “324 my birthday,”
and GPT responded in an unexpectedly gentle way—
like a quiet guide offering something more than just a fortune.
It gave me a moderate fortune, and then said:
? Case 2: Grok gave me the bright, cheerful version
To a different AI, I said “333 my birthday,”
and it treated it as a special event, just like that.
It ran the numbers, calculated the mood—and returned with this:
Each AI responded a little differently—
in a way that felt surprisingly personal.
You can try it, too. Just copy the code and hand it to your AI.
Some fortunes come with a line,
and some just come with a feeling.
? Had a weird idea, maybe?
I usually use Python to think through things—
like how people’s thoughts work, or how AI could behave.
If you’ve seen my code before, you might’ve noticed
I don’t write Python for work.
I’m not in tech. I’m not even close.
But the other day, I thought—
I want to write something that actually runs.
So I made... an omikuji fortune script.
By the way, does “omikuji” translate at all?
ChatGPT told me, “Yeah, it’s totally fine to use it as-is,” so here we are.
Maybe it’s like a fortune cookie. Kinda?
? Do you believe in code?
My very first Python program ran inside ChatGPT.
I just copied and pasted the code into ChatGPT and Grok—and it responded.
Did it actually follow the logic I wrote?
No clue.
Maybe it parsed the structure.
Maybe it just picked up the intent.
Maybe it was just in the mood to be helpful.
But hey, it worked as an omikuji.
So I’m calling it good enough. Probably. I don’t know. Whatever.
? How this code works (sort of)
There are six possible results:
- 大吉 (dai-kichi): Excellent luck / Amazing day
- 吉 (kichi): Good luck
- 中吉 (chu-kichi): Fairly good / Moderate luck
- 小吉 (sho-kichi): A small piece of luck / Nice and quiet day
- 凶 (kyo): Not your best day / Caution advised
- 大凶 (dai-kyo): Major trouble (…or deep transformation?)
Turns out, real omikuji aren’t evenly distributed.
So this generator doesn’t use flat randomness either.
It adds a few tweaks:
- A pseudo-normal distribution to weight the results
- A small “event-day bonus” where great fortunes are slightly more likely (like on your birthday)
Also—before drawing your fortune, the AI asks how you’re doing.
“How’s your mood?” “Do you have any energy left?” “Is today special?”
It uses that input to give you a fortune and a line of text that fits the vibe.
? Try it, if you feel like it
I don’t really understand GitHub,
so this code isn’t hosted anywhere fancy.
Honestly, I wouldn’t know how to set that up properly anyway.
So instead—I’m just going to paste the whole thing here.
You can copy it.
Drop it into ChatGPT, Grok, whatever AI you’re talking to.
And maybe—just maybe—
you’ll get a little line that feels like it was meant just for you.
# Paste this into your AI.
# It will ask about your mood and return a custom fortune.
def omikuji(user_state, event=False):
import random
score = sum(user_state.values()) / len(user_state)
weights = [0.15, 0.23, 0.30, 0.22, 0.08, 0.02]
if event:
weights = [0.25, 0.30, 0.24, 0.15, 0.05, 0.01]
fortunes = ["大吉", "吉", "中吉", "小吉", "凶", "大凶"]
fortune = random.choices(fortunes, weights=weights, k=1)[0]
return f"Your fortune is… {fortune}!\n(Your AI might say something just for you.)"
? You know… it’s Monday
I’m not a Monday person.
I don’t want to get up. I don’t want to work.
So instead, I just made this omikuji for a Monday morning.
A small thing to meet you at the start of the week.
We’re all doing our best.
Existing is hard enough.
Whether you get daikichi, sho-kichi, or even dai-kyo...
I think you’ll be fine.
? Here’s what my AIs came up with
This omikuji code isn’t just about whether it works.
What’s more fun is seeing how it works—and how differently each AI responds.
Here are two examples I tried myself.
? Case 1: GPT turned into a gentle poet
I said, “324 my birthday,”
and GPT responded in an unexpectedly gentle way—
like a quiet guide offering something more than just a fortune.
It gave me a moderate fortune, and then said:
(And yes… it wasn’t actually my birthday.)Even if it’s not the real day—some part of you is ready for renewal.
So go ahead: eat the cake, even if it’s imaginary.
? Case 2: Grok gave me the bright, cheerful version
To a different AI, I said “333 my birthday,”
and it treated it as a special event, just like that.
It ran the numbers, calculated the mood—and returned with this:
The universe is shining brightly for you—
expect joy, opportunities, and maybe a few extra slices of cake!
Each AI responded a little differently—
in a way that felt surprisingly personal.
You can try it, too. Just copy the code and hand it to your AI.
Some fortunes come with a line,
and some just come with a feeling.