CODE
<?foreach(range(1,100)as$i)echo$i%15?$i%5?$i%3?$i:"Fizz":"Buzz":"FizzBuzz","\n";?>
I actually posted about it here (and included a couple of solutions my colleagues came up with)
This post has been edited by seraphiel: May 18 2007, 10:54 AM
Fizz Buzz, any languages
|
May 18 2007, 09:55 AM
Return to original view | Post
#1
|
Junior Member
33 posts Joined: Jul 2006 From: Petaling Jaya, Malaysia |
Well, since you specifically said interesting here's mine:
CODE <?foreach(range(1,100)as$i)echo$i%15?$i%5?$i%3?$i:"Fizz":"Buzz":"FizzBuzz","\n";?> I actually posted about it here (and included a couple of solutions my colleagues came up with) This post has been edited by seraphiel: May 18 2007, 10:54 AM |
|
May 18 2007, 09:33 PM
Return to original view | Post
#2
|
Junior Member
33 posts Joined: Jul 2006 From: Petaling Jaya, Malaysia |
I've been coding with error_reporting(E_ALL) too long to even attempt that, zybler
I would say that your solution is definitely not what I'd accept as the shortest simply because it throws a warning |
|
May 18 2007, 10:50 PM
Return to original view | Post
#3
|
Junior Member
33 posts Joined: Jul 2006 From: Petaling Jaya, Malaysia |
Well done
|
Change to: | 0.0132sec
0.29
6 queries
GZIP Disabled
Time is now: 29th March 2024 - 07:30 AM |