A Conversation for H2G2 Waterworks & Beach

Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 261

Bluebottle

Well, I *don't* want a smiley - donut that's been in someone else's mouth! smiley - yuk

<BB<


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 262

typolifi

It's °not° mouth, it's pocket.
It's °not° mould, it's sand.

It's...

Oh! all right...

Then a brand new smiley - choc supreme smiley - donut for me, please


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 263

J'au-æmne

*hands over chocolate supreme, wondering how slow one computer can be*


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 264

Bluebottle

You haven't owned a ZX80, have you? smiley - winkeye

<BB<


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 265

J'au-æmne

No...


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 266

Bluebottle

Thought not smiley - winkeye

<BB<


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 267

MaW

You should try writing recursive routines to solve maths problems on a programmable calculator. Now _that's_ slow...


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 268

J'au-æmne

You should try programming tetris into a graphical calculator. i got bored


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 269

MaW

Nope, can't say I've tried that one...

Does anyone have any idea how I can write a Haskell function to generate lists of lists of Bool values so that they represent every possible combination of True and False for a given number of variables? For example, for two it would be

[[False,False],[False,True],[True,False],[True,True]]

I can't get it to work! My best effort so far produced

[[False,False],[False,True],[False,True],[True,True]]

Which is clearly not acceptable, especially as it will form part of a tautology checker. Help!


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 270

Bluebottle

Urm, I'm afraid I can't...
...I can hand you a smiley - donut, though...

<BB<


Mt Sandcastle's Not Like In Good Ol Times Doughnut Stall

Post 271

typolifi

Ohum! And where did you get the donut, Blueb?


Mt Sandcastle's Not Like In Good Ole Times Doughnut Stall

Post 272

Bluebottle

From the doughnut counter smiley - winkeye


Mt Sandcastle's Sparklin' Doughnut Stall

Post 273

typolifi

Because if you don't produce some of your own and if you didn't steal it from Joanna's ..herm... donut producing machine, then it means it's a SECOND HAND donut!

Aha!


Besides, Happy Birthday h2g2!!! smiley - bubbly
smiley - holly

smiley - choc

smiley - donut


Mt Sandcastle's Sparklin' Doughnut Stall

Post 274

Bluebottle

I didn't steal it from the counter, I assumed that the SSS was up, so I helped myself.
Which I can do as Joanna leases the stall from me smiley - winkeye
So it isn't a second-hand smiley - donut, it's a new one on display.

<BB<


Mt Sandcastle's Sparklin' Doughnut Stall

Post 275

J'au-æmne

BB can help himself to lectures as and when he likes...smiley - smiley If it weren't for him the stall wouldn't be here....smiley - winkeye



Tommorrow, as well as being h2g2's birthday is HildBede College day and Andy's and my 6 month anniversary...smiley - bigeyes


Mt Sandcastle's Sparklin' Doughnut Stall

Post 276

Bluebottle

Can I have a lecture now smiley - winkeye

<BB<


Mt Sandcastle's Sparklin' Doughnut Stall

Post 277

typolifi

Waaw great!
And on sunday it's the birthday of my little brother!
Let's have a cinnamon doughnut then!


Mt Sandcastle's Sparklin' Doughnut Stall

Post 278

MaW

Woo! What a day. Remember last year's birthday meet Joanna? I have some photos somewhere of you making big bubbles in Hyde Park smiley - smiley

I got that pesky Haskell function working. For a while, I thought the problem might be that I was using [] as the base case instead of [[]] but that turned out not to be so. So instead I looked at it again and after some fairly unsubtle hints dropped by the lecturer I came up with these three functions:

addfalse :: [Bool] -> [Bool]
addfalse xs = False : xs

addtrue :: [Bool] -> [Bool]
addtrue xs = True : xs

bools :: Int -> [[Bool]]
bools 1 = [[False],[True]]
bools (n+1) = (map addfalse (bools n)) ++ (map addtrue (bools n))

Which are perfect! I suppose I could make addtrue and addfalse into one function that takes an extra parameter, but there's not really any need to... Now I have to write a function to pick out a value associated with a particular key in a list of key/value pairs like this:

[('A',True),('B',False)]

So far everything I've tried has given me type errors, but I'm working on it...

* takes smiley - choc supreme *


Mt Sandcastle's Sparklin' Doughnut Stall

Post 279

typolifi

What do you intend to do with this, Maw?

*typolifi notice he didn't receive his cinnamon doughnut*
*he imagines he's got one*
*or rather, he imagines he's got a h2g2 (i.e. virtual) one*


*he eats the imaginary virtual doughnut*

Besides, thanks for the GuidePost! I use very often. (as a matter of fact I would be ridiculous if I revealed how often I use it).


Mt Sandcastle's Sparklin' Doughnut Stall

Post 280

MaW

It's worth 15% of my Functional Programming module, that's why I'm doing it.

You like GuidePost? Great! It will be improved, I promise. I'm trying to work out how to do syntax highlighting, but it's not going all that well at the moment. I'm wondering if I can use some sort of finite or pushdown automaton to recognise the tags, attributes and so on... probably can!


Key: Complain about this post