#chatGPT - Assistant thinks #Haskell is way to difficult and is trying to discourage me from using it.
I have to talk it down from a ledge to get it to write the code, which it does. It apologizes profusely for the scripts limitations.
import System.Random
import Control.Concurrentdata Fish = Fish { x :: Int, y :: Int }
moveFish :: Fish -> IO Fish
moveFish (Fish x y) = do
dx <- randomRIO (-1, 1)
dy <- randomRIO (-1, 1)
return (Fish (x + dx) (y + dy))displayFish :: Fish -> IO ()
displayFish (Fish x y) = do
putStrLn (replicate x ' ' ++ "🐟" ++ replicate (80 - x) ' ')main = do
let fish = Fish 10 10
forever $ do
fish' <- moveFish fish
displayFish fish'
threadDelay 1000000♡ 0 ↻ 0this program is going to take forever, isn't it.
♡ 0 ↻ 0