Re: My programs issues

2022-08-12 Thread frame via Digitalmars-d-learn
On Friday, 12 August 2022 at 20:16:26 UTC, pascal111 wrote: I tried under Windows using alt+9 or 6 but with no hoped result, they printed another characters. Maybe this wasn't clear. I meant keep pressing [Alt] and then [9], [6] (in turn) and then release [Alt]. It should print the character

Re: My programs issues

2022-08-12 Thread pascal111 via Digitalmars-d-learn
On Friday, 12 August 2022 at 19:18:38 UTC, frame wrote: On Friday, 12 August 2022 at 18:43:14 UTC, pascal111 wrote: On Friday, 12 August 2022 at 16:06:09 UTC, frame wrote: On Thursday, 11 August 2022 at 20:30:54 UTC, pascal111 wrote: https://github.com/pascal111-fra/D/blob/main/proj08.d btw

Re: My programs issues

2022-08-12 Thread pascal111 via Digitalmars-d-learn
On Friday, 12 August 2022 at 19:18:38 UTC, frame wrote: On Friday, 12 August 2022 at 18:43:14 UTC, pascal111 wrote: On Friday, 12 August 2022 at 16:06:09 UTC, frame wrote: On Thursday, 11 August 2022 at 20:30:54 UTC, pascal111 wrote: https://github.com/pascal111-fra/D/blob/main/proj08.d btw

Re: My programs issues

2022-08-12 Thread frame via Digitalmars-d-learn
On Friday, 12 August 2022 at 18:43:14 UTC, pascal111 wrote: On Friday, 12 August 2022 at 16:06:09 UTC, frame wrote: On Thursday, 11 August 2022 at 20:30:54 UTC, pascal111 wrote: https://github.com/pascal111-fra/D/blob/main/proj08.d btw letters :D Please use ` (ASCII: 0x60) instead of ' (0x2

Re: My programs issues

2022-08-12 Thread pascal111 via Digitalmars-d-learn
On Friday, 12 August 2022 at 16:06:09 UTC, frame wrote: On Thursday, 11 August 2022 at 20:30:54 UTC, pascal111 wrote: https://github.com/pascal111-fra/D/blob/main/proj08.d btw letters :D Please use ` (ASCII: 0x60) instead of ' (0x27) for the markdown format header, eg.: ```D ...``` other

Re: My programs issues

2022-08-12 Thread frame via Digitalmars-d-learn
On Thursday, 11 August 2022 at 20:30:54 UTC, pascal111 wrote: https://github.com/pascal111-fra/D/blob/main/proj08.d btw letters :D Please use ` (ASCII: 0x60) instead of ' (0x27) for the markdown format header, eg.: ```D ...``` otherwise it won't be recognized here.

Re: My programs issues

2022-08-12 Thread pascal111 via Digitalmars-d-learn
On Friday, 12 August 2022 at 07:02:32 UTC, Antonio wrote: On Wednesday, 10 August 2022 at 13:13:20 UTC, Adam D Ruppe wrote: On Wednesday, 10 August 2022 at 12:36:42 UTC, pascal111 wrote: 1) I used "exit()" from "core.stdc.stdlib;" module, but someone can say this isn't the D way to exit the pro

Re: My programs issues

2022-08-12 Thread Antonio via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 13:13:20 UTC, Adam D Ruppe wrote: On Wednesday, 10 August 2022 at 12:36:42 UTC, pascal111 wrote: 1) I used "exit()" from "core.stdc.stdlib;" module, but someone can say this isn't the D way to exit the program. It is better to simply return a value from main ins

Re: My programs issues

2022-08-11 Thread pascal111 via Digitalmars-d-learn
This is a program for duplicating files, I made some changes on it, and liked to share it may that I get a new advice on it: '''D module main; // D programming language import std.stdio; import std.string; import std.algorithm; import dcollect; int main(string[] args) { string s; //char[] f

Re: My programs issues

2022-08-11 Thread pascal111 via Digitalmars-d-learn
Next code receiving an input from the user and reprint it in capital letters with a separator between each letter, but I think that there is more to add or to modify the way this program working with: '''D module main; import std.stdio; import std.uni; import std.string; import std.algorithm

Re: My programs issues

2022-08-10 Thread pascal111 via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 14:45:05 UTC, Andrey Zherikov wrote: On Wednesday, 10 August 2022 at 14:08:59 UTC, pascal111 wrote: This version has modern features, it's 1) functional 2) goto-less. There is nothing modern ;-D Take a look in this linear programming and you will know what's

Re: My programs issues

2022-08-10 Thread Andrey Zherikov via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 14:08:59 UTC, pascal111 wrote: This version has modern features, it's 1) functional 2) goto-less. There is nothing modern ;-D

Re: My programs issues

2022-08-10 Thread pascal111 via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 14:03:53 UTC, Andrey Zherikov wrote: On Wednesday, 10 August 2022 at 13:34:53 UTC, pascal111 wrote: So, the program will be like this: Is this clearer? ```d import std.stdio; import std.algorithm; import std.range; double getNumber() { double x; writ

Re: My programs issues

2022-08-10 Thread Andrey Zherikov via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 13:34:53 UTC, pascal111 wrote: So, the program will be like this: Is this clearer? ```d import std.stdio; import std.algorithm; import std.range; double getNumber() { double x; write("Enter a number: "); readf(" %s\n", &x); writeln; retur

Re: My programs issues

2022-08-10 Thread pascal111 via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 13:22:03 UTC, rikki cattermole wrote: On 11/08/2022 12:36 AM, pascal111 wrote: 2) I used "goto", I heard from someone before that using "goto" isn't good programming feature. This is mostly a historical debate at this point. Back 40 years ago, goto wasn't typi

Re: My programs issues

2022-08-10 Thread pascal111 via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 13:13:20 UTC, Adam D Ruppe wrote: On Wednesday, 10 August 2022 at 12:36:42 UTC, pascal111 wrote: 1) I used "exit()" from "core.stdc.stdlib;" module, but someone can say this isn't the D way to exit the program. It is better to simply return a value from main ins

Re: My programs issues

2022-08-10 Thread rikki cattermole via Digitalmars-d-learn
On 11/08/2022 12:36 AM, pascal111 wrote: 2) I used "goto", I heard from someone before that using "goto" isn't good programming feature. This is mostly a historical debate at this point. Back 40 years ago, goto wasn't typically limited within a procedure and doesn't have any checks in place

Re: My programs issues

2022-08-10 Thread Adam D Ruppe via Digitalmars-d-learn
On Wednesday, 10 August 2022 at 12:36:42 UTC, pascal111 wrote: 1) I used "exit()" from "core.stdc.stdlib;" module, but someone can say this isn't the D way to exit the program. It is better to simply return a value from main instead. 2) I used "goto", I heard from someone before that using "go