Skip to main content
Commonmark migration
Source Link

#Octave, 215 210 209 bytes

Octave, 215 210 209 bytes

Saved 5 bytes thanks to Luis Mendo. I saved 4 bytes thanks to Luis Mendo, but changing the approach help me save one more

fprintf('%s: %s%s\n',[k=num2cell(65:90);k;regexp('lfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu','[A-Z]','split')]{:})

Try it online!

If I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

Old explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...

#Octave, 215 210 209 bytes

Saved 5 bytes thanks to Luis Mendo. I saved 4 bytes thanks to Luis Mendo, but changing the approach help me save one more

fprintf('%s: %s%s\n',[k=num2cell(65:90);k;regexp('lfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu','[A-Z]','split')]{:})

Try it online!

If I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

Old explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...

Octave, 215 210 209 bytes

Saved 5 bytes thanks to Luis Mendo. I saved 4 bytes thanks to Luis Mendo, but changing the approach help me save one more

fprintf('%s: %s%s\n',[k=num2cell(65:90);k;regexp('lfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu','[A-Z]','split')]{:})

Try it online!

If I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

Old explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...
added 355 characters in body
Source Link
Stewie Griffin
  • 46.5k
  • 13
  • 132
  • 295

#Octave, 215 210210 209 bytes

Saved 5Saved 5 bytes thanks to Luis Mendo. I saved 4 bytes thanks to Luis Mendo., but changing the approach help me save one more

fprintf('%s: %s\n'%s%s\n',[num2cell[k=num2cell(65:90);regexp;k;regexp('AlfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu''lfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu','[A-z][a-z]+'Z]','match''split')]{:})

Try it online!

If I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

Old explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...

#Octave, 215 210 bytes

Saved 5 bytes thanks to Luis Mendo.

fprintf('%s: %s\n',[num2cell(65:90);regexp('AlfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu','[A-z][a-z]+','match')]{:})

If I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

Old explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...

#Octave, 215 210 209 bytes

Saved 5 bytes thanks to Luis Mendo. I saved 4 bytes thanks to Luis Mendo, but changing the approach help me save one more

fprintf('%s: %s%s\n',[k=num2cell(65:90);k;regexp('lfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu','[A-Z]','split')]{:})

Try it online!

If I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

Old explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...
added 46 characters in body
Source Link
Stewie Griffin
  • 46.5k
  • 13
  • 132
  • 295

#Octave, 215215 210 bytes

Saved 5 bytes thanks to Luis Mendo.

fprintf('%s: %s\n',[num2cell(65:90);strsplit;regexp('Alfa Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey Xray Yankee Zulu''AlfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu','[A-z][a-z]+','match')]{:})

If I got rid of the spaces, I'd save 25 bytes, but thenIf I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

ExplanationOld explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...

#Octave, 215 bytes

fprintf('%s: %s\n',[num2cell(65:90);strsplit('Alfa Bravo Charlie Delta Echo Foxtrot Golf Hotel India Juliet Kilo Lima Mike November Oscar Papa Quebec Romeo Sierra Tango Uniform Victor Whiskey Xray Yankee Zulu')]{:})

If I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

Explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...

#Octave, 215 210 bytes

Saved 5 bytes thanks to Luis Mendo.

fprintf('%s: %s\n',[num2cell(65:90);regexp('AlfaBravoCharlieDeltaEchoFoxtrotGolfHotelIndiaJulietKiloLimaMikeNovemberOscarPapaQuebecRomeoSierraTangoUniformVictorWhiskeyXrayYankeeZulu','[A-z][a-z]+','match')]{:})

If I got rid of the spaces, I'd save 25 bytes, but then I'd have to use a regex. The regex itself would cost quite a few bytes, and it would also remove the capital letter of all words, leaving me with the words lfa, ravo etc. I would therefore have to concatenate the new strings with the leading characters. All this costs bytes.

Old explanation:

fprintf('%s: %s\n',      % Print a string with the format "str: str\n"
num2cell(65:90)          % Create a cell array with the numbers 65 - 90, one in each cell
strsplit('Alfa ...       % Split the string on the default delimiter: space
[num2cell();strsplit()]  % Concatenate cell arrays, leaving us with
                         % {'A',    'B'
                         %  'Alfa', 'Bravo'}
[...]{:}                 % Convert the cell array to a comma-delimited vector
                         % 'A', 'Alfa', 'B', 'Bravo' ...
added 719 characters in body
Source Link
Stewie Griffin
  • 46.5k
  • 13
  • 132
  • 295
Loading
Source Link
Stewie Griffin
  • 46.5k
  • 13
  • 132
  • 295
Loading