[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

code {-# LANGUAGE RecordWildCards #-} import System.Random import

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 9
Thread images: 1

File: kiss.gif (479KB, 300x374px) Image search: [Google]
kiss.gif
479KB, 300x374px
code
{-# LANGUAGE RecordWildCards #-}

import System.Random
import System.Process
import System.Environement

data F = F {x :: Int, y :: Int
,a :: Int, b :: Int} deriving (Show, Eq)

def = F {x=1920, y=1080, a=0, b=0}

interpret = foldl f def
where f (F {..}) 't' = F x (y `div` 2) a b
f (F {..}) 'b' = F x (y `div` 2) a (y `div` 2)
f (F {..}) 'r' = F (x `div` 2) y (x `div` 2) b
f (F {..}) 'l' = F (x `div` 2) y a b

ffmpeg (F {..}) n
= "ffmpeg -video_size " ++ show x
++ "x" ++ show y ++ " -framerate 25 -f x11grab -i :0.0+"
++ show a ++ "," ++ show b ++ " " ++ n ++ ".mp4"

main = do
[i] <- getArgs
name <- fmap (take 16) $ fmap (randomRs ('a','z')) newStdGen
spawnCommand (ffmpeg (interpret i) name) >>= waitForProcess


ghc error
[1 of 1] Compiling Main             ( rec.hs, rec.o )

rec.hs:21:1: error:
parse error (possibly incorrect indentation or mismatched brackets)


pls halp, im lost
>>
21:1 is the line
++ show a ++ "," ..
>>
nevermind, I was using the wrong copy of the file
>>
>import System.Environement
>>
r8 my final prog
{-# LANGUAGE RecordWildCards #-}

import System.Environment (getArgs)
import System.Process (spawnCommand, waitForProcess)

data F = F { x :: Int, y :: Int
, a :: Int, b :: Int } deriving (Show, Eq)

def = F {x=1920, y=1080, a=0, b=0}

interpret = foldl f def
where f (F {..}) 't' = F x (div y 2) a b
f (F {..}) 'b' = F x (div y 2) a (div y 2)
f (F {..}) 'r' = F (div x 2) y (div x 2) b
f (F {..}) 'l' = F (div x 2) y a b
f (F {..}) 's' = F x y a b

ffmpeg (F {..}) file
= foldl1 (++) [ "ffmpeg -video_size ", show x, "x", show y
, " -framerate 25 -f x11grab -i :0.0+"
, show a, ",", show b, " ", file
]

main = do
[p,n] <- getArgs
spawnCommand (ffmpeg (interpret p) n) >>= waitForProcess
>>
What's the point of using a non-interpreted language for scripting?
>>
>>55829446
whos dis semen demen
>>
>>55831397
>What's the point of using a non-interpreted language for scripting?
haskell my first
and I don't know how to do folding in other languages
>>
>>55831525
Russian grill who made a song video.
reverse search and you should find a forum with sauces
Thread posts: 9
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.