Birthday code
Nov. 23rd, 2007 11:13 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
This is what I was doing last night that kept my hands too busy to blog:

It's a birthday card for my office-mate, who was giving a talk today celebrating 40 years of programming. I'd been thinking of making a cake along these lines, but I ended up not really having time (and somebody else was planning to buy cake anyway, and I rationalised the running-out-of-time with the realisation that it would be setting a dangerous precedent if I started doing cakes for colleagues' birthdays).
Originally I wanted the punched card to represent the code for (e.g.) "print 'Happy birthday'", but I couldn't work out how to convert code to card-punches, and couldn't source the knowledge from within my social circle. One person I asked did offer the following code:
BEGIN
FILE F (KIND=REMOTE);
EBCDIC ARRAY E [0:11];
REPLACE E BY "HAPPY BIRTHDAY!";
WHILE TRUE DO
BEGIN
WRITE (F, *, E);
END;
END.
Which looked familiar from wikipedia (where I got the punched card design, too). It also looked wrong (the length of the array was still set for "HELLO WORLD", not "HAPPY BIRTHDAY"). So I corrected that and included it inside the card, and made the hole 'punches' (cut by hand with a craft-knife) purely decorative, spelling out "HAPPY BIRTHDAY". Hence not being able to do a 'B' (I got into what I thought was an irrecoverable mess with the shape/size of the letters, but sorted it out in the end).
Do you know how many numbers you have to write to produce an 80-column punched card? And how many holes you have to cut out to make it say 'happy birthday'?
But he was absolutely delighted, and that made it all worthwhile.

It's a birthday card for my office-mate, who was giving a talk today celebrating 40 years of programming. I'd been thinking of making a cake along these lines, but I ended up not really having time (and somebody else was planning to buy cake anyway, and I rationalised the running-out-of-time with the realisation that it would be setting a dangerous precedent if I started doing cakes for colleagues' birthdays).
Originally I wanted the punched card to represent the code for (e.g.) "print 'Happy birthday'", but I couldn't work out how to convert code to card-punches, and couldn't source the knowledge from within my social circle. One person I asked did offer the following code:
BEGIN
FILE F (KIND=REMOTE);
EBCDIC ARRAY E [0:11];
REPLACE E BY "HAPPY BIRTHDAY!";
WHILE TRUE DO
BEGIN
WRITE (F, *, E);
END;
END.
Which looked familiar from wikipedia (where I got the punched card design, too). It also looked wrong (the length of the array was still set for "HELLO WORLD", not "HAPPY BIRTHDAY"). So I corrected that and included it inside the card, and made the hole 'punches' (cut by hand with a craft-knife) purely decorative, spelling out "HAPPY BIRTHDAY". Hence not being able to do a 'B' (I got into what I thought was an irrecoverable mess with the shape/size of the letters, but sorted it out in the end).
Do you know how many numbers you have to write to produce an 80-column punched card? And how many holes you have to cut out to make it say 'happy birthday'?
But he was absolutely delighted, and that made it all worthwhile.
no subject
Date: 2007-11-24 12:31 am (UTC)In case you ever do it again (http://www.cs.uiowa.edu/~jones/cards/codes.html)
no subject
Date: 2007-11-24 02:45 am (UTC)no subject
Date: 2007-11-24 06:13 am (UTC)I don't need them for roaches anymore, coz I'm like all pure now innit.
With more warning, I'd have found a punch and done it for you. There's a manual one somewhere at our place, still - it was in my group's Black Museum about a decade ago, and I'm sure somebody's kept it.
no subject
Date: 2007-11-24 09:50 am (UTC)