The Coat Coding Competition
A past thread in uk.media.radio.radcliffe was on the phrase "I'll Get Me Coat", as heard from Mark Williams on the jolly little TV programme known as The Fast Show.
As it's such a great phrase, a few UKMRR 'residents' worked to convert the phrase to different computer languages.
Although it may sound as such, this is not a nerdy exercise. Rather, it's the triumphant efforts of a kind, generous group of people to stretch their creative and cerebral powers, linking the comedic dialogue of a television programme with the construction and analysis required in computer software.
I'll get... never mind.

Ye Index

Assembler Ben Bradshaw, Sept 4
C++ Ben Bradshaw, Sept 5
Cobol Martin Rodgers, Sept 4
Cold Fusion Paul Squires, Sept 9
Forth Martin Rodgers, Sept 4
Haskell Martin Rodgers, Sept 4
Perl Simon Greenwood, Sept 6
Prolog Martin Rodgers, Sept 11
Scheme Martin Rodgers, Sept 3
Spectrum Text Adventure Language Daniel Bolger, Sept 7


Assembler

0x0dea 3a       ... load coat into location register
0xef78 04       ... increment get register with location register
0x8da7 a0       ... shift contents of get register onto stack
0x34c3          ... crash computer by trying to overwrite the BIOS

C++

class items_of_clothing
{
   private:
        string colour;
        string taste;
        string price;
   public:
        items_of_clothing(string colour="red",
        string taste="OK",string price="cheap");
        ~items_of_clothing();
        get(string location="floor");
};

class coat : public items_of_clothing
{
   private:
        string warmth_factor;
   public:
        coat(string warmth_factor="snug");
        ~coat();
};

coat::coat(string this_colour,string this_taste,
           string this_price,string this_warmth_factor)
 : items_of_clothing(this_colour,this_taste,this_price),
   warmth_factor(this_warmth_factor) {}

main()
{
   coat parker("blue","none","very_cheap","very_warm");
   parker.get("coat_hook");
}

Cold Fusion

<cfquery="CoatGet" datasource="CoatRetrieval">
Select Coat from Coatstand
WHERE Coat_ID = !YOURCOAT! </cfquery>
<cfoutput query="IllGetMeCoat">
<pre>
Your coat !COATS.YOURCOAT! is available for collection.
</pre>
</cfoutput>

Cobol

GET COAT

Forth

: get-coat  fetch-coat wear-coat ;

Haskell

getCoat owner = fetchCoat owner >>= wearCoat

Perl

#!/usr/bin/perl
use embarrassment;
open(WARDROBE, "<coat");
/.*(mine)/ && do { wear; home; };
close WARDROBE;
.

Prolog (Getting & Checking)

?- assert(got(coat)).

yes
?- got(X).

X = coat

yes
?- got(coat).

yes
?-

Scheme

(define (get-coat owner)
  (wear-coat (fetch-coat owner)))

Spectrum Text Adventure Language

LOAD ""
(fuzz, and squeaking)
(sub-teletext standard title screen)

Welcome!
...You are in a room. To the west of the room is a bed and a chest of drawers. To the east of the room is a window. There is a door to the south, where you have just come in. There is a door to your north.
> go to north door
The door is wooden, and appears to be locked.
> get key
I can't see a key here!
> get key from drawers
I do not understand!!
> open drawer
You are not close enough!
> go to drawers
They are ornate in design. The top drawer is slightly open.
> look in drawer
There is an ornamental-looking key in the drawer.
> pick up key
Do not understand command "pick"
> get key
You now have the key.
> north
The door is wooden, and appears to be locked.
> open door
You need the key!
> open door with key
Do not understand command "with"
> put key in door
You can't do that!
> sflighlkjnvkajhwhpwdoifowij'ohif n.'wsi n,!
I do not understand!
> fuck off
Do not understand command "fuck"
> fuck off you fucking arse
Do not understand commands "fuck" "fucking" "arse" "you"
> use key on door
The door opens with a click. Inside is a pair of trousers that look like they belong to a wizened old man who needs them taken to him on the Misty Hill, and a coat. It is nondescript.
> get coat
************CONGRATULATIONS!!!!!************
You have completed the first task. Be sure to purchase next month's Your Sinclair for part two of "Clothing Quest 9 - journey into the tailors"
(computer crashes)

Oh, come on, I must at least get a prize for *trying*...