Re: [PHP] Help converting C to PHP

2006-09-23 Thread Richard Lynch
On Fri, September 22, 2006 7:40 pm, Rory Browne wrote: Fair enough. Prime Number Script Competition ( for Bragging Rights ). I challenge the readers of this list to produce the necessary code to find the lowest prime number higher than a certain inputted number. The script must be web

Re: [PHP] Help converting C to PHP

2006-09-23 Thread Rory Browne
Whoops - sorry replied directly to Richard instead of to the list. Submission process is simply to post to the list. It's probably a good idea ( and acceptable ) to just post an SHA1(MD5 for this purpose is compromised) hash of your code before the deadline, and submit your actual code shortly

RE: [PHP] Help converting C to PHP

2006-09-22 Thread Jay Blanchard
[snip] Codegolf... heh.. nice little twist. [/snip] At least we weren't asked to help someone write his homework. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Rory Browne
On 9/22/06, Kevin Waterson [EMAIL PROTECTED] wrote: This one time, at band camp, Curt Zirzow [EMAIL PROTECTED] wrote: what about using: php.net/pi note the precision description. or are we talking about a different pi. The goal of the codegolf.com challenge is to print pi to 1000

Re: [PHP] Help converting C to PHP

2006-09-22 Thread tedd
At 2:38 PM +0200 9/22/06, Rory Browne wrote: On 9/22/06, Kevin Waterson [EMAIL PROTECTED] wrote: The goal of the codegolf.com challenge is to print pi to 1000 places. The programmer to do it in the least keystrokes is the winner. I personally don't think this is a very healthy contest. It

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Martin Alterisio
2006/9/22, Rory Browne [EMAIL PROTECTED]: On 9/22/06, Kevin Waterson [EMAIL PROTECTED] wrote: This one time, at band camp, Curt Zirzow [EMAIL PROTECTED] wrote: what about using: php.net/pi note the precision description. or are we talking about a different pi. The goal of the

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Tom Atkinson
Martin Alterisio wrote: 2006/9/22, Rory Browne [EMAIL PROTECTED]: On 9/22/06, Kevin Waterson [EMAIL PROTECTED] wrote: This one time, at band camp, Curt Zirzow [EMAIL PROTECTED] wrote: what about using: php.net/pi note the precision description. or are we talking about a

Re: [PHP] Help converting C to PHP

2006-09-22 Thread php
Hello all, I personally don't think this is a very healthy contest. It discourages comments, and use of whitespace to make code readable. Anyway... as you say, it would be nice to have a contest that rewards readability and maintainability... but, how can we messure that qualities in this

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Martin Alterisio
2006/9/22, Tom Atkinson [EMAIL PROTECTED]: Martin Alterisio wrote: 2006/9/22, Rory Browne [EMAIL PROTECTED]: On 9/22/06, Kevin Waterson [EMAIL PROTECTED] wrote: This one time, at band camp, Curt Zirzow [EMAIL PROTECTED] wrote: what about using: php.net/pi note the

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Richard Lynch
On Thu, September 21, 2006 9:32 pm, Curt Zirzow wrote: On 9/21/06, Tom Atkinson [EMAIL PROTECTED] wrote: Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. long k=4e3,p,a[337],q,t=1e3; main(j){for(;a[j=q=0]+=2,--k;)

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Richard Lynch
On Fri, September 22, 2006 11:59 am, Martin Alterisio wrote: Anyway... as you say, it would be nice to have a contest that rewards readability and maintainability... but, how can we messure that qualities in this type of games? If you think of the Open Market of software out there as the game

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Rory Browne
That aside, I think that it would be very beneficial to the community as a whole if a contest was started that encouraged readability and good practices. The scoring and judging could be done by a panel, but I think that it would be more fun if the community itself was able to vote on various

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Richard Lynch
On Fri, September 22, 2006 7:40 pm, Rory Browne wrote: The script must be web based, and ask the user to enter a number. The script must then calculate the lowest Prime Number above that number. I would like to have one point clarified: By above that number do you literally mean or would =

[PHP] Help converting C to PHP

2006-09-21 Thread Tom Atkinson
Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. long k=4e3,p,a[337],q,t=1e3; main(j){for(;a[j=q=0]+=2,--k;) for(p=1+2*k;j337;q=a[j]*k+q%p*t,a[j++]=q/p) k!=j2?:printf(%.3d,a[j-2]%t+q/p/t);} I converted this to a more

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Kevin Waterson
This one time, at band camp, Tom Atkinson [EMAIL PROTECTED] wrote: Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. is this for codegolf? Kevin -- Democracy is two wolves and a lamb voting on what to have for lunch. Liberty

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Tom Atkinson
Yes, it is. Kevin Waterson wrote: This one time, at band camp, Tom Atkinson [EMAIL PROTECTED] wrote: Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. is this for codegolf? Kevin -- PHP General Mailing List

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Curt Zirzow
On 9/21/06, Kevin Waterson [EMAIL PROTECTED] wrote: This one time, at band camp, Tom Atkinson [EMAIL PROTECTED] wrote: heh.. nice little twist. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Curt Zirzow
On 9/21/06, Tom Atkinson [EMAIL PROTECTED] wrote: Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. long k=4e3,p,a[337],q,t=1e3; main(j){for(;a[j=q=0]+=2,--k;) for(p=1+2*k;j337;q=a[j]*k+q%p*t,a[j++]=q/p)

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Kevin Waterson
This one time, at band camp, Curt Zirzow [EMAIL PROTECTED] wrote: what about using: php.net/pi note the precision description. or are we talking about a different pi. The goal of the codegolf.com challenge is to print pi to 1000 places. The programmer to do it in the least keystrokes

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Tom Atkinson
pi() does not give me enough decimal places, I need the first 1000. Curt Zirzow wrote: On 9/21/06, Tom Atkinson [EMAIL PROTECTED] wrote: Hello, I am attempting to convert this code for generating the digits of pi from the original C (below) to PHP. long k=4e3,p,a[337],q,t=1e3;

Re: [PHP] Help converting C to PHP

2006-09-21 Thread Christopher Watson
Definitely looks like a grouping and/or precedence problem. Wish I had more time to examine it. Fine-tooth those parens again. -Christopher -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php