-- 생각 깊이 증가 + 에너지 소모
deepenThought :: StateT MindState IO ()
deepenThought = do
  modify $ s -> s { depth = depth s + 1, energy = max 0 (energy s - 5) }
  liftIO $ putStrLn $ "[깊이 " ++ show (depth (undefined) + 1) ++ "] 생각을 깊게 합니다..."

-- 랜덤 아이디어 생성 (집중력에 비례)
generateIdea :: StateT MindState IO ()
generateIdea = do
  s <- get
  let prob = fromIntegral (focus s) / 100
  rand <- liftIO $ randomRIO (0.0 :: Double, 1.0)
  when (rand < prob) $ do
    let newScore = 0.5 + rand * 0.5  -- 0.5~1.0 점수
    let ideaName = "아이디어 #" ++ show (timestamp s)
    modify $ ms -> ms { 
        ideas = Idea ideaName newScore (timestamp ms) : ideas ms,
        timestamp = timestamp ms + 1 
      }
    liftIO $ putStrLn $ "✨ " ++ ideaName ++ " (점수: " ++ show newScore ++ ") 생성!"

-- 집중력/에너지 변동 (랜덤 산만함)
wanderMind :: StateT MindState IO ()
wanderMind = do
  focusDelta <- liftIO $ randomRIO (-15, 10)
  energyDelta <- liftIO $ randomRIO (-8, 3)
  modify $ s -> s { 
      focus = max 0 $ min 100 $ focus s + focusDelta,
      energy = max 0 $ min 100 $ energy s + energyDelta 
    }
  liftIO $ putStrLn $ "집중: " ++ show (focus (undefined)) ++ ", 에너지: " ++ show (energy (undefined))

-- 최고 아이디어 선택
selectBestIdea :: StateT MindState IO ()
selectBestIdea = do
  s <- get
  let best = head $ sortBy (flip betterIdea) (ideas s)  -- 내림차순
  liftIO $ putStrLn $ "💡 최고 아이디어: " ++ name best ++ " (점수: " ++ show (score best) ++ ")"

0

If you have a fediverse account, you can quote this note from your own instance. Search https://kokonect.link/notes/ailbayq8edae01ua on your instance and quote it. (Note that quoting is not supported in Mastodon.)