Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
mattam has quit ["leaving"]
docelic|away is now known as docelic
kjs3 has joined #ocaml
engstad has joined #ocaml
engstad has quit [Client Quit]
engstad has joined #ocaml
<mrvn_> seth: Debian has a ocaml-doc package with the html docs.
<mrvn_> (in case you have debian)
<seth> mrvn_: Yes, I have a debian box.
<mrvn_> Hmm, my crystall ball seems to be working again :)
systems has joined #ocaml
<engstad> Has anyone coded anything using ncurses and ocaml?
<Smerdyakov> I coded something with C and ocaml!
<Smerdyakov> I meant C and ncurses :O
<systems> hehe
foxster has quit [Read error: 104 (Connection reset by peer)]
Contra has joined #ocaml
Contra has quit ["using sirc version 2.211+KSIRC/1.2.4"]
foxster has joined #ocaml
systems has quit ["Client Exiting"]
engstad has quit [Read error: 104 (Connection reset by peer)]
lament has joined #ocaml
rox has quit ["Client Exiting"]
Smerdyakov has quit [Read error: 104 (Connection reset by peer)]
docelic is now known as docelic|sleepo
<seth> is caml-list the best mailing list for ocaml?
Smerdyakov has joined #ocaml
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
palomer has quit [Remote closed the connection]
lament has joined #ocaml
Kinners has left #ocaml []
<pattern_> seth, check out these tutorials:
foxster has quit [Read error: 104 (Connection reset by peer)]
<pattern_> neither is linked from the main ocaml site, but it's better than anything on there, imo, for a quick introduction to the language
<seth> pattern_: thanks, I'll definitely look at them.
<seth> pattern_: except, aren't both URLs the same?
<pattern_> are they?
<seth> pattern_: oh, I have to start using larger fonts. :)
<pattern_> :)
palomer has joined #ocaml
palomer has left #ocaml []
foxster has joined #ocaml
chrisb has quit [Read error: 104 (Connection reset by peer)]
mattam has joined #ocaml
<mrvn_> Finally I seem to have found all bugs.
mrvn_ is now known as mrvn
xxd has quit ["EOF"]
xxd_ has joined #ocaml
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
mrvn_ has joined #ocaml
foxster has quit [Read error: 104 (Connection reset by peer)]
mrvn has quit [Read error: 110 (Connection timed out)]
foxster has joined #ocaml
mrvn_ is now known as mrvn
foxster has quit []
mellum has quit [Read error: 60 (Operation timed out)]
mellum has joined #ocaml
<mrvn> mellum: moin
<mellum> moin moin
<mrvn> Turn 1 of 10 | 20 x 20 300 +
<mrvn> .././game2 - ../pfc/mellum
<mrvn> Game1: 1 wins Game2: 1 wins
<mrvn> mellum: Jetzt funktioniert das schon viel besser.
docelic|sleepo is now known as docelic
<mellum> mrvn: Und, wer gewinnt?
<mrvn> mellum: Ich, hin und rueckspiel.
<mellum> baeh.
<mrvn> Aber gegen alle bis auf meinen fehlerhaften entry.
<mrvn> Trotz Fehler gewinnt der einmal.
<mellum> Hm, interessant :)
<mrvn> Ich spiel gerade 10 runden, so den Tag ueber. Mal sehen was insgesammt rauskommt.
<mrvn> Wenn die anderen nicht alle so langsam waeren ....
<mellum> Checkst du auf Zeitueberschreitung?
<mrvn> Momentan nicht.
<mrvn> Aber im Schnitt bin ich vermutlich unter 1s.
<mrvn> jef: Wo sind die screenshots?
<mrvn> ups
docelic has quit [Read error: 113 (No route to host)]
zack has joined #ocaml
zack has quit [Read error: 104 (Connection reset by peer)]
smklsmkl has joined #ocaml
smkl has quit [Read error: 54 (Connection reset by peer)]
<mrvn> mellum: Any Idea how to cache move sequences and their scores and how to update them on the next move?
smklsmkl is now known as smkl
<mellum> mrvn: well, usually tou cache boards
<mrvn> I don't have a board. Just two lists of possible moves.
<mrvn> I was thinking of making a set of moves taken and map those to the score.
<mrvn> But thats realy wastefull since most sets will have the same beginning.
<mellum> Well, a move is very small, you could pack it into two bytes. So that shouldn't matter that much
<mrvn> a common suffix tree would probably be much smaller and faster for lookups.
<mrvn> Also easier to cut out elements when a move is made.
<mrvn> Did you try caching of boards?
<mrvn> Any analysis on how much that saves?
<mellum> I tried it, did not seem to have any effect for some boards, worked for others, though
<mrvn> 29261 map hit
<mrvn> 4936 map miss
<mrvn> for a empty 3x3 board
<mrvn> a 4x4 board takes ages if you print hit/miss for every move you test :(
docelic has joined #ocaml
<mrvn> Mellum: How deep did you search? Just 8 seconds or till the end?
chrisb has joined #ocaml
<mellum> mrvn: 8 seconds
skylan has quit [Read error: 60 (Operation timed out)]
Contra has joined #ocaml
docelic has quit [Read error: 113 (No route to host)]
<mellum> Hm, I want to write a function unique: 'a list -> 'a list, which returns only unique elements in a list, using Set. How can I create the appropriate Set variable?
<mrvn> mellum: Do you need it uniq all the time? Using sort and then kicking duplicates would be easier.
<mrvn> module OrderedMoves =
<mrvn> struct
<mrvn> type t = move * player
<mrvn> let compare x y = compare x y
<mrvn> end
<mrvn> module MovesSet = Set.Make(OrderedMoves)
<mellum> Well, I don't really know the type... it's the 'a in the 'a list I get
<mellum> But the sorting idea seems better, anyway :)
<mrvn> compare is 'a -> 'a -> int
docelic has joined #ocaml
<mellum> let unique l =
<mellum> let l = List.fast_sort compare l in
<mellum> let rec loop l =
<mellum> match l with
<mellum> a::b::c when a = b -> a :: (loop c)
<mellum> | l -> l
<mellum> in
<mellum> loop l;;
<mellum> why does this not work?
<mellum> Oh. I need loop (a :: c).
<mrvn> [1;2;2;3;3;4] bleibt erhalten
<mrvn> let usort l =
<mrvn> let l = List.sort compare l in
<mrvn> let rec uniq accu head = function
<mrvn> [] -> List.rev (head::accu)
<mrvn> | x::xs when x = head -> uniq accu head xs
<mrvn> | x::xs -> uniq (head::accu) x xs
<mrvn> in uniq [] (List.hd l) (List.tl l);;
<mellum> well, I don't really care about order
<mrvn> Then kill the rev
<mrvn> But that could make the sort slower next time around.
<mellum> Hmm, my variant seems simpler :)
<mellum> except it doesn't work
<mellum> and I don't understand why
<mrvn> You don't uniquify 1::1::[]
<mrvn> You don't uniquify 0::1::1::[]
<mrvn> i mean
<mellum> Oh. Yes.
<mrvn> you need to catch a::b::c a=b and a<>b
<mrvn> And then you have the three cases I had.
<mellum> let unique l =
<mellum> let l = List.fast_sort compare l in
<mellum> let rec loop l =
<mellum> match l with
<mellum> a::b::c when a = b -> loop (a :: c)
<mellum> | a::b -> a :: loop b
<mellum> | [] -> []
<mellum> in
<mellum> loop l;;
<mellum> this one works :)
<mrvn> only for small lists
<mellum> And it also works for empty lists :)
<mellum> But okay, I'll use the accu version
<mrvn> which doesn't work for empty lists
<mrvn> rewrite yours with an accu
skylan has joined #ocaml
Contra has quit ["using sirc version 2.211+KSIRC/1.2.4"]
<mellum> mrvn: Hmm, when I do that, I end up with your version... doesn't work without passing head around
<mrvn> let unique l =
<mrvn> let l = List.fast_sort compare l in
<mrvn> let rec loop l accu =
<mrvn> match l with
<mrvn> a::b::c when a = b -> loop (a :: c) accu
<mrvn> | a::b -> loop b (a::accu)
<mrvn> | [] -> List.rev accu
<mrvn> in
<mrvn> loop l;;
<mrvn> But its probably better to pass the head as argument instead of creating new lists all the time.
<mrvn> or does ocaml optimize that away?
<mellum> Dunno. That's probably shadowed by the time for sorting anyway.
mattam_ has joined #ocaml
<mrvn> Its intresting that all fields on a 4x4 board are equaly bad.
<mellum> really? one would have thought that edges suck slightly less.
<mrvn> no, edges are better at first. You loose less moves
<mrvn> But there are only 3 places you can set initially and whatever you choose later you have to take the two others.
<mellum> Oh well.
<mrvn> I still don#t have a mechanism that catches draws.
<mrvn> If I have a move where both sides play 4 stones and one where both sides play 8 and draw I choose the first.
<mrvn> But I think you can't get a draw on a halfway intresting board.
mattam has quit [Read error: 110 (Connection timed out)]
mrvn_ has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
chrisb has quit [Read error: 60 (Operation timed out)]
chrisb has joined #ocaml
mattam_ is now known as mattam
TachYon has joined #ocaml
TachYon has quit [Remote closed the connection]
musasabi has quit [calvino.freenode.net irc.freenode.net]
musasabi has joined #ocaml
systems has joined #ocaml
systems has left #ocaml []
foxen5 has joined #ocaml
<emu> does ocaml have a callcc facility?
<whee> no
<mellum> I think yes
<Riastradh> There was one implemented using fork().
<mellum> no?
<whee> nope
<mellum> Oh well. I always found callcc too confusing, anyway :)
<emu> geez
<emu> =)
foxen5 has quit [Read error: 104 (Connection reset by peer)]
asqui has quit ["Now I am gone..."]
TachYon has joined #ocaml
foxen5 has joined #ocaml
TachYon has quit ["Client Exiting"]