I'm playing around with associative arrays right now and I can't
seem to figure out how to add additional objects to the array. I
tried insert but it doesn't recognize both arguments.
Also, if I do this it produces an error:
Node[bool] test;
Node node;
Node[bool] temp = [ false:node ];
test
Ok, thanks for the help, much appreciated.
On Wednesday, 4 April 2012 at 19:57:40 UTC, ixid wrote:
Oops, the comment should read as follows, and test[bool] should
not be on the next line.
//Conceptually maybe clearer as Node[] test[bool]
I'm still messing around with binary heaps. I've successfully
created and used it on the function level but for some reason
when I move it to the class level I get an error. Furthermore,
i'm not entirely sure how to use a binary heap without auto as
the type.
class AStar
{
ReferenceNode[]
at 11:28:06 UTC, Timon Gehr wrote:
On 04/03/2012 05:17 AM, Chris Pons wrote:
I'm still having troubles with the min-heap.
Node[] a;
auto b = BinaryHeap!a.fScore b.fScore( a[] );
Error 1 Error: template instance BinaryHeap!(a.fScore
b.fScore) BinaryHeap!(a.fScore b.fScore) does not match
template
Thanks! This clears up that part very well. I'm a lot closer to
having a decent path finding algorithm now.
On Tuesday, 3 April 2012 at 21:24:24 UTC, Chris Cain wrote:
On Tuesday, 3 April 2012 at 19:38:12 UTC, Chris Pons wrote:
Thanks, yes, that did work. However now when trying to insert
( 42 );
The first method didn't give an error it just didn't update the
list as I thought. Any idea?
On Monday, 2 April 2012 at 06:07:40 UTC, Ali Çehreli wrote:
On 04/01/2012 10:45 PM, Chris Pons wrote:
I'm trying to add an element to a list with insert but that
doesn't seem
to do anything at all
Ah, thank you. I didn't realize taht SList is a struct and that
it used value semantics. That clears this up.
On Monday, 2 April 2012 at 14:22:25 UTC, Ali Çehreli wrote:
On 04/01/2012 11:18 PM, Chris Pons wrote:
Thanks. I tried doing this and the list didn't update:
void AddToList( SList
I'm trying to find the length of a Slist. I've tried using the
built in .length function but it generates this error: Error: no
property 'length' for type 'SList!(Node)'. Are there any other
built in ways to find the length?
I'm trying to work with and implement and priority queue(
min-heap ) and a hash table. This is the first time I've worked
with these data structures so I looked up some information about
them to gain an understanding.
From what I read, a min-heap is a binary tree that is sorted by a
Yes, I did see that. How would I set the predicate to sort by
fScore? An integer in my struct.
On Monday, 2 April 2012 at 22:53:55 UTC, Justin Whear wrote:
On Tue, 03 Apr 2012 00:47:56 +0200, Chris Pons wrote:
I'm trying to work with and implement and priority queue(
min-heap ) and
a hash
On Monday, 2 April 2012 at 23:30:38 UTC, Justin Whear wrote:
On Tue, 03 Apr 2012 01:06:54 +0200, Chris Pons wrote:
Yes, I did see that. How would I set the predicate to sort by
fScore? An
integer in my struct.
auto myHeap = BinaryHeap!`a.fScore b.fScore`( rangeOfNodes );
Ok, makes sense
I'm still having troubles with the min-heap.
Node[] a;
auto b = BinaryHeap!a.fScore b.fScore( a[] );
Error 1 Error: template instance BinaryHeap!(a.fScore
b.fScore) BinaryHeap!(a.fScore b.fScore) does not match
template declaration BinaryHeap(Store,alias less = a b) if
I'm trying to add an element to a list with insert but that
doesn't seem to do anything at all. If I try using ~= it says
that Error: cannot append type Node to type SList!(Node). I'm
pretty confused about using ~= because it works fine for arrays
but apperantly not for lists.
How do I add
I'm trying to figure out how to initialize a multi-dimentional
array with a struct. I thought it would be straight forward, but
i'm running into problems. I'm using nested for loops, and just
setting the current index to a blank version of my struct but
that gives me this error: Error: no []
I also tried this, which gives an out of range error:
void InitializePathGraph()
{
PathGraph.length = mapWidth;
foreach( elem; PathGraph )
{
elem.length = mapHeight;
}
Yes sorry, I was looking to initialize to the default value of
node. Thank you for the help!
On Saturday, 31 March 2012 at 21:59:50 UTC, Ali Çehreli wrote:
On 03/31/2012 02:34 PM, Chris Pons wrote:
I'm trying to figure out how to initialize a
multi-dimentional array
with a struct. I thought
Right now i'm struggling with trying to understand how to remove
an element from a n SList. I only want to remove one element, not
a range of elements. I also don't want to use an Array because I
will have to reshuffle elements to take care of the empty spot
when I remove it.
The only thing
On Tuesday, 20 March 2012 at 04:32:13 UTC, Adam D. Ruppe wrote:
I know very little about std.xml (I looked at it and
said 'meh' and wrote my own lib), but my lib
makes this pretty simple.
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff
grab dom.d and
Hey Guys,
I am trying to parse an XML document with std.xml. I've looked
over the reference of std.xml as well as the example but i'm
still stuck. I've also looked over some example code, but it's a
bit confusing and doesn't entirely help explain what i'm doing
wrong.
As far as I understand
Hello,
I'm trying to use the Gl3n (https://bitbucket.org/dav1d/gl3n) but
I keep getting error 42 whenever I try this:
alias Vector!(float, 2) vect2;
vect2 position;
position.x = 2.0f; //This is what causes the error
I looked into how the struct was implemented and x is an alias
for a
Yes, this is a lot more clear, thanks.
On Thursday, 15 March 2012 at 05:06:16 UTC, Mike Parker wrote:
On 3/15/2012 12:26 PM, Chris Pons wrote:
I haven't used DLL's much, especially one I've built on my
own, so
guidance would be appreciated.
I'm trying to figure out how to build a DLL which
Ok, I've actually run into another problem. I've decided to use a
static library, since my project is small. I have added the path
to the static library's .lib file in my project properties, just
like with derelict2. However, I'm not sure how to use import
properly.
The library in question
I've been playing around with VS Macros trying to step away from
explicit declarations of library locations. I'm using a google
repository as I would like to be able to work on projects either
at my desktop or laptop without having to worry about specific
library path locations.
I tried
Thank you for the valuable information! The difference between
assert and enforce is now clearer in my mind.
Also, that's a great trick with enforce.
On Thursday, 15 March 2012 at 01:08:02 UTC, Jonathan M Davis
wrote:
On Wednesday, March 14, 2012 20:15:16 Spacen Jasset wrote:
Is enforce then
I haven't used DLL's much, especially one I've built on my own,
so guidance would be appreciated.
I'm trying to figure out how to build a DLL which was written in
D but i'm not sure i'm doing this right.
I'm using VS2010 and Visual D. Visual D has a template for Dll's
in D, so I used that
Does D have a math library that defines, points, vectors and
matrices including the appropriate functions(addition, dot
product, cross product, etc)?
I'm starting my next game and I would like to know what my
options are. I plan on using SDL, I'm not exactly into OpenGL
yet, since I'm new
Thanks, I'll take a look. I'm new, so I might need some help
properly building this. I will post back if I have any problems.
On Tuesday, 13 March 2012 at 20:06:13 UTC, Dmitry Olshansky wrote:
On 14.03.2012 0:03, H. S. Teoh wrote:
On Tue, Mar 13, 2012 at 08:25:49PM +0100, Chris Pons wrote
SciD looks nice, but it seems to be a bit too complicated for my
use. Are there any other alternatives?
On Tuesday, 13 March 2012 at 20:14:14 UTC, Chris Pons wrote:
Thanks, I'll take a look. I'm new, so I might need some help
properly building this. I will post back if I have any problems
Oops, I didn't see the replies, after my last message. I'll check
this out. Thanks!
On Tuesday, 13 March 2012 at 20:34:54 UTC, Kiith-Sa wrote:
SciD is a scientific math library providing vectors/matrices of
arbitrary
sizes, but not useful at all for game development.
See gl3n for a
I'm new, and trying to incorporate assert and enforce into my
program properly.
My question revolves around, the fact that assert is only
evaluated when using the debug switch. I read that assert throws
a more serious exception than enforce does, is this correct?
I'm trying to use enforce
Ok, thank you for the advice. I will look into it.
Any idea why, system(PAUSE) does work?
You are right, there is also an option to Pause when program
finishes.
I never saw it until now. Thank you for all the replies.
On Friday, 9 March 2012 at 13:39:02 UTC, Dmitry Olshansky wrote:
On 09.03.2012 11:42, Chris Pons wrote:
I am new to D and have been playing around with Assert. I
I am new to D and have been playing around with Assert. I figured
that using a message with assert would be very helpful, but
unfortunately when the message is printed to the console, the
console closes and my program ends.
Is there any way to get a more permanent message?
I've tried adding
I'm trying to update a string easily whenever I change a numeric
component of the string. I've tried to do this so far with no
result:
while( testInt 10 )
string testString = Test ;
int testInt = 0;
testString ~= toString(testInt)
testInt++;
or this:
testString ~= cast(string)(testInt)
On Tuesday, 6 March 2012 at 23:19:03 UTC, H. S. Teoh wrote:
On Wed, Mar 07, 2012 at 12:13:54AM +0100, Chris Pons wrote:
I'm trying to update a string easily whenever I change a
numeric
component of the string. I've tried to do this so far with no
result:
[...]
Try this:
import
Is it possible to check the type of an object to a class name?
//Something like this:
Class test
{
//...
}
assert(is(anonObject == typeof(test))
Hello,
I am trying to work with SDL and one of their functions takes a
char * file as a function a parameter. However, i'm running into
trouble how to actually set this variable in my constructor.
I am getting a problem where if I use a pointer to a char and set
it as test.bmp I get an error
Thank you for the reply. However, I've run into another problem.
I changed:
---
char * file;
this()
{
this.filename = test.bmp;
}
---
To:
char * file
this()
{
this.filename = toStringz(test.bmp);
}
---
I am getting this error:
Ok, got it all sorted. Thank you for the guidance.
On Thursday, 23 February 2012 at 19:26:31 UTC, James Miller wrote:
I find that when learning a complicated system or library, the
best
way is to write out the code examples, compile them, then change
things until they break, fix it, then make more changes.
Eventually
you end up with the worst
I am following the book The D Programming Language and am at
the portion about functions and unittest. For some reason I
cannot get unittest to do anything noticeable.
I right clicked on my Project Properties Command Line and
under additional options added -unittest (--main gave me an error
Ok, thanks.
I haven't run into version(...) yet. Would I be correct if I
assumed that this version of void main: void main() {} would only
run if -unittest was in the command line?
Also, what should be in a unit test? Test cases to make sure
certain functions/classes are working as you
Thanks for the response. There are a lot of great features to D
that really excites me about using this language. Unittest is
definitely one of them.
It's hard for me to imagine myself going back to C++ at this
point because of the amount of great features in D. :)
I have been reading the book The D Programming Language and am
really enjoying D. However, my current motivation to use D was
specifically for programming through OpenGL, and I was excited
when I found out Dereict2 provided support for OpenGL.
My current Gfx card can only support up to OpenGL
Hey David and Vijay,
Thank you for the swift replies. It seems like this foray into D
and OpenGL could be a bit overwhelming considering I would be
learning D and SDL/OpenGL at the same time. So because of this,
i'm going to make sure I have a solid base in D to start with.
I am an
, but how long does it take to get approved to post on that
forum?
I read that I had to wait for moderator activation (unless I was
mistaken) ?
On Thursday, 23 February 2012 at 01:15:17 UTC, David wrote:
Am 23.02.2012 01:20, schrieb Chris Pons:
Hey David and Vijay,
Thank you for the swift replies
Ok, well it must be something wrong on my end. I have tried
logging in with no result. I'll try to work it.
I don't know if you are mistaken or not, but looking at the
member list sorted by join date, several new members have
registered recently. So if approval *is* required, it probably
On Wednesday, 15 February 2012 at 15:41:02 UTC, Kiith-Sa wrote:
On Wednesday, 15 February 2012 at 06:51:11 UTC, RedShift wrote:
Can I use OpenGL or DirectX with D? If so, where can I find a
guide to get everything setup?
Derelict provides bindings for OpenGL and SDL (and many other
I am sorry about the double post. I am in the middle of trying to
install derelict following this tutorial:
http://h3.gd/dmedia/?n=Tutorials.SdlGlTutorial1
However, when I get to the third step I get this error:
Error 1 Error: module gl is in file 'derelict\opengl\gl.d' which
cannot be read
Hey everyone,
I am new to D, and interested in using it with Derelict2 for game
development. I plan on using Visual D, which I have installed
already. I used the visual studio 2008 solution file to build the
libraries and the .di files but unfortunately I do not know where
to put these files
51 matches
Mail list logo