On Thursday, 16 September 2021 at 20:49:28 UTC, seany wrote:
I compile with : `dub build -b release --compiler=ldc2`
The result executing the compiled binary 'myproj' is is (
whether `writeln (a[1])` is uncommented, or the `test()`
function is uncommented) some random number, usually negativ
On Thursday, 16 September 2021 at 20:49:28 UTC, seany wrote:
I create a new project with : `dub init myproj`.
Then I change the source/app.d file with this :
[...]
PS :compiling with : `dub build -b release ` ( i.e. no ldc2) is a
direct segfault of the code posted above.
PPS : my system is
I create a new project with : `dub init myproj`.
Then I change the source/app.d file with this :
`
import std.stdio;
import std.math;
import std.stdio;
import std.conv;
import std.format;
import std.math;
import std.algorithm;
On Sunday, 11 April 2021 at 19:48:42 UTC, Ruby The Roobster wrote:
On Sunday, 11 April 2021 at 19:45:30 UTC, Ruby The Roobster
wrote:
What am I doing wrong here? Is it the 'for' loop?
Nevermind. I messed up what line it was. It was actually this
line:
```d
square[i][j] = new Square(Color.non
On Monday, 12 April 2021 at 19:19:12 UTC, kdevel wrote:
On Monday, 12 April 2021 at 18:13:38 UTC, Imperatorn wrote:
[...]
[...]
D can be so much fun!
```d
import std.stdio;
[...]
Of course :D
On Monday, 12 April 2021 at 18:13:38 UTC, Imperatorn wrote:
[...]
Yup
D can be so much fun!
```d
import std.stdio;
enum Color {none = " n ", red = " r ", black = " b "};
enum sColor {black= " b ", white= " w "};
class Square {
public:
this(Color color, sColor Scolor) {
this.color
On Monday, 12 April 2021 at 18:01:02 UTC, kdevel wrote:
On Sunday, 11 April 2021 at 20:41:35 UTC, Bastiaan Veelo wrote:
[...]
[...]
Yes, there is a `7` where there should be an `i` on this line:
```d
for(int i=7;7>=0;i--)
```
This will go on forever, so you get a range error as soon as
On Sunday, 11 April 2021 at 20:41:35 UTC, Bastiaan Veelo wrote:
[...]
What am I doing wrong here? Is it the 'for' loop?
Yes, there is a `7` where there should be an `i` on this line:
```d
for(int i=7;7>=0;i--)
```
This will go on forever, so you get a range error as so
this line:
```d
for(int i=7;7>=0;i--)
```
This will go on forever, so you get a range error as soon as
`i < 0`.
...
I fixed the code now. It works. Thanks for your help.
is will go on forever, so you get a range error as soon as `i
< 0`.
—Bastiaan.
I have fixed this.
so you get a range error as soon as `i < 0`.
Also this code is wrong:
```d
for(int i=2;i>=0;i--)
{
for(int j=7;i>=0;j--)
```
For that j loop, i will always be 2, so it will not terminate until the
range error happens.
Should probably be:
for(int j=7; j >= 0; j--)
On Sunday, 11 April 2021 at 19:45:30 UTC, Ruby The Roobster wrote:
What am I doing wrong here? Is it the 'for' loop?
Yes, there is a `7` where there should be an `i` on this line:
```d
for(int i=7;7>=0;i--)
```
This will go on forever, so you get a range error as so
On Sunday, 11 April 2021 at 19:45:30 UTC, Ruby The Roobster wrote:
What am I doing wrong here? Is it the 'for' loop?
Nevermind. I messed up what line it was. It was actually this
line:
```d
square[i][j] = new Square(Color.none, sColor.white);
```
So, here is the full code:
```d
enum Color {none=0,red=1,black=2};
enum sColor {black=0,white=1};
class Square {
public:
this(Color color, sColor Scolor) {
this.color = color;
this.Scolor = Scolor;
}
Color color;
sColor Scolor;
}
import std.stdio;
void cPrintboard(Square[8
On Sunday, 17 September 2017 at 11:42:16 UTC, kerdemdemir wrote:
Hi,
Thanks its price dropped to 10 Euros I bought the the D Web
Development book and I were trying to build some examples.
The example in Chapter3 called noteapp4 is giving me this error
:
[...]
Optlink bug I guess?
try usin
.
Linking...
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-2013 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
.dub\build\application-debug-windows-x86-dmd_2075-102ED5AC10E8F023CF2D8D690787ADD9\noteapp4.obj(noteapp4)
Offset 23F7EH Record Type 009D
E
16 matches
Mail list logo