dlang-tour / spanish

Spanish translation of the DLang Tour
2 stars 5 forks source link

on welcome/welcome-to-d example mismatch #28

Closed astoliar closed 6 years ago

astoliar commented 6 years ago

It was mentioned that the intention is to keep this version as close as possible to the original version.

The example of the welcome page in Spanish is not the same as in English. The English version extends the "hello world" with a stunning use of slices to sort with the std algorithms.

A possible synchronization and translation is:

import std.stdio;
import std.algorithm;
import std.range;

void main()
{
    // ¡Empecemos!
    writeln("¡Hola, mundo!");

    // Ejemplo para programadores experimentados:
    // Tomar tres arrays, y sin reservar nueva
    // memoria, ordenarlos en el lugar
    int[] arr1 = [4, 9, 7];
    int[] arr2 = [5, 2, 1, 10];
    int[] arr3 = [6, 8, 3];
    sort(chain(arr1, arr2, arr3));
    writefln("%s\n%s\n%s\n", arr1, arr2, arr3);
    // Para aprender más acerca de este ejemplo,
    // véase la sección "Algoritmos sobre rangos"
    // bajo "Perlas"
}

If you agree, I could make the replacement and send the pull request.

csantander commented 6 years ago

Go for it

astoliar commented 6 years ago

The PR is closed. I guess this issue can be closed. Thanks @csantander