This file contains 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 | |
let a = 10 | |
b = 20 in | |
print $ if a > b then a else b |
This file contains 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 "hspkey.as" | |
buffer 1 : picload ".\\img\\life.bmp" | |
lifesize_x = ginfo(12)/8 | |
lifesize_y = ginfo(13) | |
gsel 0 | |
betreg = 0 : betweencntr = 5 |
This file contains 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
{-# LANGUAGE FlexibleInstances #-} | |
class Watashi a where | |
next :: [String] -> a | |
instance Watashi String where | |
next = unwords . reverse | |
instance (Watashi r) => Watashi (String -> r) where | |
next xs b = next $ b:xs |
This file contains 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
// 1. 使用言語・動作環境 | |
// 言語 : C# 5.0 | |
// コンパイラ: Microsoft (R) Visual C# Compiler version 12.0.21005.1 | |
// IDE : Microsoft Visual Studio Express 2012 for Windows Desktop | |
// .Net : 4.5.50938 | |
// OS : Windows 7 Professional | |
// 2. プログラムの特長・工夫した点等、アピールポイント | |
// LINQを使いました。 |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ABC | |
{ | |
class Program | |
{ |
This file contains 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
data FizzBuzz = NumFB | Fizz | Buzz | FizzBuzz deriving (Eq, Show, Read) | |
invFizzBuzz :: [FizzBuzz] -> [(Int, Int)] | |
invFizzBuzz xs = fmap (\x -> | |
if izbz x xs then (x, qtmap x xs) else (-1, -1) | |
) [1..1000] | |
izbz :: Int -> [FizzBuzz] -> Bool | |
izbz x xs |
This file contains 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 Control.Monad | |
show' :: Int -> String | |
show' x | |
| x == 0 = "no more bottles" | |
| x == 1 = "1 bottle" | |
| otherwise = show x ++ " bottles" | |
main = forM [99,98..0] (\x -> putStrLn $ |
This file contains 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.Random | |
import Control.Monad | |
bs :: String | |
bs = "firstspring1845" | |
bs' :: String | |
bs' = "fsrg84" | |
This file contains 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.Random | |
bbop :: RandomGen g => Int -> Int -> g -> String | |
bbop n c gen | |
= fmap (\x -> bbops !! x) $ take n $ randomRs (0, length bbops -1) gen where bbops = "ビビドレドオペレショ" | |
{- ビビッドレッド・オペレーション | |
0 1 2 3 4 5 6 7 8 9 1011121314 | |
-} |
This file contains 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 Control.Monad | |
main=forM[1..100](\x->putStrLn$ | |
case(x`mod`3,x`mod`5)of | |
(0,0)->"FizzBuzz" | |
(0,_)->"Fizz" | |
(_,0)->"Buzz" | |
(_,_)->show x | |
) |