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

“I think it only makes sense to seek out and identify structures of authority, hierarchy, and domination in every aspect of life, and to challenge them; unless a justification for them can be given, they are illegitimate, and should be dismantled, to increase the scope of human freedom.”
― Noam Chomsky

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


  • Who's Online   0 Members, 0 Anonymous, 92 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.