Re: first try

2017-03-18 Thread Philip Miess via Digitalmars-d-learn
On Fri, 17 Mar 2017 23:58:59 +, XavierAP wrote: > On Friday, 17 March 2017 at 00:35:32 UTC, Philip Miess wrote: >> >> https://gitlab.com/pmiess/101gamesDlangComputerGames/blob/master/ >> aceyducy.d > > You don't need string literals to be verbatim (r"") in order to insert > newlines as in

Re: first try

2017-03-18 Thread Philip Miess via Digitalmars-d-learn
On Fri, 17 Mar 2017 09:44:02 +, Andrea Fontana wrote: >> // Probably you mean > rather than >= >> if ( card1 >= card2 ) { >> swap( card1, card2); >> } >> >> >> // This is an old way to avoid not-intended assigment // but in D >> problem doesn't exists (and yoda notation doesn't work well

Re: first try

2017-03-18 Thread Philip Miess via Digitalmars-d-learn
On Fri, 17 Mar 2017 03:55:26 +, Jordan Wilson wrote: > Hello Phil, > > I think there might be an issue with this function here: snip > I get an infinate loop if I put in something that's not convertible to > an integer. I think what happens is that you catch the exception, the > input still

Re: first try

2017-03-17 Thread Philip Miess via Digitalmars-d-learn
On Thu, 16 Mar 2017 19:53:08 -0700, Ali Çehreli wrote: > It looks pretty good to me. > > - All capital letters? Yuck! :) > > - Typo: DOLLERS > > - It's better to declare and define variables at the same time: > >int bet = inputInt( "\nWHAT IS YOUR BET"); int card1 = uniform(2, 15, >

Re: first try

2017-03-17 Thread XavierAP via Digitalmars-d-learn
On Friday, 17 March 2017 at 00:35:32 UTC, Philip Miess wrote: https://gitlab.com/pmiess/101gamesDlangComputerGames/blob/master/ aceyducy.d You don't need string literals to be verbatim (r"") in order to insert newlines as in the code (without escape sequences). All string literals behave

Re: first try

2017-03-17 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 17 March 2017 at 09:04:18 UTC, Andrea Fontana wrote: On Friday, 17 March 2017 at 00:35:32 UTC, Philip Miess wrote: This is my first 100+ line D program. https://gitlab.com/pmiess/101gamesDlangComputerGames/blob/master/ aceyducy.d Its a translation/refactor of aceyducy from 101 basic

Re: first try

2017-03-17 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 17 March 2017 at 00:35:32 UTC, Philip Miess wrote: This is my first 100+ line D program. https://gitlab.com/pmiess/101gamesDlangComputerGames/blob/master/ aceyducy.d Its a translation/refactor of aceyducy from 101 basic programs. Could someone look over it and see if I've made any

Re: first try

2017-03-16 Thread Jordan Wilson via Digitalmars-d-learn
On Friday, 17 March 2017 at 00:35:32 UTC, Philip Miess wrote: This is my first 100+ line D program. https://gitlab.com/pmiess/101gamesDlangComputerGames/blob/master/ aceyducy.d Its a translation/refactor of aceyducy from 101 basic programs. Could someone look over it and see if I've made any

Re: first try

2017-03-16 Thread Ali Çehreli via Digitalmars-d-learn
I remember this game from many many years ago. :) On 03/16/2017 05:35 PM, Philip Miess wrote: This is my first 100+ line D program. https://gitlab.com/pmiess/101gamesDlangComputerGames/blob/master/ aceyducy.d Its a translation/refactor of aceyducy from 101 basic programs. Could someone look

first try

2017-03-16 Thread Philip Miess via Digitalmars-d-learn
This is my first 100+ line D program. https://gitlab.com/pmiess/101gamesDlangComputerGames/blob/master/ aceyducy.d Its a translation/refactor of aceyducy from 101 basic programs. Could someone look over it and see if I've made any glaring mistakes. Suggestions are welcome also. Thanks, Phil