Skip to content

Instantly share code, notes, and snippets.

@Nucleareal
Nucleareal / utsuho-List.html
Last active August 29, 2015 13:56
2014/02/23 ワンドロ 霊烏路空 まとめ
<html>
<a href="https://twitter.com/P_C_B/status/437597722447605761">1</a>
<a href="https://twitter.com/teikuoritei/status/437594345001058305">1</a>
<a href="https://twitter.com/pjrmhm_coa/status/437592926755885056">1</a>
<a href="https://twitter.com/hue3939/status/437590528972976129">1</a>
<a href="https://twitter.com/Abso_Lunatic/status/437590516608163840">1</a>
<a href="https://twitter.com/eico0/status/437590134792261632">1</a>
<a href="https://twitter.com/amiru9/status/437589663956496384">1</a>
<a href="https://twitter.com/yamu_RN/status/437593484992581633">1</a>
<a href="https://twitter.com/op_na_yarou/status/437588846620860416">1</a>
import Control.Monad
main=forM[1](\x->putStrLn"*\n**\n***\n****\n***\n**\n*")
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
)
@Nucleareal
Nucleareal / bbop.hs
Created March 4, 2014 10:58
誰か手伝ってくれ~~~~~~~~
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
-}
@Nucleareal
Nucleareal / bbopK.hs
Last active August 29, 2015 13:56
不必要に長いbbop
import System.Random
import Control.Monad
bs :: String
bs = "firstspring1845"
bs' :: String
bs' = "fsrg84"
@Nucleareal
Nucleareal / 99bottles.hs
Created March 4, 2014 12:52
99 Bottles of Beer on Haskell
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 $
@Nucleareal
Nucleareal / invfizzbuzz.hs
Created March 4, 2014 14:13
状況: 逆FizzBuzz問題を解いている 難題: qtmapの型不一致
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
@Nucleareal
Nucleareal / problem
Last active August 29, 2015 13:57
どうぞ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ABC
{
class Program
{
// 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を使いました。
@Nucleareal
Nucleareal / mutableArgLengthFunc.hs
Created April 1, 2014 09:08
可変長引数のメモ
{-# 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