School of Science & Engineering

» Current Students | » Faculty & Staff | » Future Students | » Parents | » Alumni, Donors & Visitors | » Athletics | » Employment | » Give Today!

Computer Science

Computer Science Story

Pizza Party And More

04/08/2009

The Computer Science Department held a pizza party recently for its students to celebrate reaching the mid-term point.  it was so successful we did it again a few weeks later. The first party saw us going through 7 pies and we made it to 10 for the second party.  Would that some day we could need 20!

At the first party the following programming problem (a modified version of the Google Code Challenge) was posed

A Pizza of radius r is made with tomato sauce and cheese. The cheese laid down in long strips of width g. The crust of the pizza pie has width t.

A fly, in fact a blue-fly, lands randomly on the pie. The fly  is represented as a circle of

diameter f. What is the probability that the fly will land 100% on tomato sauce with no

part of the fly touching either cheese or crust?

The cheese strips are perpendicular to one another and the two middle strips cross at

the center of the pie. The distance between any two parallel cheese strips is also g.

Write the program to solve the problem in a language you have not used before.

We had a good turn out for the first party but so far the only program subbmission came from someone not at the party.

The second party, held two weeks later, also had a programming challenge. This time the students were  asked to explain the following one-line C program. It comes from the International Obfuscated C Code Contest

Obfuscate: tr.v. -cated, -cating, -cates. 1. a. To render obscure.
b. To darken. 2. To confuse: his emotions obfuscated his judgment.
[LLat. obfuscare, to darken : ob(intensive) + Lat. fuscare,
to darken < fuscus, dark.] -obfuscation n. obfuscatory adj

main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return*t-42?*s?63==*t|*s==*t&&m(s+1,t+1):!*t:m(s,t+1)||*s&&m(s+1,t);}

While catching a quick lunch  three students managed to figure the program out and got themselves a free book as a prize.

» Previous Computer Science Stories