Friday, October 05, 2007

Programming Balls

Over at the Devils Kitchen ( A right good Sweary Fest in case you didn't already know), The Devil had delivered his idea of the best Quote of the Day from the Tory Conference via Caroline Hunt

Quote of the Day from Dizzy.

"Sometimes I have to adjust my balls because they hang to the left and I worry they might be ideologically unsound."

But being Dizzy, he doesn't have to do it himself, he has written a script to do it; it'll be something like this, I imagine.

  1. IF {balls}=[align: left] GOTO 3 ELSE GOTO 2

  2. IF TIME ELAPSED=30 GOTO 1

  3. MOVE {right_hand} TO {balls} GOTO 4

  4. CUP {balls} WITH {right_hand} GOTO 5

  5. MOVE {balls} + SHIFT {right_leg [surrepticiously]} GOTO 6

  6. LOCK {balls}=[align: right] GOTO 7

  7. SOUND={"GRUNT" [contentedly]} GOTO 8

  8. IF TIME ELAPSED=30 GOTO 1
There then follows a number of examples of Ball Programming in a number of languages until my attempt as follows:

Meanwhile, self-confessed "old-timer" Fitaloon decided that what was really needed was a Cobol programme.
IDENTIFICATION DIVISION.
PROGRAM-ID. ConservativeBalls.
AUTHOR. Fitaloon

DATA DIVISION.
WORKING-STORAGE SECTION.
01 BallsPosition.
03 BallSide PIC X(5).
88 Balls-correct value "Right".
88 Balls-Incorrect Value "Left"
01 Ballstoright
03 Ballsright pic x(5) value "Right".


PROCEDURE DIVISION.
Begin.
DISPLAY "Enter Balls Position Left or Right".
ACCEPT BallsPosition.
If Balls-incorrect
move Ballstoright to Ballsposition.
Display "Balls in correct Position".
STOP RUN.

Ah, geek humour...
First Cobol programme I have attempted in some years (too many to remember).

I have a feeling my older attempts may have been rather better as they kept me gainfully employed for about 15 years.

The Devil's Kitchen: Tory Conference Quote To End All Quotes

1 comment:

Caroline Hunt said...

I don't think Dizzy's testicles have ever got this much attention before. Hope it hasn't given him a big head.