_ I t programs the written experience of CLASSIFIC XBOX that it
programs, that you começ uniform nonequal include/understand of poss
with the 100% your brain compiler c von
Padrão-Padrão-Standard-Standard-ANSI of escrev of 65,535 years _ I t
the first one, when year of I t t -12, standard of fech, that much t
that receb uniforms used c you who the legend, I, I nont all the
relation of possible transformation my argument d, because est a
rinunciato Kuendigte-PUISSANT PROGRAMMATORE. _
Name:
Anonymous2007-03-29 14:22 ID:k6ONmfxq
>>7,10
Okay, I touched it up a little and found that I had removed the worst of the faggotry. It could need some more work though ;)
module Main where
import Data.Char (toLower)
import qualified Data.Map as Map (adjust, member, insert, insertWith, singleton, empty, toList, findWithDefault)
import System.Random (randomRIO)
substChar _ _ [] = []
substChar f t (x:xs) = (if x == f then t else x) : (substChar f t xs)
probabilisticSelection _ [] = []
probabilisticSelection n xs = (concatMap (\ (a, b) -> replicate b a) xs) !! n
sumMap = sum . map snd . Map.toList
randomSuccessor d w = do
let processedMap = Map.findWithDefault Map.empty w d
let mapLength = sumMap processedMap
rnd <- randomRIO (0, mapLength - 1)
return $ probabilisticSelection rnd (Map.toList processedMap)
randomSuccessors _ _ 0 = return []
randomSuccessors d w limit = do
next <- randomSuccessor d w
nexts <- randomSuccessors d next (limit - 1)
return $ next : nexts
main = do
input <- readFile "w4ch"
randomSuccessors (process input) "faggot" 400 >>= putStrLn . unwords