On Tue, Jan 07, 2014 at 09:38:34PM +, Binarydepth wrote:
>
> >or ... for(count=1;count>0 && count<100 || count>999 &&
> >count<1 || etc...; count++ )
>
> That won't work. It's better separate foreach loops.
Y'know, this code snippet really reminds me of why Jackson Structured
Progra
or ... for(count=1;count>0 && count<100 || count>999 &&
count<1 || etc...; count++ )
That won't work. It's better separate foreach loops.
On Thursday, 28 November 2013 at 23:45:26 UTC, H. S. Teoh wrote:
On Fri, Nov 29, 2013 at 12:36:18AM +0100, Binarydepth wrote:
Hi guys I'm having some problems. Calculations are not working
as
expected and I get segmentation fault. I used the 2.059
version and
it runs after compilation on compi
On Friday, 29 November 2013 at 00:41:16 UTC, bearophile wrote:
H. S. Teoh:
Modifying the loop variable of a foreach is, in general, a
risky move.
Right. In my opinion D programmers should learn that this is
the preferred idiom of using foreach ranged loops:
foreach (immutable i; 0 .. n) {}
foreach (immutable t; 1 .. 51)
{
int temp = (((t * 20) + 420) * 5) + 3;
arr[t - 1] = temp - a;
temp = (((t * 5) + 50) * 20) + 1013;
arr[t] = temp - a;
}
Good work with the parenthesis. :)
On Friday, 29 November 2013 at 09:15:28 UTC, Joseph Rushton
Wakeling wrote:
On 29/11/13 00:36, Binarydepth wrote:
I'm wondering in the case of manipulating the variable from
the foreach loop, Do
I have to reset that variable so the loop can work as intended
?(chronologically).
I think that yo
On 29/11/13 00:36, Binarydepth wrote:
I'm wondering in the case of manipulating the variable from the foreach loop, Do
I have to reset that variable so the loop can work as intended
?(chronologically).
I think that you are approaching this problem in the wrong way. Instead of
using a tempora
H. S. Teoh:
Modifying the loop variable of a foreach is, in general, a
risky move.
Right. In my opinion D programmers should learn that this is the
preferred idiom of using foreach ranged loops:
foreach (immutable i; 0 .. n) {}
If a D programmers really needs to modify the index inside the
On Thursday, 28 November 2013 at 23:45:26 UTC, H. S. Teoh wrote:
On Fri, Nov 29, 2013 at 12:36:18AM +0100, Binarydepth wrote:
Hi guys I'm having some problems. Calculations are not working
as
expected and I get segmentation fault. I used the 2.059
version and
it runs after compilation on compi
I fixed a formatting problem on the code just now. And also a
note is that the numbers are supposed to display a number
depending on the initial value of the variable that the foreach
loop is increasing and the users age.
So if you were born in 1977 you input your birth year to the
program an
On Fri, Nov 29, 2013 at 12:36:18AM +0100, Binarydepth wrote:
> Hi guys I'm having some problems. Calculations are not working as
> expected and I get segmentation fault. I used the 2.059 version and
> it runs after compilation on compileonline.com
[...]
> foreach(t; 1..51)
> {
> temp=t;
>
11 matches
Mail list logo