CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 06:14:07 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=72bb277adb76a980f60e19966e4afe8092ae575022f299be1fca2e9e16c15f61a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22-hfMvFUtqjE_L2NweMhK-r9p6ITQmJaX%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cc3727bb96c1ae-BLR
Quick, reliable pseudo-shuffler (enhanced) - Pastebin.com
SHARE
TWEET

Quick, reliable pseudo-shuffler (enhanced)
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Data.Function
- import Data.List
- orderLists :: [a] -> [a] -> ([a], [a])
- orderLists xs ys
- | on compare length xs ys == LT = (xs, ys)
- | otherwise = (ys, xs)
- listsLengthQuotient :: ([a], [a]) -> ([a], [a], Int)
- listsLengthQuotient (xs, ys) =
- (xs, ys, (round $ on (/) (fromIntegral . length) ys xs) :: Int)
- chunksOf :: Int -> [a] -> [[a]]
- chunksOf n [] = []
- chunksOf x xs = take x xs : chunksOf x (drop x xs)
- groupListItems :: ([a], [a], Int) -> ([[a]], [[a]])
- groupListItems (xs, ys, q) = (chunksOf 1 xs, chunksOf q ys)
- merge :: ([a], [a]) -> [a]
- merge (xs, []) = xs
- merge ([], ys) = ys
- merge (x:xs, y:ys) = y : x : merge (xs, ys)
- mixLists :: [a] -> [a] -> [a]
- mixLists xs ys =
- concat $ merge $ groupListItems $ listsLengthQuotient $ orderLists xs ys
- main :: IO ()
- main = do
- input <- getContents
- mapM_ putStrLn $
- foldl1 mixLists $ sortBy (on compare length) (group . sort $ lines input)
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 13 sec ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 20 sec ago | 0.24 KB
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 29 sec ago | 0.24 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 38 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ✅ NEVER SEEN...
JavaScript | 48 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 57 sec ago | 0.24 KB
-
✅⭐ Make $2500 in 15 minutes ✅ NEVER SEEN BEFO...
JavaScript | 1 min ago | 0.24 KB
-
⭐✅ Trading Profit Method ✅ NEVER SEEN BEFORE...
JavaScript | 1 min ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand