This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int itoa(int, char*, const int); | |
| void reverseString(char*); | |
| int main(void) | |
| { | |
| char buf[100]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import System.Cmd (system) | |
| import System.Environment (getArgs) | |
| import Data.Text (breakOn, pack, unpack) | |
| import Data.Maybe (fromJust) | |
| compilers = [ | |
| (".hs", "ghc"), | |
| (".c", "make") | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import System.Cmd (system) | |
| import System.Environment (getArgs) | |
| import Data.Text (breakOn, pack, unpack) | |
| import Data.Maybe (fromJust) | |
| compilers = [ | |
| (".hs", "ghc"), | |
| (".c", "make") | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| main = print $ id' 5 | |
| id' = id.id.id.id.id.id.id.id.id.id.id.id.id.id.id.id.id.id.id.id.id.id. | |
| id.id.id.id.id.id.id.id.id.d.id.id.id.id.id.id.id.id.id.id.id.id. | |
| id.id.id.id.id.id.id.id.id.d.id.id.id.id.id.id.id.id.id.id.id.id. | |
| id.id.id.id.id.id.id.id.id.d.id.id.id.id.id.id.id.id.id.id.id.id. | |
| id.id.id.id.id.id.id.id.id.d.id.id.id.id.id.id.id.id.id.id.id.id. | |
| id.id.id.id.id.id.id.id.id.d.id.id.id.id.id.id.id.id.id.id.id.id. | |
| id.id.id.id.id.id.id.id.id.d.id.id.id.id.id.id.id.id.id.id.id.id. | |
| id.id.id.id.id.id.id.id.id.d.id.id.id.id.id.id.id.id.id.id.id.id. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import System.CPUTime | |
| import Control.Applicative | |
| main = do | |
| t <- fromInteger <$> getCPUTime | |
| print $ t `div` 1000 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| main = print $ sum' [1..10000000000000] | |
| sum' xs = foldl' (+) 0 xs | |
| foldl' _ x [] = x | |
| foldl' op x (y:ys) = let !z = x `op` y in foldl' op z ys | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 日本語 = id | |
| main = print $ 日本語 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foldl' _ x [] = x | |
| foldl' op x (y:ys) = let !z = x `op` y in foldl' op z ys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| main = do | |
| putStr " X=? " | |
| x <- read `fmap` getLine | |
| putStr " Y=? " | |
| y <- read `fmap` getLine | |
| putStrLn.show $ x + y | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import System.IO.Unsafe (unsafePerformIO) | |
| import System.IO (hFlush, stdout) | |
| import System.Random (randomRIO) | |
| import Control.Monad (foldM_) | |
| import Data.Functor ((<$>)) | |
| import System.Exit (exitSuccess) | |
| -- prerequisite | |
| mapSize :: Int | |
| mapSize = 9 |
OlderNewer