Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

mods thread was deleted

Name: Anonymous 2013-07-29 3:41

It's time for another one.

Fuck you mods, etc etc.

Thanks for not banning me though. uguu~

On an unrelated note, try to produce a program in less than 200 characters that will give this output.



(((((((((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ()) (((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((((())) ()) (())) ((())) ()) (((())) ()) (())) ((((())) ()) (())) ((())) ())



Deadline: before this thread is deleted.

Name: Anonymous 2013-07-30 11:53

>>51

Here is the powerset shit:


{-# LANGUAGE GADTs, InstanceSigs #-}
module Powerset where

import Control.Applicative
import Data.Monoid
import qualified Data.List as L
import Data.Foldable
import Prelude hiding (foldr, foldl, foldr1, foldl1, and )

data Set a where
    Set :: [a] -> Set a

instance Eq a => Eq (Set a) where
    s1 == s2 = subSet s1 s2 && subSet s2 s1

instance Eq a => Monoid (Set a) where
    mempty = Set []
    mappend (Set xs) ys = foldr (insert) ys xs

instance Foldable (Set) where
    fold (Set ms) = fold ms
    foldMap f (Set ms) = foldMap f ms
    foldr f b (Set xs) = foldr f b xs
    foldr' f b (Set xs) = foldr' f b xs
    foldl f b (Set xs) = foldl f b xs
    foldl' f b (Set xs) = foldl' f b xs
    foldr1 f (Set xs) = foldr1 f xs
    foldl1 f (Set xs) = foldl1 f xs

-- | Where are the unfoldable classes, so I can have my free fromList :(
fromList :: Eq a => [a] -> Set a
fromList xs = foldr insert (Set []) xs

-- | Insert a member of the set.
insert :: Eq a => a -> Set a -> Set a
insert x z@(Set xs) | not (inSet x z) = Set (x:xs)
            | otherwise = z


-- | Delete a member of the set
delete :: Eq a => a -> Set a -> Set a
delete x z@(Set xs) | not (inSet x z) = z
            | otherwise = Set (L.delete x xs)

-- | Test if something is in the set
inSet :: Eq a => a -> Set a -> Bool
inSet a (Set xs) = L.any (==a) xs 

-- | Calculate if set is subset of other set
subSet :: Eq a => Set a -> Set a -> Bool
subSet xs ys = and $  foldr (\x z -> inSet x ys : z ) [] xs 

-- | Compute if the set is empty
isEmpty :: Set a -> Bool
isEmpty (Set []) = True
isEmpty _ = False



-- | Compute the powerset
powerSet :: Eq a => Set a -> Set (Set a)
powerSet (Set xs) = Set $ Set <$>  powerList xs

-- | Helper to compute the powerList
powerList :: [a] -> [[a]]
powerList [] = [[]]
powerList (x:xs) = powerList xs `mappend` ((x:) <$> powerList xs)


-- | typing the type is horrible

fourthPowerset :: Set (Set (Set (Set (Set ()))))
fourthPowerset =   powerSet $ powerSet $ powerSet $ powerSet $ (mempty :: Set ())


fifthPowerset :: Set (Set (Set (Set (Set (Set ())))))
fifthPowerset =  powerSet $ powerSet $ powerSet $ powerSet $ powerSet $ (mempty :: Set ())

instance (Show a) => Show (Set a) where
    showsPrec _ (Set s) str = showSet s str

showSet [] str = showString "()" str
showSet (x:xs) str = showChar '(' (shows x (showl xs str))
    where showl [] str = showChar ')' str
          showl (x:xs) str = showChar ' ' (shows x (showl xs str))


With as output for the fourth powerset:


(() ((() (()))) ((())) ((()) (() (()))) (((()))) (((())) (() (()))) (((())) (())) (((())) (()) (() (()))) (()) (() (() (()))) (() (())) (() (()) (() (()))) (()
 ((()))) (() ((())) (() (()))) (() ((())) (())) (() ((())) (()) (() (()))))"


Which is very different. And the fifth empty power set universe is too long to large to this thread, but you can run it for your  leisure.

Let's do some analysis instead of wild guesses.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List