Re: Programming to Beat the Odds in Gaming
- From: pete <pfiland@xxxxxxxxxxxxxx>
- Date: Tue, 13 May 2008 07:39:56 -0400
Richard Heathfield wrote:
Greg Herlihy said:
On May 4, 6:18 pm, Ian Collins <ian-n...@xxxxxxxxxxx> wrote:gcc -Wall -pedantic -ansi basic.c script.c -lmThese warnings are bogus.
basic.c: In function 'dofor':
basic.c:870: warning: suggest parentheses around && within ||
basic.c:873: warning: suggest parentheses around assignment used as
truth value
basic.c: In function 'getdimvar':
basic.c:1932: warning: suggest parentheses around assignment used as
truth value
Without looking anything up, please parenthesise this line in such a way as not to change its meaning:
if(stepval < 0 && initval < toval || stepval > 0 && initval > toval)
After you've done that, you can look stuff up to see whether you got it right. If you did get it right, award yourself a pat on the back, and consider the fact that not every C programmer is sufficiently skilled to follow the above expression properly.
When I see code constructs that I'm not familiar with,
I look them up and in so doing, I learn the language better.
I have no philosophical problems
with code that I write putting anybody else through that.
--
pete
.
- Follow-Ups:
- Re: Programming to Beat the Odds in Gaming
- From: Malcolm McLean
- Re: Programming to Beat the Odds in Gaming
- References:
- Re: Programming to Beat the Odds in Gaming
- From: Richard Heathfield
- Re: Programming to Beat the Odds in Gaming
- From: Rickey
- Re: Programming to Beat the Odds in Gaming
- From: Richard Heathfield
- Re: Programming to Beat the Odds in Gaming
- From: Rickey
- Re: Programming to Beat the Odds in Gaming
- From: Ben Bacarisse
- Re: Programming to Beat the Odds in Gaming
- From: Malcolm McLean
- Re: Programming to Beat the Odds in Gaming
- From: Ben Bacarisse
- Re: Programming to Beat the Odds in Gaming
- From: Malcolm McLean
- Re: Programming to Beat the Odds in Gaming
- From: Richard Heathfield
- Re: Programming to Beat the Odds in Gaming
- From: Bartc
- Re: Programming to Beat the Odds in Gaming
- From: Ian Collins
- Re: Programming to Beat the Odds in Gaming
- From: Richard Heathfield
- Re: Programming to Beat the Odds in Gaming
- From: Ian Collins
- Re: Programming to Beat the Odds in Gaming
- From: Greg Herlihy
- Re: Programming to Beat the Odds in Gaming
- From: Richard Heathfield
- Re: Programming to Beat the Odds in Gaming
- Prev by Date: Re: spinoza programming language status report (or, disruptive technology is always late)
- Next by Date: Linear Programming Simplex Method
- Previous by thread: Re: Programming to Beat the Odds in Gaming
- Next by thread: Re: Programming to Beat the Odds in Gaming
- Index(es):
Relevant Pages
|