!/bin/bash# --- HELPER FUNCTION: DRAW STARS ---# This function takes a number (1-5) and prints a star bar# Example: Input 3 -> Output "★ ★ ★ "get_star_bar() {local count=$1local bar=""for ((i=1; i<=count; i++)); dobar+="★ "doneecho "$bar"}# --- THE ROLL ---# Generate numbers between 1 and 5 for each componentromance=$(( ( RANDOM % 5 ) + 1 ))wealth=$(( ( RANDOM % 5 ) + 1 ))health=$(( ( RANDOM % 5 ) + 1 ))# Calculate the total scoretotal_score=$(( romance + wealth + health ))# --- THE DISPLAY ---clearecho "🔮 GAZING INTO THE CRYSTAL BALL..."sleep 1echo ""echo " -------------------------------"echo -e " 💖 ROMANCE : \033[1;35m$(get_star_bar $romance)\033[0m" # Purplesleep 0.5echo -e " 💰 WEALTH : \033[1;33m$(get_star_bar $wealth)\033[0m" # Yellowsleep 0.5echo -e " 🌿 HEALTH : \033[1;32m$(get_star_bar $health)\033[0m" # Greenecho " -------------------------------"echo ""sleep 0.5# --- THE VERDICT ---echo -n " CALCULATING DESTINY..."sleep 1echo -e "\r \r" # Clear line# Logic based on total score (Min 3, Max 15)if [ $total_score -eq 15 ]; then# GREAT LUCK (Total 15)title="🌟 YOU HAVE GREAT LUCK! 🌟"color="\033[1;33m" # Bold Yellowart=$(cat << "EOF"[ PLACEHOLDER: GREAT LUCK ART ]\o/ \o/ \o/| | |/ \ / \ / \EOF)elif [ $total_score -ge 11 ] && [ $total_score -le 14 ]; then# GOOD LUCK (Total 11-14)title="✨ GOOD LUCK ✨"color="\033[1;36m" # Cyanart=$(cat << "EOF"[ PLACEHOLDER: GOOD LUCK ART ]\o/|/ \EOF)elif [ $total_score -ge 6 ] && [ $total_score -le 10 ]; then# MEDIUM LUCK (Total 6-10)title="🌥️ MEDIUM LUCK 🌥️"color="\033[1;34m" # Blueart=$(cat << "EOF"[ PLACEHOLDER: MEDIUM LUCK ART ]o/|\/ \EOF)elif [ $total_score -ge 1 ] && [ $total_score -le 5 ]; then# SMALL LUCK (Total 1-5)title="🍃 SMALL LUCK 🍃"color="\033[0;37m" # Greyart=$(cat << "EOF"[ PLACEHOLDER: SMALL LUCK ART ]_( )|EOF)elif [ $total_score -eq 0 ]; then# BAD LUCK (Total 0 - Very rare/Impossible with standard 1-5 dice)title="⛈️ BAD LUCK ⛈️"color="\033[1;31m" # Redart=$(cat << "EOF"[ PLACEHOLDER: BAD LUCK ART ]/!\(>_<)EOF)else# Fallbacktitle="🔮 MYSTERIOUS FATE 🔮"color="\033[0m"art=" [ ? ]"fi# --- PRINT RESULT ---echo -e "${color}"echo "$art"echo ""echo " $title"echo -e "\033[0m" # Resetecho ""
AI is very helpful in creating script like this but not so good in creating ASCII art, somehow the machine doesn't understand how to generate image from text using text again. It's illogical for AI to translate series of character as limb, and the same character as part of the head. So I asked the AI to make placeholder for the ASCII art and making the ASCII art by myself. The shell script from Gemini is using emoticon that doesn't work on this version of linux so you can delete and replaced it.
It would be cool if I know the kanji just like in Japanese' s fortune paper, but I don't, so I put pictures of my dog, Jembross. It would make more sense with a picture of cat (Manekineko), but no, I like my dog.

No comments:
Post a Comment