Post History
The challenge is to write as short a source as possible, where the English alphabet (in alphabetical order from top to bottom) "abcdefghijklmnopqrstuvwxyz" is a sub-sequence of the source code. Th...
#1: Initial revision
Source with the whole alphabet in order of appearance
The challenge is to write as short a source as possible, where the English alphabet (in alphabetical order from top to bottom) `"abcdefghijklmnopqrstuvwxyz"` is a sub-sequence of the source code.
The first mentioning of the next expected letter is the only one that counts. If a letter appears earlier on than expected, then it does not count.
That is: if the letter `a` is the next expected letter, then in the source `b;abs;c;` the `a` counts and everything before it is ignored. The next expected letter in the alphabet is `b`, which is found immediately as the next letter in `abs`. That a `b` existed earlier on in the source has no relevance. Similarly, the `s` at the end of `abs` fills no purpose as the next expected letter is now `c`. And so on, until the whole alphabet has been found in the source.
- Identifiers, variable/function names, string literals, integer/floating point constants (like 0xABCDEF) or anything else that can be named by the programmer _do not count_ towards iterating through the alphabet.
- Only keywords, function names or identifiers provided by the language's standard/default libraries count.
- A solution may use non-standard libraries in which case it becomes a separate "language x + library y" solution.
- Comments are not allowed anywhere in the source.
- The program need not do anything meaningful but must compile cleanly (no language syntax or constraint violations etc) and execute without any crashes or exceptions thrown.
- Function-only answers are accepted and encouraged.
- Any library includes at the top of the program are free and do not count towards the total (if using tio.run, you may put such in the header section).
- The challenge is case-insensitive, accepting both upper and lower case letters.
- This is code golf, the shortest source that fulfil the requirements wins.
Non-golfed example of a correct solution in standard C:
# [C (gcc)], 217 bytes
<!-- language-all: lang-c -->
void func (void)
{
fabs;cos;
#define x long
acosh;
printf("hello world");
jmp_buf j;
isblank;
long _Atomic l;
alignof(int);
puts;
qsort;qsort;
NULL;
(void)pow;
fmax;
INFINITY;
sizeof j;
}
[Try it online!][TIO-m0gtbfip]
[C (gcc)]: https://gcc.gnu.org/
[TIO-m0gtbfip]: https://tio.run/##ZZA9T8MwEIb3/IpTuyRDGGAMILFUilRlgoGpcvyRXHF8JnZoAfHbgy8dUMrie@955fuSZSflvEUn7aQ03IeokG76x@wPDSL2ayLjp9drpMfRXf0LOh4Hf8Wistj@Y8Ji5xKdPwgVmMlJyFkW2XcGYEQbKkmhSnqrtEGn4QyWXJeASEbPjh/RRZNvem0twYlGqzYFG2mIQzsZOHKCobXCvbHkAnB4ijSgBMtkGYNMngotP/0Ul6bvgcZYXd6UNi/7PcfLiJ5OnJhBnDnWza5u6udX1gG/NC2Nf@ZUEwaBbrVYWjQv2J3LdIUHeXs3l14r4SLKMp2UxvAL "C (gcc) – Try It Online"
---
To go through this source, `func` is an identifier and does not contribute to the solution (but to the total amount of characters for code golf like usual). Neither does `x`, `"hello world"` etc. We find the alphabet as follows (bold text):
> void func (void)
{
f**ab**s;**c**os;
#**def**ine x lon**g**
acos**h**;
pr**i**ntf("hello world");
**j**mp_buf j;
isblan**k**;
**l**ong _Ato**m**ic l;
alig**no**f(int);
**p**uts;
**q**so**r**t;q**s**or**t**;
N**U**LL;
(**v**oid)po**w**;
fma**x**;
INFINIT**Y**;
si**z**eof j;
}
