I've considering learning full D. I remembered that D is not
recommended as a first language, So I read time ago.
So my question, is learning C and Python a good intro before
learning D?
TY
I would like to show D in "action" to other programmers/students.
Anyone knows of a Video Game coded in D2 ?
Thank you
On Thursday, 19 June 2014 at 04:07:30 UTC, Jesse Phillips wrote:
On Wednesday, 18 June 2014 at 23:41:43 UTC, GoD wrote:
@Jesse
How to use in C# projects?
You'll have to access it through a COM interface on the C# side.
http://msdn.microsoft.com/en-us/library/aa645736%28v=vs.71%29.aspx
If yo
.
And maybe
this is not the best code to show to students ;-)
Also, license is ZLib -- I assume it will be good for your
purposes.
LMB
On Wed, Jun 25, 2014 at 11:24 AM, Binarydepth via
Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
I would like to show D in "
On Wednesday, 25 June 2014 at 16:37:13 UTC, Namespace wrote:
On Wednesday, 25 June 2014 at 14:24:11 UTC, Binarydepth wrote:
I would like to show D in "action" to other
programmers/students.
Anyone knows of a Video Game coded in D2 ?
Thank you
Here are two:
http://dgame-dev.de/?page=show
T
I want to import a module from my local project in C style
(#include "local.h").
I know I can do "dmd main.d local.d" but I wonder if it can be
done C style.
Thank you
BD
On Thursday, 25 June 2015 at 14:10:00 UTC, Steven Schveighoffer
wrote:
On 6/25/15 9:57 AM, Binarydepth wrote:
I want to import a module from my local project in C style
(#include
"local.h").
No.
I know I can do "dmd main.d local.d" but I wonder if it can be
done C
style.
What is your
This is my code :
import std.stdio : writeln, readf;
void main() {
int[3] nums;
float prom;
foreach(nem; 0..2) {
writeln("input a number : ");
readf(" %d", &nums[nem]);
prom+=nums[nem];
}
writeln(prom/
On Thursday, 9 July 2015 at 15:18:18 UTC, Adam D. Ruppe wrote:
On Thursday, 9 July 2015 at 15:14:43 UTC, Binarydepth wrote:
float prom;
You didn't initialize this variable. Set it to 0.0 and it will
work.
Like how pointers are initialized to null automatically in D,
floats are auto
How do we get dynamic memory in D ?
I want to use memory based on user input. In this case declare a
bi-dimensional array (int[2][var]), var being the user input.
On Friday, 24 July 2015 at 15:26:27 UTC, Adam D. Ruppe wrote:
On Friday, 24 July 2015 at 15:22:15 UTC, Binarydepth wrote:
I want to use memory based on user input. In this case declare
a bi-dimensional array (int[2][var]), var being the user input.
Declare:
int[2][] your_array;
your_array.le
On Friday, 24 July 2015 at 15:26:27 UTC, Adam D. Ruppe wrote:
On Friday, 24 July 2015 at 15:22:15 UTC, Binarydepth wrote:
I want to use memory based on user input. In this case declare
a bi-dimensional array (int[2][var]), var being the user input.
Declare:
int[2][] your_array;
your_array.le
Here is what I'm trying to do :
import std.stdio : readf, writef;
void main() {
int[2][] nam;
int num;
readf(" %d", &num);
nam.length = num;
foreach(nim; 0..num){
readf(" %d %d", &nam[0][num], &nam[1][num]);
}
foreach
On Tuesday, 28 July 2015 at 16:12:28 UTC, Adam D. Ruppe wrote:
On Tuesday, 28 July 2015 at 16:09:46 UTC, Binarydepth wrote:
readf(" %d %d", &nam[0][num], &nam[1][num]);
}
foreach(nim; 0..num){
writef(" %d %d\n", &nam[0][num], &nam[1][num]);
T
On Tuesday, 28 July 2015 at 16:24:39 UTC, anonymous wrote:
On Tuesday, 28 July 2015 at 16:09:46 UTC, Binarydepth wrote:
Here is what I'm trying to do :
import std.stdio : readf, writef;
void main() {
int[2][] nam;
int num;
readf(" %d", &num);
nam.length = num
On Tuesday, 28 July 2015 at 16:24:39 UTC, anonymous wrote:
On Tuesday, 28 July 2015 at 16:09:46 UTC, Binarydepth wrote:
Here is what I'm trying to do :
import std.stdio : readf, writef;
void main() {
int[2][] nam;
int num;
readf(" %d", &num);
nam.length = num
On Tuesday, 28 July 2015 at 16:53:35 UTC, anonymous wrote:
On Tuesday, 28 July 2015 at 16:41:40 UTC, Binarydepth wrote:
It works with 2 as input but shows error when number is 3 :(
I can't reproduce that or I misunderstood something:
$ cat a.d
import std.stdio : readf, writef;
void main()
On Tuesday, 28 July 2015 at 17:07:47 UTC, Steven Schveighoffer
wrote:
On 7/28/15 12:59 PM, Binarydepth wrote:
When indexing, it always goes out to in. So nam[0] is the first
element of type int[2], and nam[0][0] is the first integer in
that first element.
-Steve
I don't get what you mean
On Tuesday, 28 July 2015 at 17:34:46 UTC, Steven Schveighoffer
wrote:
On 7/28/15 1:26 PM, Binarydepth wrote:
On Tuesday, 28 July 2015 at 17:07:47 UTC, Steven Schveighoffer
wrote:
On 7/28/15 12:59 PM, Binarydepth wrote:
When indexing, it always goes out to in. So nam[0] is the
first
element o
On Wednesday, 29 July 2015 at 08:03:06 UTC, anonymous wrote:
int[2][] is exactly an dynamic array of (arrays with the length
2), the logic behind this notation is:
1. Array of 2 int -> int[2]
2. a dynamic array of 1. -> int[2][] (like SomeType[] is an
array of SomeType)
Thank you!
I'm writing a program that rotates numbers then asks the user if
a new set of numbers should be rotated. I'm having trouble using
a Foreach loop to fill a dynamic array with the elements to be
rotated.
Here's my code, I add a TAB when a loop is inside a loop and and
do that too to the stateme
Here's what happens :
How many elements need to be used? 5
Input the element : 1 1
Input the element : 1 2
Input the element : 1 3
Input the element : 1 4
Input the element : 1 5
How many positions do you wish to rotate ? 3
The original patter is : 5 0 0 0 0
The final is : 0 0 0 5 0
Do you want t
On Saturday, 8 August 2015 at 17:19:08 UTC, DarthCthulhu wrote:
You can fix it like the following:
foreach(num, element; liaOrig) {//Data input loop
writefln("num: %s current element: %s liaOrig.length: %s",
num, element, liaOrig.length);
write("In
On Saturday, 8 August 2015 at 18:24:48 UTC, Binarydepth wrote:
On Saturday, 8 August 2015 at 17:19:08 UTC, DarthCthulhu wrote:
Now 'num' is just an iterative number starting from 0 (the
.init value of an int), while the actual element value is
stored in 'element'. I added the writefln() stat
On Sunday, 9 August 2015 at 00:22:53 UTC, Jay Norwood wrote:
On Saturday, 8 August 2015 at 18:28:25 UTC, Binarydepth wrote:
This is the new code :
foreach(num; 0..liEle) {//Data input loop
write("Input the element : ", num+1, " ");
readf(" %d", &liaOrig
On Sunday, 9 August 2015 at 16:42:16 UTC, Jay Norwood wrote:
The i+3 initialization is just so you can see that v is the Arr
member (not the index) in the other loops.
import std.stdio : writeln;
void main() {
immutable a=5;
int[a] Arr;
foreach(i, ref v; Arr) {
On Thursday, 25 June 2015 at 14:10:00 UTC, Steven Schveighoffer
wrote:
On 6/25/15 9:57 AM, Binarydepth wrote:
I want to import a module from my local project in C style
(#include
"local.h").
No.
I know I can do "dmd main.d local.d" but I wonder if it can be
done C
style.
What is your
On Saturday, 11 July 2015 at 16:57:55 UTC, flamencofantasy wrote:
On Thursday, 9 July 2015 at 15:14:43 UTC, Binarydepth wrote:
This is my code :
import std.stdio : writeln, readf;
void main() {
int[3] nums;
float prom;
foreach(nem; 0..2) {
writeln
On Monday, 13 July 2015 at 14:29:57 UTC, Steven Schveighoffer
wrote:
On 7/11/15 12:57 PM, flamencofantasy wrote:
On Thursday, 9 July 2015 at 15:14:43 UTC, Binarydepth wrote:
This is my code :
import std.stdio : writeln, readf;
void main(){
int[3] nums;
float prom;
foreach(nem; 0
29 matches
Mail list logo