Jump to content

The Ctrl+V game

Recommended Posts

// Do we have subforums?
$active_forum_ary = $moderators = array();

if ($forum_data['left_id'] != $forum_data['right_id'] - 1)
{
list($active_forum_ary, $moderators) = display_forums($forum_data, $config['load_moderators'], $config['load_moderators']);
}
else
{
$template->assign_var('S_HAS_SUBFORUM', false);
if ($config['load_moderators'])
{
	get_moderators($moderators, $forum_id);
}
}

Share this post


Link to post

import System.IO

main :: IO ()
main = do
inh <- openFile "map.txt" ReadMode
infStr <- hGetContents inh
let etch = processData (replace (replace infStr " " "") "\n" "")
putStrLn "Type something: "
inpStr <- getLine
let modified = atalakit inpStr etch
putStrLn $ show modified

processData :: String -> [(String, String)]
processData [] = [([],[])]
processData [x] = [([x],[])]
processData (x:y:xs) = (([x],[y]) : processData xs)

atalakit :: String -> [(String, String)] -> String
atalakit bev [] = []
atalakit bev [("","")] = bev
atalakit bev [(x,"")] = replace bev x ""
atalakit bev [(x,y)] = replace bev x y
atalakit bev ((x,y):xs) = atalakit (replace bev x y) xs


replace :: Eq a => [a] -> [a] -> [a] -> [a]
replace [] _ _ = []
replace miben mit mire =
   if take (length mit) miben == mit
       then mire ++ (replace (drop (length mit) miben) mit mire)
       else [head miben] ++ (replace (tail miben) mit mire)

My haskell homework.

"It's not about changing the world. It's about doing our best to leave the world... the way it is. It's about respecting the will of others, and believing in your own."

Share this post


Link to post

''Almost everything–all external expectations, all pride, all fear of embarrassment or failure–these things just fall away in the face of death, leaving only what is truly important.'' - Steve Jobs

Share this post


Link to post

ወደፊት ገስግሺ ውድ እናት ኢትዮጵያ?,

 

SPOILER TAGS, PLEASE :/

Do you feel blame? Are you mad? Uh, do you feel like wolf kabob Roth vantage? Gefrannis booj pooch boo jujube; bear-ramage. Jigiji geeji geeja geeble Google. Begep flagaggle vaggle veditch-waggle bagga?

Share this post


Link to post

"RAINBOW BLITZ YOU MOVE THAT CLOUD OUT OF THE WAY RIGHT THIS INSTANT OR SO HELP ME SOLARIS, I’LL BLEACH THAT MISERABLE DISASTER YOU CALL A MANE IN YOUR SLEEP!!"

Retired Forum Moderator

Share this post


Link to post

wat 4

Do you feel blame? Are you mad? Uh, do you feel like wolf kabob Roth vantage? Gefrannis booj pooch boo jujube; bear-ramage. Jigiji geeji geeja geeble Google. Begep flagaggle vaggle veditch-waggle bagga?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in the community.

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Who's Online   0 Members, 1 Anonymous, 140 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

This website uses cookies, as do most websites since the 90s. By using this site, you consent to cookies. We have to say this or we get in trouble. Learn more.