icfp プログラミングコンテストに

33
ICFP プププププププププププププ @kinaba ( 稲稲 ) プププププププププ

Upload: nora-franco

Post on 01-Jan-2016

34 views

Category:

Documents


0 download

DESCRIPTION

ICFP プログラミングコンテストに. 言語で参加してみた. @ kinaba ( 稲葉 一浩 ). 自己紹介. D 言語 の言語仕様の日本語訳をしています 最近更新が遅くてすみません. 日本語訳ページの紹介. 去年から github に 翻訳レポジトリを 置きました。 1 Click で 誤訳等の 修正リクエスト できます。. 本題. ICFP とは. λ 計算. 型システム. Haskell, ML, Scheme. プログラム 検証. ICFP Programming Contest. ICFP の主催するプログラミングコンテスト - PowerPoint PPT Presentation

TRANSCRIPT

ICFP

ICFP

@kinaba ( )

D

github

Click

ICFP

Haskell, ML, SchemeICFP Programming ContestICFP 67 ()72 () () AI In addition (to ), the organizers will declare ...the first place team's language is "the programming language of choice for discriminating hackers",the second place team's language is "a fine tool for many applications, and ...

2003 : OCaml2004 : JavaScript2005 : JavaScript2006 : D, (Ruby, Java) => 22007 : C++2008 : JavaScript2009 : Java2010 : D, Ruby, (OCaml, Java)2011 : ()2012 : D => 6

[UDLRS]*160 SIGINT

Debian 32bitwww.kmonos.net/repos/icfpc12gui.d

google: icfp visualizer

gui.dDFL http://www.dprogramming.com/dfl.phphttps://github.com/Rayerd/dfl

gui.d this.keyDown ~= (Control c, KeyEventArgs ev) { switch(ev.keyCode) { case Keys.DOWN: do_manual_command('D'); break; case Keys.UP: do_manual_command('U'); break; ...};

util.d

util.d Haskell deriving (Eq, Ord, Show) class Point { public immutable int x, y; mixin DeriveCreate; mixin DeriveCompare; mixin DeriveShow;}new Point(12, 345)(p1 == p2), p1.toHash()p.toString == Point(x: 12, y:345)util.d template DeriveShow() {override: string toString() const { string str = typeof(this).stringof ~ "("; foreach(i,mem; this.tupleof) { if(i) str ~= ", "; str = str ~ this.tupleof[i].stringof[5..$] ~ ":" ~ text(mem); } return str ~ ")"; }}solver.d

solver.d 20Game Over

72

1000 1000 = 1MB 160(D )const const Type const(Type) const(Point2d) p = new Point2d;p.x = 100; // ERROR. GOOD!!p = new Point2d; // ERROR! WHY?(7dmd 2.059 -> 2.062output.d(85): Error: function core.stdc.signal.signal ( int sig, extern (C) void function(int) nothrow @system func) is not callable using argument types (int,extern (C) void function(int _param_0))

output.d(85): Error: cannot implicitly convert expression (& catch_sigint) of type extern (C) void function(int _param_0) to extern (C) void function(int) nothrow @systemextern(C) static void catch_sigint(int) { ... }core.stdc.signal.signal(SIGINT, &catch_sigint);2.059 -> 2.062a.d(6): Error: &a is not an lvaluea.d(6): Error: __error is not an lvaluea.d(6): Error: cannot append type Tuple!(int, int) to type Tuple!(int, int)[]*import std.typecons;void main() { Tuple!(int,int)[] a, b; (true ? a : b) ~= tuple(1,2);}ICFP OK! (D!)

AIGUI WebAI (D!)67Lets join and enjoy!!!

http://www.kmonos.net/wlog/128.html#_2343121201sort

std.algorithm.sort

array size#cmp