Question regarding D v.0110

Remi remigillig at gmail.com
Mon Jul 13 07:45:26 UTC 2020


Thanks for the suggestions regarding the cyclic dependency, I 
figured out a way to remove the cycles. It was mostly doing this 
in each class:

>class Foo
>{
>	static Rand rand;
>	public static this()
>	{
>		rand = new Rand;
>	}
>	public static void setRandSeed(long n)
>	{
>		rand.setSeed(n);
>	}
>}

which I replaced with

>class Foo
>{
>	static Rand rand;
>	public static void setRandSeed(long n)
>	{
>		if (!rand)
>		{
>			rand = new Rand;
>		}
>		rand.setSeed(n);
>	}
>}

Simple and it works!

On Saturday, 11 July 2020 at 20:17:40 UTC, Walter Bright wrote:
> On 7/11/2020 10:52 AM, Remi wrote:
>> On Saturday, 11 July 2020 at 16:23:21 UTC, Adam D. Ruppe wrote:
>>> On Saturday, 11 July 2020 at 16:18:52 UTC, Remi wrote:
>>>> I'm now trying to find docs on the "bit" type.
>>>
>>> it is really the same as bool
>> 
>> Thanks! It seems it was in an old SDL binding (1.x) and I 
>> replaced it with SDL_bool, seems to have done the trick. It 
>> seems to have been useful in the past to make bitfields for 
>> example.
>
> BTW, your work updating it would make for a nice D Blog 
> article. If accepted, you'll even get paid!
>
> Also, if the license of the game permits it, please make it 
> available on github.

I finally got the game to run and I was able to play, up until it 
crashed. I think just that part of getting up to this point would 
make a good article. I've started writing a quick draft to see if 
that's what you'd expect. Where should I contact you regarding 
the blog post?


More information about the Digitalmars-d mailing list