#CarolsInCode is a programming meme with a seasonal twist. Short programs are used to encode the lyrics of a Christmas carol. Some display the lyrics when the program runs while the more ingenious examples define the song with the program's control structures.
For example in JavaScript:
while ( shepherds.watch() == 'flocks' && date.getHours() in night ) { lord.angel--; glory.shone_around(); }
This is While Shepherds Watched Their Flocks by Nahum Tate:
“While Shepherds watch their flocks by night,
All seated on the ground,
The angel of the Lord came down,
And glory shone around.”
Here's the top five countdown of the very best #CarolsInCode. Can you identify all five? Is your favourite missing?
GrumpyWookie:
Weather.Outside="frightful"; Fire.Delightful=true; Lights.Luminosity=WayDownLow; for (int i=1; i<=3; i++) { LetItSnow(); }
ShinyEmptyHead:
public Sleigh sleigh; public void dashThroughSnow() { int horses = 1; sleigh = new Sleigh(horses); for (Field field : fields) { laugh(); } }
JohnGirvin:
var wenceslas = new Person({ rank: 'king', alignment: 'good' }); $.bind(FeastOfStephen, function() { wenceslas.lookOut(); });
Costall:
if (DateTime.Now()=="25/12/2010") { for (i=0;i<3;i++) Ship[i].Visibility = Visibility.Visible; }
GrumpyWookie:
Kiss.PersonA="Mummy"; Kiss.PersonB="Santa"; Kiss.Witness=Me; Kiss.Location=Mistletoe.Underneath; Kiss.Time=Date.LastNight;
More #CarolsInCode
- #carolsincode - Christmas for Programmers
- carols in code | wee doors banging
- Carols in Code, A Festive Twitter Meme
- #CarolsInCode search on Twitter