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
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
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
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
s
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 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, " ");
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'.
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
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
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
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!
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
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 wha
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
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);
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);
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"
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 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
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
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 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,
float
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, 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
s
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 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/
.
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 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
I would like to show D in "action" to other programmers/students.
Anyone knows of a Video Game coded in D2 ?
Thank you
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 compilati
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
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 compilati
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
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
But I imagine is either a rookie mistake or a bug, what I'm
curious about is the foreach loop.
I'm wondering in
Hi guys I'm trying out Mono-D with Monodevelop 4.2 and the
compiler seems to build ok but the debugger says Error 1.
Here is the sample Hello world code
--
import std.stdio;
void main()
{
writeln("Hello World!");
}
37 matches
Mail list logo