Re: A style question
- From: job-271842874@xxxxxxxxxxxxxx
- Date: Tue, 27 Feb 2007 23:01:02 -0500
Ken Tilton wrote:
job-271842874@xxxxxxxxxxxxxx wrote:Ken Tilton wrote:Paul Wallich wrote:job-271842874@xxxxxxxxxxxxxx wrote:Otherwise, I am bothered by the spec. Is the FizzBuzz on 15 tied to it factoring to 3 and 5 and those substitutions, or is that coincidental? ie, Could an RFE come thru for 15 to translate to Bang? Also, is this list expected to expand? If so, will the test always be even divisibility?A friend passed on an article regarding the difficulty job candidates had in producing even simple programs (simple as in should take a minute or less). One example was a program to print the numbers 1 to 100 except that "Fizz" should be substituted for numbers divisible by 3, "Buzz" should be substituted for numbers divisible by 5, and "FizzBuzz" should be substituted for numbers divisible by both 3 and 5.
Yes, the FizzBuzz on 15 is because the spec said to print FizzBuzz instead of i for any i that is divisible by both 3 and 5. Regarding enhancements,
Sorry, I threw in that translation to 15 myself. But the question still stands: could an RFE come along saying "if divisible by 3 and 5 print BANG"? Or was the spec trying (and failing to say): the translations are 3 this and five that, where multiple matches occur print all. Then my next question is: 45 is FizzFizzBuzz?
Gotcha. Well, I just posted a reply to Paul with a generalization of passing in a 2nd list parameter containing pairs of (integer, string) with the intent of concatenating the strings for all integers that evenly divide i.
So for the list '((2 "a")(3 "b")(5 "c")) we'd have
1
a
b
ac
5
ab
7
ac
b
a
11
abc
So, 45 would just be "FizzBuzz"
.
I have had managers lunge acroos the table to get at me.
kt
- Follow-Ups:
- Re: A style question
- From: job-271842874
- Re: A style question
- References:
- A style question
- From: job-271842874
- Re: A style question
- From: Paul Wallich
- Re: A style question
- From: Ken Tilton
- Re: A style question
- From: job-271842874
- Re: A style question
- From: Ken Tilton
- A style question
- Prev by Date: Re: A style question
- Next by Date: Re: A style question
- Previous by thread: Re: A style question
- Next by thread: Re: A style question
- Index(es):
Relevant Pages
|