Posts

Showing posts from March, 2008

Prolog

As revision for my Prolog class test on Friday I wrote a small program that works as a (very) simple calculator. %A simple calculator %By D. Duncombe add([],0). add([H|Tail],Total) :- add(Tail,Total2), Total is Total2 + H. mult([],1). mult([H|Tail],Total) :- mult(Tail,Total2), Total is Total2 * H. It allows you to add or multiply lists of numbers, the lists can be any size and the numbers can be any size (exceeding the Windows' Calculator that limits you to 32 digits, naughty naughty). So if you need to multiply 17 numbers of over 100 digits, I'm your man.

Never one to pass up a challenge...

It's 3:44am. You know what that means? Yes, it's another barely coherant blog post from your truely. *cheers* Alright, settle down. A few days ago I was sitting in my A.I. lecture and Sirob Venok* (the only russian computer scientist in the world) was talking about search engines. Specifically he was talking about how it is impossible to negate things in engines such as Google. (You can't search for 'all pages without any "e"s in them; for example.) And as an example he said 'You cannot search for all animals that use radar except for Dolphins and Bats' (actually he said 'RAD-dar' but that's beside the point). I disagree Mr. Venok, I disagree with every fibre of my being! Let me just fire up the old Google Box... Right, well, for starters no animals use radar (except humans of course) so I'm guessing he meant echo-location. He also mentioned Barn Owls, so we'll rule them out. Let the searching begin! 'echo location in animals