Haskell

さらにかいりょーばん

module Main () where import Data.Char main = do cs ← getLine let values = map strToInt ( splitBySpace cs ) w = values !! 0 h = values !! 1 print $ area w h print $ around w h strToInt :: String → Int strToInt = read area :: Int → Int → Int…

LeksahをUbuntu10.04で動かそう(断念)

leksahがモジュールを見つけてくれない。 コンパイルとかは出来るんだけど、補完入力とかモジュール検索とか見れないと面白くないよぅ。 起動時にpackageinfo not foundんちゃらかんちゃらがずらずらと出るよう。 なんでかは分からん。てやんでぃ!てやんで…

昨日のかいりょーばん

module Main () where import GHC.IO (liftIO) main = do i1 ← getInt i2 ← getInt let w = i1 h = i2 print $ area w h print $ around w h getInt :: IO Int getInt = readLn area :: Int → Int → Int area w h = w * h around :: Int → Int → Int around …

WindowsでLeksahを使おう(まとめ)

http://neue.cc/2010/01/04_233.htmlさんのところでかなり紹介されてますが、 ここにあるやり方しか知らないと無理だったりするので。補足的な。 試したのはWindowsXP ProとWindows7Pro64bitです。 まずこれを動かすにはiconv.dllが必要。 こちらのサイトか…

長方形の面積と周を求める

学部四回生がうんこプログラム組んでますよ これに一時間かかりますた^q^ いやね、本読んでてもさっぱり頭に入らないので。 作ってみた方が早いよねっていう。 module Main ( ) where main = do rl ← readLn rl2 ← readLn let w :: Int h :: Int w = rl h…

Leksahで動いているプログラムに標準入力したいでござる

http://groups.google.com/group/leksah/browse_thread/thread/7d3e3bf64e56f190/30278795c23b2168?lnk=gst&q=input#30278795c23b2168あひぃ 数日費やして調べた結果がこれかよ