Re: Yes or No Options

2015-07-31 Thread Alex via Digitalmars-d-learn
On Thursday, 30 July 2015 at 15:14:28 UTC, Chris wrote: On Thursday, 30 July 2015 at 14:20:41 UTC, Alex wrote: My father owns a small software company, specialized in market data products. www.bccgi.com (in case anyone is interested) So programming was basically around all my life. I do a sm

Re: Yes or No Options

2015-07-31 Thread Chris via Digitalmars-d-learn
On Thursday, 30 July 2015 at 17:48:51 UTC, Ali Çehreli wrote: On 07/30/2015 08:14 AM, Chris wrote: I wonder, is your father's company listed among those using D? I think there's a list somewhere on Wiki, if not we should have one :-) I don't think they use D yet but the page is here: htt

Re: Yes or No Options

2015-07-30 Thread Ali Çehreli via Digitalmars-d-learn
On 07/30/2015 08:14 AM, Chris wrote: I wonder, is your father's company listed among those using D? I think there's a list somewhere on Wiki, if not we should have one :-) I don't think they use D yet but the page is here: http://wiki.dlang.org/Current_D_Use Ali

Re: Yes or No Options

2015-07-30 Thread Chris via Digitalmars-d-learn
On Thursday, 30 July 2015 at 14:20:41 UTC, Alex wrote: My father owns a small software company, specialized in market data products. www.bccgi.com (in case anyone is interested) So programming was basically around all my life. I do a small job in his company and my next task was to learn D.

Re: Yes or No Options

2015-07-30 Thread Alex via Digitalmars-d-learn
My father owns a small software company, specialized in market data products. www.bccgi.com (in case anyone is interested) So programming was basically around all my life. I do a small job in his company and my next task was to learn D. There are two trainees and the three of us have to learn

Re: Yes or No Options

2015-07-29 Thread Chris via Digitalmars-d-learn
On Monday, 27 July 2015 at 15:50:11 UTC, Alex wrote: Hey guys! I am super new to programming and still trying to learn the very basics via a book that I bought. Out of interest: what made you start with D? It's not the most obvious choice for a programming novice.

Re: Yes or No Options

2015-07-28 Thread wobbles via Digitalmars-d-learn
On Monday, 27 July 2015 at 18:23:57 UTC, Alex wrote: On Monday, 27 July 2015 at 17:31:08 UTC, Ali Çehreli wrote: On 07/27/2015 08:50 AM, Alex wrote: > a book that I bought The program looks a lot like one of the exercises in this chapter: http://ddili.org/ders/d.en/if.html You didn't act

Re: Yes or No Options

2015-07-28 Thread Alex via Digitalmars-d-learn
So I now combined a few of the options here and got this, which finally works: import std.stdio; import std.string; import std.random; void main() { while (true) { string yesno; int weiter; char[] uschi; write("Press ENTER to roll the dice!");

Re: Yes or No Options

2015-07-27 Thread Alex via Digitalmars-d-learn
On Monday, 27 July 2015 at 17:31:08 UTC, Ali Çehreli wrote: On 07/27/2015 08:50 AM, Alex wrote: > a book that I bought The program looks a lot like one of the exercises in this chapter: http://ddili.org/ders/d.en/if.html You didn't actually pay for it, right? Because it is free. :) Ali

Re: Yes or No Options

2015-07-27 Thread Tofu Ninja via Digitalmars-d-learn
On Monday, 27 July 2015 at 16:48:00 UTC, Alex wrote: Okay. By pure trying I found out what I did wrong: Apparently by typing Y I entered the shift key. Could that have been the problem? I changed it to a small y and it at least jumped back to the commandline instead of just being stuck. And

Re: Yes or No Options

2015-07-27 Thread CraigDillabaugh via Digitalmars-d-learn
On Monday, 27 July 2015 at 17:21:33 UTC, Anonymous wrote: On Monday, 27 July 2015 at 16:48:00 UTC, Alex wrote: Okay. By pure trying I found out what I did wrong: Apparently by typing Y I entered the shift key. Could that have been the problem? I changed it to a small y and it at least jumped b

Re: Yes or No Options

2015-07-27 Thread Ali Çehreli via Digitalmars-d-learn
On 07/27/2015 08:50 AM, Alex wrote: > a book that I bought The program looks a lot like one of the exercises in this chapter: http://ddili.org/ders/d.en/if.html You didn't actually pay for it, right? Because it is free. :) Ali

Re: Yes or No Options

2015-07-27 Thread Anonymous via Digitalmars-d-learn
On Monday, 27 July 2015 at 16:48:00 UTC, Alex wrote: Okay. By pure trying I found out what I did wrong: Apparently by typing Y I entered the shift key. Could that have been the problem? I changed it to a small y and it at least jumped back to the commandline instead of just being stuck. And

Re: Yes or No Options

2015-07-27 Thread Alex via Digitalmars-d-learn
Okay. By pure trying I found out what I did wrong: Apparently by typing Y I entered the shift key. Could that have been the problem? I changed it to a small y and it at least jumped back to the commandline instead of just being stuck. And by changing: writeln("Do you want to play again? Y/N?

Re: Yes or No Options

2015-07-27 Thread Alex via Digitalmars-d-learn
Thank you! That helped me a lot. I'm sure that - in order to get to the point to repeat the whole first part of the program - I'll have to read further in the instructions I have BUT let's just say that I don't want it to repeat the first part of the program but just writeln something like "O

Re: Yes or No Options

2015-07-27 Thread Namespace via Digitalmars-d-learn
Look at my example: import std.stdio; import std.string; import std.conv : to; void main() { while (true) { write("Roll the dice: Enter a number: "); int dieNumber = readln.strip.to!int; if (dieNumber < 4) { writeln("You won!"); } else

Re: Yes or No Options

2015-07-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 27 July 2015 at 15:50:11 UTC, Alex wrote: readf(" %s", &dieNumber); What happens here is a bit tricky and trips up a lot of programmers: readf leaves the end-of-line character in the buffer, which readln then sees as meaning its job is done. When you enter, say, 5, then p

Yes or No Options

2015-07-27 Thread Alex via Digitalmars-d-learn
Hey guys! I am super new to programming and still trying to learn the very basics via a book that I bought. My problem is the following: import std.stdio; import std.string; void main() { char[] yesno; write("Roll the dice: Enter a number!"); int dieNumber;