Re: Small minesweeper game in D

2015-12-21 Thread wobbles via Digitalmars-d-announce

On Sunday, 20 December 2015 at 02:11:58 UTC, Adam D. Ruppe wrote:

code here:
http://arsdnet.net/dcode/minesweeper.d

[...]


On Ubuntu 64 bit:

$ dmd minesweeper.d simpledisplay.d color.d
simpledisplay.d(4477): Error: cannot implicitly convert 
expression (XCreatePixmapCursor(this.display, pm, pm, & 
blackcolor, & blackcolor, 0u, 0u)) of type ulong to int

$  dmd --version
DMD64 D Compiler v2.069.2


I casted the problem away with cast(int)XCreatePixmapCursor(...) 
to play a couple games. Not really solving the problem though...


Nice work though! 'Tis very cool.

The game code is very simple to follow too.
I'll try making a simple game using simpledisplay over the 
christmas.

It looks quite nifty!


Re: Small minesweeper game in D

2015-12-21 Thread bubbasaur via Digitalmars-d-announce

On Monday, 21 December 2015 at 02:28:27 UTC, Adam D. Ruppe wrote:

On Sunday, 20 December 2015 at 17:24:41 UTC, jmh530 wrote:
The code looks easy to understand also. You might consider 
writing this up into a blog post.


I might if I had a blog... which I need to set up at some point 
but haven't yet (well, I used to have one but not for years).


You can write in "THIS WEEK IN D"... please do it!

Bubba.


Re: Small minesweeper game in D

2015-12-21 Thread Adam D. Ruppe via Digitalmars-d-announce

On Monday, 21 December 2015 at 10:52:07 UTC, wobbles wrote:

On Ubuntu 64 bit:


whoops, I always build 32 bit here and sometimes forget to test 
64 bit before pushing. Fixed now.



The game code is very simple to follow too.
I'll try making a simple game using simpledisplay over the 
christmas.

It looks quite nifty!


Sweet, let me know how it goes!


Re: Small minesweeper game in D

2015-12-20 Thread Adam D. Ruppe via Digitalmars-d-announce
On Sunday, 20 December 2015 at 20:58:25 UTC, Taylor Hillegeist 
wrote:

I had to install libglu1-mesa* on Ubuntu. Nicely done though!


Huh, that's good to know! Everywhere else I tried on Linux it 
just worked but it does indeed require GL and GLU just because 
simpledisplay on Linux links to them, though I didn't actually 
use OpenGL for this program. (on Windows, opengl support is 
opt-in because the opengl32.lib and glu32.lib aren't included 
with dmd, I could do that on Linux too I suppose but installing 
glu isn't that hard anyway...)


Re: Small minesweeper game in D

2015-12-20 Thread Adam D. Ruppe via Digitalmars-d-announce

On Sunday, 20 December 2015 at 17:24:41 UTC, jmh530 wrote:
The code looks easy to understand also. You might consider 
writing this up into a blog post.


I might if I had a blog... which I need to set up at some point 
but haven't yet (well, I used to have one but not for years).


But what I posted here is the most of what I'd say anyway. I 
guess I could write a bit more about the code but most of it is 
IMO at least fairly straightforward.


Re: Small minesweeper game in D

2015-12-20 Thread Adam D. Ruppe via Digitalmars-d-announce

On Sunday, 20 December 2015 at 06:26:43 UTC, stew wrote:

"D-Invaders" under: http://dgame-dev.de/index.php?controller=wip


Nice!

Dgame looks to be a pretty nice little lib too.

a) (the most important for me) I can be as productive in D as I 
am in Python but still keep my static typing and native 
performance I get with C/C++.


My D productivity is so much higher than I am with ruby and 
python it isn't even a competition...


Re: Small minesweeper game in D

2015-12-20 Thread jmh530 via Digitalmars-d-announce

On Sunday, 20 December 2015 at 02:11:58 UTC, Adam D. Ruppe wrote:

code here:
http://arsdnet.net/dcode/minesweeper.d

[...]



The code looks easy to understand also. You might consider 
writing this up into a blog post.


Re: Small minesweeper game in D

2015-12-20 Thread Taylor Hillegeist via Digitalmars-d-announce

On Sunday, 20 December 2015 at 02:11:58 UTC, Adam D. Ruppe wrote:

dmd minesweeper.d simpledisplay.d color.d

And play the game! At least on Windows and Linux. On Mac, you 
need to install XQuartz since I don't have a working Cocoa 
implementation in simpledisplay.d right now. Fear not, it is on 
my todo list for 2016, so it will be there eventually.


I had to install libglu1-mesa* on Ubuntu. Nicely done though!


Re: Small minesweeper game in D

2015-12-19 Thread stew via Digitalmars-d-announce

On Sunday, 20 December 2015 at 02:11:58 UTC, Adam D. Ruppe wrote:

code here:
http://arsdnet.net/dcode/minesweeper.d

[...]


Nice!

I love doing this kind of thing on a lazy Sunday. Pick any 80's 
arcade game and try to implement as much as possible in an hour. 
I have several languages I cycle through but the last 1-hour 
gamehack in D I did is here:


"D-Invaders" under: http://dgame-dev.de/index.php?controller=wip

The Github repo now has a bunch of extra commits since that 
initial hour to keep it compiling with Dgame and D. It isn't 
pretty, nor idiomatic, but I was learning D and Dgame at the same 
time in that hour :)


I realised two things from that first hour with D, which have 
both proved true so far:


a) (the most important for me) I can be as productive in D as I 
am in Python but still keep my static typing and native 
performance I get with C/C++.


b) D is only going to keep improving.

Cheers,
Stew