Recent public codes are listed below. You can filter them by the following programming languages:
- view
- All
- Ada
- Assembler
- Assembler
- AWK (gawk)
- AWK (mawk)
- Bash
- bc
- Brainf**k
- C
- C#
- C++
- C++0x
- C99 strict
- CLIPS
- Clojure
- COBOL
- COBOL 85
- Common Lisp (clisp)
- D (dmd)
- Erlang
- F#
- Factor
- Falcon
- Forth
- Fortran
- Go
- Groovy
- Haskell
- Icon
- Intercal
- Java
- JavaScript (rhino)
- JavaScript (spidermonkey)
- Lua
- Nemerle
- Nice
- Nimrod
- Objective-C
- Ocaml
- Oz
- Pascal (fpc)
- Pascal (gpc)
- Perl
- Perl 6
- PHP
- Pike
- Prolog (gnu)
- Prolog (swi)
- Python
- Python 3
- R
- Ruby
- Scala
- Scheme (guile)
- Smalltalk
- SQL
- Tcl
- Text
- Unlambda
- VB.NET
- Whitespace
-
1
main = getContents >>= (\x -> putStrLn $ unlines $ takeWhile (/="42") $ lines x)
-
1 2 3 4 5 6 7
main = do x <- getLine >>= (\y -> readIO y :: IO Integer) if x == 42 then putStr("") else do putStr (show (x) ++ "\n") main
-
1
main = getContents >>= (\x -> putStrLn $ unlines $ takeWhile (/="42") $ lines x)
-
1
main = getContents >>= (\x -> putStrLn $ unlines $ takeWhile (/="42") $ lines x)
-
1
main = putStrLn $ unlines $ takeWhile (/="42") $ lines getContents
-
1
main = putStrLn $ unlines $ takeWhile (<>"42") $ lines getContents
-
1 2 3 4 5 6 7
main = do x <- getLine >>= (\y -> readIO y :: IO Integer) if x == 42 then putStr("") else do putStr (show (x) ++ "\n") main
-
1 2 3 4 5 6 7 8
import Data.List import Data.Function readArray [] _ acc = concat acc readArray (line:rest) n acc = readArray rest (n+1) ((readLine n line):acc) where readLine y line = map (\(x, s) -> ((x, y), read s::Int)) $ zip [0..] $ words line
...
-
1 2 3 4 5 6 7 8
import Data.List import Data.Function readArray [] _ acc = concat acc readArray (line:rest) n acc = readArray rest (n+1) ((readLine n line):acc) where readLine y line = map (\(x, s) -> ((x, y), read s::Int)) $ zip [0..] $ words line
...
-
1 2 3 4 5 6 7 8
import Data.List import Data.Function readArray [] _ acc = concat acc readArray (line:rest) n acc = readArray rest (n+1) ((readLine n line):acc) where readLine y line = map (\(x, s) -> ((x, y), read s::Int)) $ zip [0..] $ words line
...
-
1 2 3 4 5 6 7 8
import Data.List import Data.Function readArray [] _ acc = concat acc readArray (line:rest) n acc = readArray rest (n+1) ((readLine n line):acc) where readLine y line = map (\(x, s) -> ((x, y), read s::Int)) $ zip [0..] $ words line
...
-
1 2 3 4 5 6 7 8
import Data.List import Data.Function readArray [] _ acc = concat acc readArray (line:rest) n acc = readArray rest (n+1) ((readLine n line):acc) where readLine y line = map (\(x, s) -> ((x, y), read s::Int)) $ zip [0..] $ words line
...
-
1 2 3 4 5 6 7 8 9
import System.Random ( RandomGen, StdGen, randomR, newStdGen ) main = do gen <- newStdGen let (results, gen) = monteCarloRun 3 gen piStep in putStr . show $ foldl piEval (0::Int) results type Result = Bool
...
-
1 2 3 4 5 6 7 8 9
main=import Data.Set (Set, empty, insert, member) a005282 n = a005282_list !! (n-1) a005282_list = sMianChowla [] 1 empty where sMianChowla :: [Integer] -> Integer -> Set Integer -> [Integer] sMianChowla sums z s | s' == empty = sMianChowla sums (z+1) s | otherwise = z : sMianChowla (z:sums) (z+1) s where s' = try (z:sums) s try :: [Integer] -> Set Integer -> Set Integer try [] s = s
...
-
1 2 3 4 5 6 7 8 9
import Data.Set (Set, empty, insert, member) a005282 n = a005282_list !! (n-1) a005282_list = sMianChowla [] 1 empty where sMianChowla :: [Integer] -> Integer -> Set Integer -> [Integer] sMianChowla sums z s | s' == empty = sMianChowla sums (z+1) s | otherwise = z : sMianChowla (z:sums) (z+1) s where s' = try (z:sums) s try :: [Integer] -> Set Integer -> Set Integer try [] s = s
...
-
1 2 3
main = do test :: Int -> Int x = (x+2)
-
1 2 3
main = do test :: Int -> Int x = (x+2)
-
1 2 3 4 5
Defaulting the following constraint(s) to type `Integer' (Integral b0) arising from a use of `^' at src\Main.hs:60:10 (Num b0) arising from the literal `2' at src\Main.hs:60:12 In the expression: x ^ 2 In an equation for `sq': sq x = x ^ 2
-
1 2
sq :: RealFloat a => a -> a sq x = x ^ 2
-
1 2 3 4 5 6 7 8 9
import qualified Data.Map as Map import Data.List import Data.Maybe data Player = X | O deriving (Show,Eq) newtype Square = Square (Maybe Player) instance Show Square where
...
-
1 2 3 4 5 6 7 8 9
import qualified Data.Map as Map import Data.List import Data.Maybe data Player = X | O deriving (Show) instance Eq Player where X == X = True
...
-
1 2 3 4 5 6 7 8 9
import qualified Data.Map as Map import Data.List import Data.Maybe data Player = X | O deriving (Show) instance Eq Player where X == X = True
...
-
1 2 3 4 5 6 7 8 9
-- prime numbers sieve [] = [] sieve (x:u) = x : (sieve (filter (\y -> mod y x /= 0) u)) allPrimes = sieve [2..] divisorsFrom x u@(y:v)
...
-
1 2 3 4 5 6 7 8 9
import qualified Data.Map as Map import Data.List import Data.Maybe data Player = X | O deriving (Show) instance Eq Player where X == X = True
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad import System.IO average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...
-
1 2 3 4 5 6 7 8 9
import Data.List import Data.Function import Control.Monad average xs = sum xs / fromIntegral (length xs) d4 :: (Fractional t, Ord t) => [t] -> [t] d4 xs | d > difference * 4 = d4 withoutV | otherwise = xs
...


