とにかく進むねん。
勉強サークルのブログです。 もがきながらでも進むこと。 これがモットーです。
ブログ内検索
リンク
管理画面
新しい記事を書く
カレンダー
03
2025/04
05
S
M
T
W
T
F
S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
アーカイブ
2012 年 12 月 ( 3 )
2012 年 11 月 ( 11 )
2012 年 10 月 ( 4 )
2012 年 09 月 ( 5 )
2012 年 08 月 ( 4 )
プロフィール
HN:
betweens
性別:
非公開
カウンター
カテゴリー
宿題 ( 10 )
colinux 設定 ( 16 )
colinux network設定 ( 4 )
検索エンジン付き合い方 ( 9 )
C++ ( 2 )
未選択 ( 102 )
shell script ( 1 )
code golf ( 66 )
Haskell ( 14 )
Python Challenge ( 2 )
Project Euler ( 2 )
Python Study ( 3 )
英語 ( 1 )
JAVA ( 3 )
ゴミ情報 ( 1 )
RSS
RSS 0.91
RSS 1.0
RSS 2.0
最新CM
無題
[11/07 betweens]
無題
[11/07 元左席人]
無題
[08/30 betweens]
無題
[08/30 元左席人]
無題
[10/02 元左席人]
最新TB
最新記事
anarchy golf (Haskell) [Number lines]
(12/13)
anarchy golf (Haskell) [spirals] 【Vol.4】
(12/06)
anarchy golf (Haskell) [ two kinds of digit ] 読解
(12/05)
anarchy golf (Haskell) [Reduce fractions]
(11/13)
anarchy golf (Haskell) [Fill in the blanks]
(11/11)
最古記事
宿題 [2008.01a] colinux をインストールしよう
(05/10)
[2008.01a] colinux をインストールしよう(解答編1)
(05/15)
[2008.01a] colinux をインストールしよう(解答編2)
(05/17)
[2008.01a] colinux をインストールしよう(解答編3)
(05/18)
Google のノウハウ
(05/19)
フリーエリア
2025
04,11
19:16
[PR]
CATEGORY[]
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
2012
09,28
23:27
anarchy golf (Haskell) [Look and say] No.5
CATEGORY[未選択]
【前回までのベスト】98バイト
n#[x]=show n++[x]
n#(x:s)|x==s!!0=(n+1)#s|1>0=n#[x]++1#s
main=interact$unlines.take 12.iterate(1#)
【修正後1】97バイト
n#[x]=shows n[x]
n#(x:s)|x==s!!0=(n+1)#s|1>0=n#[x]++1#s
main=interact$unlines.take 12.iterate(1#)
知っていた技を使っただけなので、斬新な気持ちにはならず。。。
最近、答え落ちてないかなと思って検索すると、自分のブログが引っかかる... orz
【修正後2】95バイト
import List
main=interact$unlines.take 12.iterate(concat.map(\x->show(length x)++[x!!0]).group)
group 関数を使うことで、一気に2文字縮んだ。
しかし、甘くないなあ...
まだまだ、先があるのか...
【修正後3】 94バイト
import List
main=interact$unlines.take 12.iterate(concat.map(\x->shows(length x)[x!!0]).group)
shows は、いつも golf で使うもんだなーと思うようになってきた。
【修正後3】 93バイト
import List
main=interact$unlines.take 12.iterate(concatMap(\x->shows(length x)[x!!0]).group)
http://d.hatena.ne.jp/notogawa/20101011/1286814280
ゴルフ辞典を見て、concat.map f からリストモナド(>>=)につなげることが
キーだと思ったが、なかなかコンパイルが通らない...
一週間くらい考えればなんとかなるだろうか。
PR
コメント[0]
<<
anarchy golf (Haskell) [Look and say] No.6
|
HOME
|
anarchy golf (Haskell) [reversed squares] 【Vol.1】
>>
コメント
コメント投稿
NAME:
MAIL:
URL:
COLOR:
Black
LimeGreen
SeaGreen
Teal
FireBrick
Tomato
IndianRed
BurlyWood
SlateGray
DarkSlateBlue
LightPink
DeepPink
DarkOrange
Gold
DimGray
Silver
SUBJECT:
COMMENT:
PASS:
<<
anarchy golf (Haskell) [Look and say] No.6
|
HOME
|
anarchy golf (Haskell) [reversed squares] 【Vol.1】
>>
忍者ブログ
[PR]