Generate lower case ASCII alphabet: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
Line 7: Line 7:


During code review it's not immediate obvious to spot the bug in a Tcl line like this contained in a page of code:
During code review it's not immediate obvious to spot the bug in a Tcl line like this contained in a page of code:
<lang tcl>set alpha {a b c d e f g h i j k m n o p q r s t u v w x y z}</lang>
<syntaxhighlight lang="tcl">set alpha {a b c d e f g h i j k m n o p q r s t u v w x y z}</syntaxhighlight>




Line 15: Line 15:
=={{header|0815}}==
=={{header|0815}}==
This creates the list in the queue
This creates the list in the queue
<lang 0815><:61:~}:000:>>&{~<:7a:-#:001:<:1:+^:000:</lang>
<syntaxhighlight lang="0815"><:61:~}:000:>>&{~<:7a:-#:001:<:1:+^:000:</syntaxhighlight>


=={{header|11l}}==
=={{header|11l}}==
<lang 11l>print(Array(‘a’..‘z’))</lang>
<syntaxhighlight lang="11l">print(Array(‘a’..‘z’))</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 27: Line 27:
In EBCDIC coding there are more than 24 characters between a and z.
In EBCDIC coding there are more than 24 characters between a and z.
So we have to get rid of characters between i and j and also between r and s.
So we have to get rid of characters between i and j and also between r and s.
<lang 360asm>* Generate lower case alphabet - 15/10/2015
<syntaxhighlight lang="360asm">* Generate lower case alphabet - 15/10/2015
LOWER CSECT
LOWER CSECT
USING LOWER,R15 set base register
USING LOWER,R15 set base register
Line 54: Line 54:
PG DS CL26 buffer
PG DS CL26 buffer
YREGS
YREGS
END LOWER</lang>
END LOWER</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 62: Line 62:
=={{header|6502 Assembly}}==
=={{header|6502 Assembly}}==
Stores the lower-case ASCII alphabet as a null-terminated string beginning at address 2000 hex. Register contents are preserved.
Stores the lower-case ASCII alphabet as a null-terminated string beginning at address 2000 hex. Register contents are preserved.
<lang asm6502>ASCLOW: PHA ; push contents of registers that we
<syntaxhighlight lang="asm6502">ASCLOW: PHA ; push contents of registers that we
TXA ; shall be using onto the stack
TXA ; shall be using onto the stack
PHA
PHA
Line 78: Line 78:
TAX ; the stack
TAX ; the stack
PLA
PLA
RTS ; return</lang>
RTS ; return</syntaxhighlight>


=={{header|68000 Assembly}}==
=={{header|68000 Assembly}}==
Line 88: Line 88:
Called as a subroutine (i.e. "JSR Ascii_Low" if far away or "BSR Ascii_Low" if nearby)
Called as a subroutine (i.e. "JSR Ascii_Low" if far away or "BSR Ascii_Low" if nearby)


<lang 68000devpac>
<syntaxhighlight lang="68000devpac">
Ascii_Low:
Ascii_Low:
MOVEM.L D0/A0,-(SP) ;store D0 and A0 on stack
MOVEM.L D0/A0,-(SP) ;store D0 and A0 on stack
Line 105: Line 105:


rts
rts
</syntaxhighlight>
</lang>


=={{header|8080 Assembly}}==
=={{header|8080 Assembly}}==
Line 112: Line 112:
in the form of an <code>$</code>-terminated string that CP/M syscalls can use.
in the form of an <code>$</code>-terminated string that CP/M syscalls can use.


<lang 8080asm> org 100h
<syntaxhighlight lang="8080asm"> org 100h
jmp test
jmp test


Line 141: Line 141:


buf: ds 27 ; buffer to keep the alphabet in
buf: ds 27 ; buffer to keep the alphabet in
</syntaxhighlight>
</lang>


=={{header|8086 Assembly}}==
=={{header|8086 Assembly}}==


<lang asm> bits 16
<syntaxhighlight lang="asm"> bits 16
cpu 8086
cpu 8086
org 100h
org 100h
Line 169: Line 169:
ret
ret
section .bss
section .bss
buf: resb 27 ; Buffer to store the alphabet in</lang>
buf: resb 27 ; Buffer to store the alphabet in</syntaxhighlight>


=={{header|8th}}==
=={{header|8th}}==
We take an empty string, and use the "loop" word to create a new character using "'a n:+". The loop passes the current index to the code being iterated, so it starts with 0 and up to 25, adding to the "'a" - which is the numeric value of lowercase "a", and the resultant number is then appended to the string. That converts the number to the appropriate character and appends it:
We take an empty string, and use the "loop" word to create a new character using "'a n:+". The loop passes the current index to the code being iterated, so it starts with 0 and up to 25, adding to the "'a" - which is the numeric value of lowercase "a", and the resultant number is then appended to the string. That converts the number to the appropriate character and appends it:
<lang forth>
<syntaxhighlight lang="forth">
"" ( 'a n:+ s:+ ) 0 25 loop
"" ( 'a n:+ s:+ ) 0 25 loop
. cr
. cr
</syntaxhighlight>
</lang>
{{out}}
{{out}}
<pre>
<pre>
Line 184: Line 184:
=={{header|ABAP}}==
=={{header|ABAP}}==
=== Example with simple write statement ===
=== Example with simple write statement ===
<lang ABAP>REPORT lower_case_ascii.
<syntaxhighlight lang="abap">REPORT lower_case_ascii.


WRITE: / to_lower( sy-abcde ).</lang>
WRITE: / to_lower( sy-abcde ).</syntaxhighlight>


=== Example with / without space using CL_DEMO_OUTPUT class ===
=== Example with / without space using CL_DEMO_OUTPUT class ===
<lang ABAP>REPORT lower_case_ascii.
<syntaxhighlight lang="abap">REPORT lower_case_ascii.


cl_demo_output=>new(
cl_demo_output=>new(
Line 198: Line 198:
ELSE |{ out } { COND string( WHEN char <> strlen( sy-abcde ) THEN sy-abcde+char(1) ) }| ) )
ELSE |{ out } { COND string( WHEN char <> strlen( sy-abcde ) THEN sy-abcde+char(1) ) }| ) )
)->write( |Or use the system field: { sy-abcde }|
)->write( |Or use the system field: { sy-abcde }|
)->display( ).</lang>
)->display( ).</syntaxhighlight>


=={{header|Action!}}==
=={{header|Action!}}==
<lang Action!>byte X
<syntaxhighlight lang="action!">byte X


Proc Main()
Proc Main()
Line 210: Line 210:
Od
Od


Return</lang>
Return</syntaxhighlight>
{{Out}}
{{Out}}
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>
Line 218: Line 218:
We start with a strong type definition: A character range that can only hold lower-case letters:
We start with a strong type definition: A character range that can only hold lower-case letters:


<lang Ada> type Lower_Case is new Character range 'a' .. 'z';</lang>
<syntaxhighlight lang="ada"> type Lower_Case is new Character range 'a' .. 'z';</syntaxhighlight>


Now we define an array type and initialize the Array A of that type with the 26 letters:
Now we define an array type and initialize the Array A of that type with the 26 letters:
<lang Ada> type Arr_Type is array (Integer range <>) of Lower_Case;
<syntaxhighlight lang="ada"> type Arr_Type is array (Integer range <>) of Lower_Case;
A : Arr_Type (1 .. 26) := "abcdefghijklmnopqrstuvwxyz";</lang>
A : Arr_Type (1 .. 26) := "abcdefghijklmnopqrstuvwxyz";</syntaxhighlight>


Strong typing would catch two errors: (1) any upper-case letters or other symbols in the string assigned to A, and (2) too many or too few letters assigned to A. However, a letter might still appear twice (or more) in A, at the cost of one or more other letters. Array B is safe even against such errors:
Strong typing would catch two errors: (1) any upper-case letters or other symbols in the string assigned to A, and (2) too many or too few letters assigned to A. However, a letter might still appear twice (or more) in A, at the cost of one or more other letters. Array B is safe even against such errors:


<lang Ada> B : Arr_Type (1 .. 26);
<syntaxhighlight lang="ada"> B : Arr_Type (1 .. 26);
begin
begin
B(B'First) := 'a';
B(B'First) := 'a';
for I in B'First .. B'Last-1 loop
for I in B'First .. B'Last-1 loop
B(I+1) := Lower_Case'Succ(B(I));
B(I+1) := Lower_Case'Succ(B(I));
end loop; -- now all the B(I) are different</lang>
end loop; -- now all the B(I) are different</syntaxhighlight>


=={{header|ALGOL 68}}==
=={{header|ALGOL 68}}==
{{works with|ALGOL 68G|Any - tested with release 2.6.win32}}
{{works with|ALGOL 68G|Any - tested with release 2.6.win32}}
<lang algol68> # in ALGOL 68, a STRING is an array of characters with flexible bounds #
<syntaxhighlight lang="algol68"> # in ALGOL 68, a STRING is an array of characters with flexible bounds #
# so we can declare an array of 26 characters and assign a string #
# so we can declare an array of 26 characters and assign a string #
# containing the lower-case letters to it #
# containing the lower-case letters to it #


[ 26 ]CHAR lc := "abcdefghijklmnopqrstuvwxyz"
[ 26 ]CHAR lc := "abcdefghijklmnopqrstuvwxyz"
</syntaxhighlight>
</lang>
Alternative version
Alternative version
<lang algol68> # fills lc with the 26 lower-case letters, assuming that #
<syntaxhighlight lang="algol68"> # fills lc with the 26 lower-case letters, assuming that #
# they are consecutive in the character set, as they are in ASCII #
# they are consecutive in the character set, as they are in ASCII #


Line 250: Line 250:
DO
DO
lc[ i ] := REPR ( ABS "a" + ( i - 1 ) )
lc[ i ] := REPR ( ABS "a" + ( i - 1 ) )
OD</lang>
OD</syntaxhighlight>


=={{header|ALGOL W}}==
=={{header|ALGOL W}}==
<lang algolw> % set lc to the lower case alphabet %
<syntaxhighlight lang="algolw"> % set lc to the lower case alphabet %
string(26) lc;
string(26) lc;
for c := 0 until 25 do lc( c // 1 ) := code( decode( "a" ) + c );</lang>
for c := 0 until 25 do lc( c // 1 ) := code( decode( "a" ) + c );</syntaxhighlight>


=={{header|APL}}==
=={{header|APL}}==
{{works with|Dyalog APL}}
{{works with|Dyalog APL}}
<lang apl> ⎕UCS 96+⍳26</lang>
<syntaxhighlight lang="apl"> ⎕UCS 96+⍳26</syntaxhighlight>


=={{header|AppleScript}}==
=={{header|AppleScript}}==


<lang AppleScript>-------------------- ALPHABETIC SERIES -------------------
<syntaxhighlight lang="applescript">-------------------- ALPHABETIC SERIES -------------------
on run
on run
unlines(map(concat, ¬
unlines(map(concat, ¬
Line 354: Line 354:
set my text item delimiters to dlm
set my text item delimiters to dlm
s
s
end unlines</lang>
end unlines</syntaxhighlight>
{{Out}}
{{Out}}
<pre>abcdefghijklmnopqrstuvwxyz
<pre>abcdefghijklmnopqrstuvwxyz
Line 363: Line 363:
A minor variation would be to perform a mass conversion and character extraction at the end instead of twenty-six individual <tt>character id i</tt> conversions:
A minor variation would be to perform a mass conversion and character extraction at the end instead of twenty-six individual <tt>character id i</tt> conversions:


<lang applescript>set l to {}
<syntaxhighlight lang="applescript">set l to {}
repeat with i from id of "a" to id of "z"
repeat with i from id of "a" to id of "z"
set end of l to i
set end of l to i
end repeat
end repeat


return characters of string id l</lang>
return characters of string id l</syntaxhighlight>
{{Out}}
{{Out}}
<lang applescript>{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}</lang>
<syntaxhighlight lang="applescript">{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}</syntaxhighlight>


=={{header|Applesoft BASIC}}==
=={{header|Applesoft BASIC}}==
<lang ApplesoftBasic>L$="abcdefghijklmnopqrstuvwxyz"</lang>
<syntaxhighlight lang="applesoftbasic">L$="abcdefghijklmnopqrstuvwxyz"</syntaxhighlight>
On the older model Apple II and Apple II plus, it is difficult to enter lower case characters. The following code generates the same string:
On the older model Apple II and Apple II plus, it is difficult to enter lower case characters. The following code generates the same string:
<lang ApplesoftBasic>L$="":FORI=1TO26:L$=L$+CHR$(96+I):NEXT</lang>
<syntaxhighlight lang="applesoftbasic">L$="":FORI=1TO26:L$=L$+CHR$(96+I):NEXT</syntaxhighlight>


=={{header|ARM Assembly}}==
=={{header|ARM Assembly}}==
Line 385: Line 385:
This code generates the lower case ASCII set, stores it in RAM as a string literal, and prints that string to the screen.
This code generates the lower case ASCII set, stores it in RAM as a string literal, and prints that string to the screen.


<lang ARM Assembly>ProgramStart:
<syntaxhighlight lang="arm assembly">ProgramStart:
mov sp,#0x03000000 ;Init Stack Pointer
mov sp,#0x03000000 ;Init Stack Pointer
Line 410: Line 410:


forever:
forever:
b forever ;halt the cpu</lang>
b forever ;halt the cpu</syntaxhighlight>
{{out}}
{{out}}
[https://ibb.co/4SbsgzP Picture of output]
[https://ibb.co/4SbsgzP Picture of output]
Line 416: Line 416:
=={{header|Arturo}}==
=={{header|Arturo}}==


<lang rebol>print to [:char] 97..122</lang>
<syntaxhighlight lang="rebol">print to [:char] 97..122</syntaxhighlight>


{{out}}
{{out}}
Line 422: Line 422:


=={{header|ATS}}==
=={{header|ATS}}==
<syntaxhighlight lang="ats">
<lang ATS>
(* ****** ****** *)
(* ****** ****** *)
//
//
Line 449: Line 449:
//
//
} (* end of [main0] *)
} (* end of [main0] *)
</syntaxhighlight>
</lang>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==
{{works with|AutoHotkey 1.1}}
{{works with|AutoHotkey 1.1}}
<lang AutoHotkey>a :={}
<syntaxhighlight lang="autohotkey">a :={}
Loop, 26
Loop, 26
a.Insert(Chr(A_Index + 96))</lang>
a.Insert(Chr(A_Index + 96))</syntaxhighlight>


=={{header|AutoIt}}==
=={{header|AutoIt}}==
<syntaxhighlight lang="autoit">
<lang AutoIt>
Func _a2z()
Func _a2z()
Local $a2z = ""
Local $a2z = ""
Line 466: Line 466:
Return $a2z
Return $a2z
EndFunc
EndFunc
</syntaxhighlight>
</lang>


=={{header|AWK}}==
=={{header|AWK}}==
Line 475: Line 475:
Note this is dependent on the locale-setting,
Note this is dependent on the locale-setting,
and options, e.g. --traditional and --posix
and options, e.g. --traditional and --posix
<syntaxhighlight lang="awk">
<lang AWK>
# syntax: GAWK -f GENERATE_LOWER_CASE_ASCII_ALPHABET.AWK
# syntax: GAWK -f GENERATE_LOWER_CASE_ASCII_ALPHABET.AWK
BEGIN {
BEGIN {
Line 487: Line 487:
exit(0)
exit(0)
}
}
</syntaxhighlight>
</lang>
{{Output}}
{{Output}}
<pre>
<pre>
Line 496: Line 496:
=={{header|BASIC}}==
=={{header|BASIC}}==
==={{header|BBC BASIC}}===
==={{header|BBC BASIC}}===
<lang bbcbasic> DIM lower&(25)
<syntaxhighlight lang="bbcbasic"> DIM lower&(25)
FOR i%=0TO25
FOR i%=0TO25
lower&(i%)=ASC"a"+i%
lower&(i%)=ASC"a"+i%
NEXT
NEXT
END</lang>
END</syntaxhighlight>


==={{header|BASIC256}}===
==={{header|BASIC256}}===
<lang basic256>
<syntaxhighlight lang="basic256">
# generate lowercase ascii alphabet
# generate lowercase ascii alphabet
# basic256 1.1.4.0
# basic256 1.1.4.0
Line 513: Line 513:
print a$[i] + " ";
print a$[i] + " ";
next i
next i
</syntaxhighlight>
</lang>
{{out}}
{{out}}
<pre>
<pre>
Line 520: Line 520:


==={{header|Commodore BASIC}}===
==={{header|Commodore BASIC}}===
<lang gwbasic>10 FOR I=ASC("A") TO ASC("Z")
<syntaxhighlight lang="gwbasic">10 FOR I=ASC("A") TO ASC("Z")
20 A$ = A$+CHR$(I)
20 A$ = A$+CHR$(I)
30 NEXT
30 NEXT
40 PRINT CHR$(14) : REM 'SWITCH CHARACTER SET TO LOWER/UPPER CASES
40 PRINT CHR$(14) : REM 'SWITCH CHARACTER SET TO LOWER/UPPER CASES
50 PRINT A$</lang>
50 PRINT A$</syntaxhighlight>


==={{header|FreeBASIC}}===
==={{header|FreeBASIC}}===
<lang freebasic>' FB 1.05.0 Win64
<syntaxhighlight lang="freebasic">' FB 1.05.0 Win64


' Create a string buffer to store the alphabet plus a final null byte
' Create a string buffer to store the alphabet plus a final null byte
Line 541: Line 541:
Print "Press any key to quit"
Print "Press any key to quit"
Sleep
Sleep
</syntaxhighlight>
</lang>


{{out}}
{{out}}
Line 549: Line 549:


==={{header|IS-BASIC}}===
==={{header|IS-BASIC}}===
<lang IS-BASIC>100 STRING ALPHA$*26
<syntaxhighlight lang="is-basic">100 STRING ALPHA$*26
110 LET ALPHA$=""
110 LET ALPHA$=""
120 FOR I=ORD("a") TO ORD("z")
120 FOR I=ORD("a") TO ORD("z")
130 LET ALPHA$=ALPHA$&CHR$(I)
130 LET ALPHA$=ALPHA$&CHR$(I)
140 NEXT
140 NEXT
150 PRINT ALPHA$</lang>
150 PRINT ALPHA$</syntaxhighlight>


==={{header|PureBasic}}===
==={{header|PureBasic}}===
<lang purebasic>Dim lower_case('z' - 'a') ;indexing goes from 0 -> 25
<syntaxhighlight lang="purebasic">Dim lower_case('z' - 'a') ;indexing goes from 0 -> 25
For i = 0 To ArraySize(lower_case())
For i = 0 To ArraySize(lower_case())
lower_case(i) = i + 'a'
lower_case(i) = i + 'a'
Next</lang>
Next</syntaxhighlight>


==={{header|QBasic}}===
==={{header|QBasic}}===
Line 566: Line 566:
{{works with|QuickBasic|4.5}}
{{works with|QuickBasic|4.5}}
{{works with|True BASIC}}
{{works with|True BASIC}}
<lang QBasic>DIM a$(27)
<syntaxhighlight lang="qbasic">DIM a$(27)


FOR i = 1 to 26
FOR i = 1 to 26
Line 572: Line 572:
PRINT a$(i);
PRINT a$(i);
NEXT i
NEXT i
END</lang>
END</syntaxhighlight>


==={{header|True BASIC}}===
==={{header|True BASIC}}===
{{works with|QBasic|1.1}}
{{works with|QBasic|1.1}}
{{works with|QuickBasic|4.5}}
{{works with|QuickBasic|4.5}}
<lang QBasic>DIM a$(27)
<syntaxhighlight lang="qbasic">DIM a$(27)


FOR i = 1 to 26
FOR i = 1 to 26
Line 583: Line 583:
PRINT a$(i);
PRINT a$(i);
NEXT i
NEXT i
END</lang>
END</syntaxhighlight>


==={{header|Yabasic}}===
==={{header|Yabasic}}===
Line 589: Line 589:
{{works with|QuickBasic|4.5}}
{{works with|QuickBasic|4.5}}
{{works with|Run BASIC}}
{{works with|Run BASIC}}
<lang yabasic>for i = asc("a") to asc("z")
<syntaxhighlight lang="yabasic">for i = asc("a") to asc("z")
print chr$(i);
print chr$(i);
next i</lang>
next i</syntaxhighlight>


==={{header|Run BASIC}}===
==={{header|Run BASIC}}===
<lang Runbasic>for i = asc("a") to asc("z")
<syntaxhighlight lang="runbasic">for i = asc("a") to asc("z")
print chr$(i);
print chr$(i);
next i</lang>Output:
next i</syntaxhighlight>Output:
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>


==={{header|uBasic/4tH}}===
==={{header|uBasic/4tH}}===
<lang>For x= ORD("a") To ORD("z") : @(x - ORD("a")) = x : Next</lang>
<syntaxhighlight lang="text">For x= ORD("a") To ORD("z") : @(x - ORD("a")) = x : Next</syntaxhighlight>


==={{header|ZX Spectrum Basic}}===
==={{header|ZX Spectrum Basic}}===
{{trans|BBC_BASIC}}
{{trans|BBC_BASIC}}
<lang zxbasic>10 DIM l$(26): LET init= CODE "a"-1
<syntaxhighlight lang="zxbasic">10 DIM l$(26): LET init= CODE "a"-1
20 FOR i=1 TO 26
20 FOR i=1 TO 26
30 LET l$(i)=CHR$ (init+i)
30 LET l$(i)=CHR$ (init+i)
40 NEXT i
40 NEXT i
50 PRINT l$</lang>
50 PRINT l$</syntaxhighlight>


==={{header|BaCon}}===
==={{header|BaCon}}===
Using the inline loop construct.
Using the inline loop construct.
<lang bacon>PRINT LOOP$(26, CHR$(96+_))</lang>
<syntaxhighlight lang="bacon">PRINT LOOP$(26, CHR$(96+_))</syntaxhighlight>
{{out}}
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>


=={{header|Batch File}}==
=={{header|Batch File}}==
<lang dos>
<syntaxhighlight lang="dos">
@echo off
@echo off
setlocal enabledelayedexpansion
setlocal enabledelayedexpansion
Line 629: Line 629:
echo %alphabet%
echo %alphabet%
pause>nul
pause>nul
</syntaxhighlight>
</lang>
{{out}}
{{out}}
<pre>
<pre>
Line 637: Line 637:
=={{header|Befunge}}==
=={{header|Befunge}}==
The left hand side pushes the sequence 'a' to 'z' onto the stack in reverse order with a null terminator (a fairly typical Befunge pattern). The right hand side is just printing it out again to test.
The left hand side pushes the sequence 'a' to 'z' onto the stack in reverse order with a null terminator (a fairly typical Befunge pattern). The right hand side is just printing it out again to test.
<lang Befunge>0"z":>"a"`#v_ >:#,_$@
<syntaxhighlight lang="befunge">0"z":>"a"`#v_ >:#,_$@
^:- 1:<</lang>
^:- 1:<</syntaxhighlight>


=={{header|BQN}}==
=={{header|BQN}}==
<lang bqn>'a'+↕26</lang>
<syntaxhighlight lang="bqn">'a'+↕26</syntaxhighlight>


=={{header|Bracmat}}==
=={{header|Bracmat}}==
<lang bracmat> a:?seq:?c
<syntaxhighlight lang="bracmat"> a:?seq:?c
& whl
& whl
' ( chr$(asc$!c+1):~>z:?c
' ( chr$(asc$!c+1):~>z:?c
& !seq !c:?seq
& !seq !c:?seq
)
)
& !seq</lang>
& !seq</syntaxhighlight>


=={{header|Brainf***}}==
=={{header|Brainf***}}==


<lang bf>Make room for 26 characters
<syntaxhighlight lang="bf">Make room for 26 characters
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
Line 678: Line 678:
Print each cell
Print each cell
>[.>]
>[.>]
++++++++++. \n</lang>
++++++++++. \n</syntaxhighlight>


Uncommented:
Uncommented:
<lang bf>>>>>>>>>>>>>>>>>>>>>>>>>>>>>++++++++++++++++++++++++++[-<<[+<]
<syntaxhighlight lang="bf">>>>>>>>>>>>>>>>>>>>>>>>>>>>>++++++++++++++++++++++++++[-<<[+<]
+[>]>]<<[+++++++++++++++++++++++++++++++++++++++++++++++++++++
+[>]>]<<[+++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++<]>[.>]++++++++++.</lang>
+++++++++++++++++++++++++++++++++++++++++++<]>[.>]++++++++++.</syntaxhighlight>


A smaller and faster solution:
A smaller and faster solution:


<lang bf>++++++++++++++++++++++++++ >
<syntaxhighlight lang="bf">++++++++++++++++++++++++++ >
++++++++++++++++++++++++++ ++++++
++++++++++++++++++++++++++ ++++++
++++++++++++++++++++++++++ ++++++
++++++++++++++++++++++++++ ++++++
++++++++++++++++++++++++++ ++++++
++++++++++++++++++++++++++ ++++++
< [ - > + . < ]</lang>
< [ - > + . < ]</syntaxhighlight>


{{out}}
{{out}}
Line 697: Line 697:


=={{header|Burlesque}}==
=={{header|Burlesque}}==
<lang burlesque>blsq ) @azr\sh
<syntaxhighlight lang="burlesque">blsq ) @azr\sh
abcdefghijklmnopqrstuvwxyz</lang>
abcdefghijklmnopqrstuvwxyz</syntaxhighlight>


=={{header|C}}==
=={{header|C}}==
<lang c>#include <stdlib.h>
<syntaxhighlight lang="c">#include <stdlib.h>


#define N 26
#define N 26
Line 714: Line 714:
return EXIT_SUCCESS;
return EXIT_SUCCESS;
}
}
</syntaxhighlight>
</lang>


=={{header|C sharp}}==
=={{header|C sharp}}==
Simple Linq 1 liner solution
Simple Linq 1 liner solution
<lang csharp>using System;
<syntaxhighlight lang="csharp">using System;
using System.Linq;
using System.Linq;


Line 727: Line 727:
Console.WriteLine(String.Concat(Enumerable.Range('a', 26).Select(c => (char)c)));
Console.WriteLine(String.Concat(Enumerable.Range('a', 26).Select(c => (char)c)));
}
}
}</lang>{{Output}}<pre>abcdefghijklmnopqrstuvwxyz</pre>
}</syntaxhighlight>{{Output}}<pre>abcdefghijklmnopqrstuvwxyz</pre>


Old style Property and enumerable based solution
Old style Property and enumerable based solution
<lang csharp>namespace RosettaCode.GenerateLowerCaseASCIIAlphabet
<syntaxhighlight lang="csharp">namespace RosettaCode.GenerateLowerCaseASCIIAlphabet
{
{
using System;
using System;
Line 753: Line 753:
}
}
}
}
}</lang>{{Output}}<pre>abcdefghijklmnopqrstuvwxyz</pre>
}</syntaxhighlight>{{Output}}<pre>abcdefghijklmnopqrstuvwxyz</pre>


=={{header|C++}}==
=={{header|C++}}==
C++ can do the task in the identical way as C, or else, it can use a STL function.
C++ can do the task in the identical way as C, or else, it can use a STL function.
{{works with|C++11}}
{{works with|C++11}}
<lang cpp>#include <string>
<syntaxhighlight lang="cpp">#include <string>
#include <numeric>
#include <numeric>


Line 765: Line 765:


std::iota(lower.begin(), lower.end(), 'a');
std::iota(lower.begin(), lower.end(), 'a');
}</lang>
}</syntaxhighlight>


=={{header|Clojure}}==
=={{header|Clojure}}==
<lang clojure>(map char (range (int \a) (inc (int \z))))</lang>
<syntaxhighlight lang="clojure">(map char (range (int \a) (inc (int \z))))</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 775: Line 775:


=={{header|CLU}}==
=={{header|CLU}}==
<lang clu>alph = proc () returns (string)
<syntaxhighlight lang="clu">alph = proc () returns (string)
a: int := char$c2i('a')
a: int := char$c2i('a')
letters: array[char] := array[char]$predict(1,26)
letters: array[char] := array[char]$predict(1,26)
Line 787: Line 787:
start_up = proc ()
start_up = proc ()
stream$putl(stream$primary_output(), alph())
stream$putl(stream$primary_output(), alph())
end start_up</lang>
end start_up</syntaxhighlight>
{{out}}
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>
=={{header|COBOL}}==
=={{header|COBOL}}==
Strings in COBOL are mutable and can be subscripted: each time we go round the loop, we assign to a one-character-long section of the string we are building.
Strings in COBOL are mutable and can be subscripted: each time we go round the loop, we assign to a one-character-long section of the string we are building.
<lang cobol>identification division.
<syntaxhighlight lang="cobol">identification division.
program-id. lower-case-alphabet-program.
program-id. lower-case-alphabet-program.
data division.
data division.
Line 808: Line 808:
add-next-letter-paragraph.
add-next-letter-paragraph.
add 97 to loop-counter giving character-code.
add 97 to loop-counter giving character-code.
move function char(character-code) to lower-case-alphabet(loop-counter:1).</lang>
move function char(character-code) to lower-case-alphabet(loop-counter:1).</syntaxhighlight>
{{out}}
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>


=={{header|CoffeeScript}}==
=={{header|CoffeeScript}}==
<lang coffeescript>
<syntaxhighlight lang="coffeescript">
(String.fromCharCode(x) for x in [97..122])
(String.fromCharCode(x) for x in [97..122])
</syntaxhighlight>
</lang>


=={{header|Comal}}==
=={{header|Comal}}==
<lang comal>dim alphabet$ of 26
<syntaxhighlight lang="comal">dim alphabet$ of 26
for i := 1 to 26
for i := 1 to 26
alphabet$(i) := chr$(ord("a") - 1 + i)
alphabet$(i) := chr$(ord("a") - 1 + i)
endfor i
endfor i
print alphabet$</lang>
print alphabet$</syntaxhighlight>
{{Out}}
{{Out}}
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>
Line 828: Line 828:
=={{header|Common Lisp}}==
=={{header|Common Lisp}}==
<nowiki>;; as a list</nowiki>
<nowiki>;; as a list</nowiki>
<lang lisp>(defvar *lower*
<syntaxhighlight lang="lisp">(defvar *lower*
(loop with a = (char-code #\a)
(loop with a = (char-code #\a)
for i below 26
for i below 26
collect (code-char (+ a i))))</lang>
collect (code-char (+ a i))))</syntaxhighlight>


<nowiki>;; as a string</nowiki>
<nowiki>;; as a string</nowiki>
<lang lisp>(defvar *lowercase-alphabet-string*
<syntaxhighlight lang="lisp">(defvar *lowercase-alphabet-string*
(map 'string #'code-char (loop
(map 'string #'code-char (loop
for c from (char-code #\a) to (char-code #\z)
for c from (char-code #\a) to (char-code #\z)
collect c))
collect c))
"The 26 lower case letters in alphabetical order.")</lang>
"The 26 lower case letters in alphabetical order.")</syntaxhighlight>


<nowiki>;; verify</nowiki>
<nowiki>;; verify</nowiki>
<lang lisp>(assert (= 26 (length *lowercase-alphabet-string*) (length *lower*)))
<syntaxhighlight lang="lisp">(assert (= 26 (length *lowercase-alphabet-string*) (length *lower*)))
(assert (every #'char< *lowercase-alphabet-string* (subseq *lowercase-alphabet-string* 1)))
(assert (every #'char< *lowercase-alphabet-string* (subseq *lowercase-alphabet-string* 1)))
(assert (apply #'char< *lower*))
(assert (apply #'char< *lower*))
(assert (string= *lowercase-alphabet-string* (coerce *lower* 'string)))</lang>
(assert (string= *lowercase-alphabet-string* (coerce *lower* 'string)))</syntaxhighlight>


=={{header|Cowgol}}==
=={{header|Cowgol}}==
<lang cowgol>include "cowgol.coh";
<syntaxhighlight lang="cowgol">include "cowgol.coh";


# Generate the alphabet and store it at the given location
# Generate the alphabet and store it at the given location
Line 864: Line 864:
# Use the subroutine to print the alphabet
# Use the subroutine to print the alphabet
var buf: uint8[27]; # make room for the alphabet
var buf: uint8[27]; # make room for the alphabet
print(alph(&buf as [uint8]));</lang>
print(alph(&buf as [uint8]));</syntaxhighlight>


{{out}}
{{out}}
Line 872: Line 872:
=={{header|D}}==
=={{header|D}}==
The lower case ASCII letters of the Phobos standard library:
The lower case ASCII letters of the Phobos standard library:
<lang d>import std.ascii: lowercase;
<syntaxhighlight lang="d">import std.ascii: lowercase;


void main() {}</lang>
void main() {}</syntaxhighlight>


The generation of the ASCII alphabet array:
The generation of the ASCII alphabet array:
<lang d>void main() {
<syntaxhighlight lang="d">void main() {
char['z' - 'a' + 1] arr;
char['z' - 'a' + 1] arr;


foreach (immutable i, ref c; arr)
foreach (immutable i, ref c; arr)
c = 'a' + i;
c = 'a' + i;
}</lang>
}</syntaxhighlight>


An alternative version:
An alternative version:
<lang d>void main() {
<syntaxhighlight lang="d">void main() {
import std.range, std.algorithm, std.array;
import std.range, std.algorithm, std.array;


char[26] arr = 26.iota.map!(i => cast(char)('a' + i)).array;
char[26] arr = 26.iota.map!(i => cast(char)('a' + i)).array;
}</lang>
}</syntaxhighlight>
Another version:
Another version:
<lang d>void main() {
<syntaxhighlight lang="d">void main() {
char[] arr;
char[] arr;


Line 898: Line 898:


assert(arr == "abcdefghijklmnopqrstuvwxyz");
assert(arr == "abcdefghijklmnopqrstuvwxyz");
}</lang>
}</syntaxhighlight>


=={{header|dc}}==
=={{header|dc}}==
Construct the numerical representation of the desired output and print it.
Construct the numerical representation of the desired output and print it.
<lang dc>122 [ d 1 - d 97<L 256 * + ] d sL x P</lang>
<syntaxhighlight lang="dc">122 [ d 1 - d 97<L 256 * + ] d sL x P</syntaxhighlight>
Output:
Output:
<pre>
<pre>
Line 909: Line 909:


=={{header|Delphi}}==
=={{header|Delphi}}==
<lang delphi>program atoz;
<syntaxhighlight lang="delphi">program atoz;


var
var
Line 919: Line 919:
write(ch);
write(ch);
end;
end;
end.</lang>{{Output}}<pre>abcdefghijklmnopqrstuvwxyz</pre>
end.</syntaxhighlight>{{Output}}<pre>abcdefghijklmnopqrstuvwxyz</pre>


=={{header|Draco}}==
=={{header|Draco}}==
<lang draco>/* Generate the lowercase alphabet and store it in a buffer */
<syntaxhighlight lang="draco">/* Generate the lowercase alphabet and store it in a buffer */
proc alph(*char buf) *char:
proc alph(*char buf) *char:
channel output text ch;
channel output text ch;
Line 938: Line 938:
[27] char buf; /* one byte extra for the string terminator */
[27] char buf; /* one byte extra for the string terminator */
writeln(alph(&buf[0]))
writeln(alph(&buf[0]))
corp</lang>
corp</syntaxhighlight>
{{out}}
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>
Line 946: Line 946:
In DUP, strings between double quotes are stored in a numerically addressed array. The integer before the first <code>"</code> which gets pushed on the data stack, defines the cell address in which the ASCII value of first character of the string will be stored. All following characters will be stored like an array as values in the following cells. At the end, DUP pushes the length of the string on the data stack.
In DUP, strings between double quotes are stored in a numerically addressed array. The integer before the first <code>"</code> which gets pushed on the data stack, defines the cell address in which the ASCII value of first character of the string will be stored. All following characters will be stored like an array as values in the following cells. At the end, DUP pushes the length of the string on the data stack.


<lang DUP>0"abcdefghijklmnopqrstuvwxyz" {store character values of string in cells 0..length of string-1}
<syntaxhighlight lang="dup">0"abcdefghijklmnopqrstuvwxyz" {store character values of string in cells 0..length of string-1}
26[$][^^-;,1-]# {Loop from 26-26 to 26-0, print the respective cell contents to STDOUT}</lang>
26[$][^^-;,1-]# {Loop from 26-26 to 26-0, print the respective cell contents to STDOUT}</syntaxhighlight>


Output:
Output:
Line 957: Line 957:
Generates a lazy sequence and prints it to a standard output:
Generates a lazy sequence and prints it to a standard output:


<lang dyalect>print << ('a'..'z').ToArray()</lang>
<syntaxhighlight lang="dyalect">print << ('a'..'z').ToArray()</syntaxhighlight>


=={{header|EchoLisp}}==
=={{header|EchoLisp}}==
<lang scheme>
<syntaxhighlight lang="scheme">
;; 1)
;; 1)
(define \a (first (string->unicode "a")))
(define \a (first (string->unicode "a")))
Line 975: Line 975:
(for/string ((letter ["a" .. "z"])) letter)
(for/string ((letter ["a" .. "z"])) letter)
→ abcdefghijklmnopqrstuvwxyz
→ abcdefghijklmnopqrstuvwxyz
</syntaxhighlight>
</lang>


=={{header|Elena}}==
=={{header|Elena}}==
ELENA 5.0 :
ELENA 5.0 :
<lang elena>import extensions;
<syntaxhighlight lang="elena">import extensions;
import system'collections;
import system'collections;
Line 1,020: Line 1,020:
{
{
console.printLine(Alphabet)
console.printLine(Alphabet)
}</lang>
}</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 1,027: Line 1,027:


=={{header|Elixir}}==
=={{header|Elixir}}==
<lang elixir>iex(1)> Enum.to_list(?a .. ?z)
<syntaxhighlight lang="elixir">iex(1)> Enum.to_list(?a .. ?z)
'abcdefghijklmnopqrstuvwxyz'
'abcdefghijklmnopqrstuvwxyz'
iex(2)> Enum.to_list(?a .. ?z) |> List.to_string
iex(2)> Enum.to_list(?a .. ?z) |> List.to_string
"abcdefghijklmnopqrstuvwxyz"</lang>
"abcdefghijklmnopqrstuvwxyz"</syntaxhighlight>


=={{header|Erlang}}==
=={{header|Erlang}}==
<lang erlang>lists:seq($a,$z).</lang>
<syntaxhighlight lang="erlang">lists:seq($a,$z).</syntaxhighlight>


{{Output}}
{{Output}}
Line 1,046: Line 1,046:


{{Works with|Office 365 betas 2021}}
{{Works with|Office 365 betas 2021}}
<lang lisp>showAlphabet
<syntaxhighlight lang="lisp">showAlphabet
=LAMBDA(az,
=LAMBDA(az,
ENUMFROMTOCHAR(
ENUMFROMTOCHAR(
Line 1,053: Line 1,053:
MID(az, 2, 1)
MID(az, 2, 1)
)
)
)</lang>
)</syntaxhighlight>


and also assuming the following generic binding in the Name Manager for the WorkBook:
and also assuming the following generic binding in the Name Manager for the WorkBook:


<lang lisp>ENUMFROMTOCHAR
<syntaxhighlight lang="lisp">ENUMFROMTOCHAR
=LAMBDA(a,
=LAMBDA(a,
LAMBDA(z,
LAMBDA(z,
Line 1,078: Line 1,078:
)
)
)
)
)</lang>
)</syntaxhighlight>


{{Out}}
{{Out}}
Line 1,329: Line 1,329:


=={{header|F_Sharp|F#}}==
=={{header|F_Sharp|F#}}==
<lang fsharp>let lower = ['a'..'z']
<syntaxhighlight lang="fsharp">let lower = ['a'..'z']


printfn "%A" lower</lang>
printfn "%A" lower</syntaxhighlight>


=={{header|Factor}}==
=={{header|Factor}}==
Strings are represented as fixed-size mutable sequences of Unicode code points.
Strings are represented as fixed-size mutable sequences of Unicode code points.


<lang factor>USING: spelling ; ! ALPHABET
<syntaxhighlight lang="factor">USING: spelling ; ! ALPHABET


ALPHABET print
ALPHABET print
Line 1,342: Line 1,342:
: russian-alphabet-without-io ( -- str ) 0x0430 0x0450 [a,b) >string ;
: russian-alphabet-without-io ( -- str ) 0x0430 0x0450 [a,b) >string ;
: russian-alphabet ( -- str ) 0x0451 6 russian-alphabet-without-io insert-nth ;
: russian-alphabet ( -- str ) 0x0451 6 russian-alphabet-without-io insert-nth ;
russian-alphabet print</lang>
russian-alphabet print</syntaxhighlight>
{{out}}
{{out}}
<pre>abcdefghijklmnopqrstuvwxyz
<pre>abcdefghijklmnopqrstuvwxyz
Line 1,349: Line 1,349:


=={{header|FALSE}}==
=={{header|FALSE}}==
<lang FALSE>'a[$'z>~][$,1+]#%</lang>
<syntaxhighlight lang="false">'a[$'z>~][$,1+]#%</syntaxhighlight>


{{Out}}
{{Out}}
Line 1,355: Line 1,355:


=={{header|Fermat}}==
=={{header|Fermat}}==
<lang fermat>Array locase[1,26];
<syntaxhighlight lang="fermat">Array locase[1,26];
[locase]:=[<i=1,26>'a'+i-1];
[locase]:=[<i=1,26>'a'+i-1];
!([locase:char);</lang>
!([locase:char);</syntaxhighlight>
{{out}}<pre>abcdefghijklmnopqrstuvwxyz</pre>
{{out}}<pre>abcdefghijklmnopqrstuvwxyz</pre>


=={{header|Forth}}==
=={{header|Forth}}==
Generate a string filled with the lowercase ASCII alphabet
Generate a string filled with the lowercase ASCII alphabet
<lang Forth>: printit 26 0 do [char] a I + emit loop ;</lang>
<syntaxhighlight lang="forth">: printit 26 0 do [char] a I + emit loop ;</syntaxhighlight>
Or coded another way
Or coded another way
<lang Forth>: printit2 [char] z 1+ [char] a do I emit loop ;</lang>
<syntaxhighlight lang="forth">: printit2 [char] z 1+ [char] a do I emit loop ;</syntaxhighlight>


We could do something more complicated and allocate space for a string and fill it.
We could do something more complicated and allocate space for a string and fill it.
Two methods are demonstrated below
Two methods are demonstrated below


<lang>create lalpha 27 chars allot \ create a string in memory for 26 letters and count byte
<syntaxhighlight lang="text">create lalpha 27 chars allot \ create a string in memory for 26 letters and count byte


: ]lalpha ( index -- addr ) \ index the string like an array (return an address)
: ]lalpha ( index -- addr ) \ index the string like an array (return an address)
Line 1,387: Line 1,387:
: Loadit s" abcdefghijklmnopqrstuvwxyz" lalpha PLACE ;
: Loadit s" abcdefghijklmnopqrstuvwxyz" lalpha PLACE ;


</syntaxhighlight>
</lang>


{{Output}}Test at the console
{{Output}}Test at the console
<lang>printit abcdefghijklmnopqrstuvwxyz ok
<syntaxhighlight lang="text">printit abcdefghijklmnopqrstuvwxyz ok


fillit ok
fillit ok
Line 1,398: Line 1,398:
loadit ok
loadit ok
lalpha count type abcdefghijklmnopqrstuvwxyz ok
lalpha count type abcdefghijklmnopqrstuvwxyz ok
</syntaxhighlight>
</lang>


=={{header|Fortran}}==
=={{header|Fortran}}==
{{works with|Fortran|90 and later}}
{{works with|Fortran|90 and later}}
<lang fortran> character(26) :: alpha
<syntaxhighlight lang="fortran"> character(26) :: alpha
integer :: i
integer :: i


do i = 1, 26
do i = 1, 26
alpha(i:i) = achar(iachar('a') + i - 1)
alpha(i:i) = achar(iachar('a') + i - 1)
end do</lang>
end do</syntaxhighlight>


=={{header|Free Pascal}}==
=={{header|Free Pascal}}==
One can use ''set constructors'' like in [[#Delphi|Delphi]].
One can use ''set constructors'' like in [[#Delphi|Delphi]].
<tt>alphabet</tt>’s type will be <tt>set of char</tt>.
<tt>alphabet</tt>’s type will be <tt>set of char</tt>.
<lang pascal>program lowerCaseAscii(input, output, stdErr);
<syntaxhighlight lang="pascal">program lowerCaseAscii(input, output, stdErr);
const
const
alphabet = ['a'..'z'];
alphabet = ['a'..'z'];
begin
begin
end.</lang>
end.</syntaxhighlight>
Note, Pascal does not define that the letters A through Z are contiguous, the set constructor above assumes that, though.
Note, Pascal does not define that the letters A through Z are contiguous, the set constructor above assumes that, though.
However, the FPC – the FreePascal compiler – virtually only works on systems, that use at least ASCII as common denominator.
However, the FPC – the FreePascal compiler – virtually only works on systems, that use at least ASCII as common denominator.
Line 1,422: Line 1,422:
=={{header|Frink}}==
=={{header|Frink}}==
The following produces a lazy enumerating sequence of the characters.
The following produces a lazy enumerating sequence of the characters.
<lang frink>map["char", char["a"] to char["z"]]</lang>
<syntaxhighlight lang="frink">map["char", char["a"] to char["z"]]</syntaxhighlight>
To produce a non-lazy array of the characters, you can wrap the above in a <CODE>toArray</CODE> call:
To produce a non-lazy array of the characters, you can wrap the above in a <CODE>toArray</CODE> call:
<lang frink>toArray[map["char", char["a"] to char["z"]]]</lang>
<syntaxhighlight lang="frink">toArray[map["char", char["a"] to char["z"]]]</syntaxhighlight>


=={{header|Furor}}==
=={{header|Furor}}==
<syntaxhighlight lang="furor">
<lang Furor>
#k 'a 'z ++ {|| {} print SPACE |} NL end
#k 'a 'z ++ {|| {} print SPACE |} NL end
</syntaxhighlight>
</lang>
{{out}}
{{out}}
<pre>
<pre>
Line 1,437: Line 1,437:
=={{header|Gambas}}==
=={{header|Gambas}}==
'''[https://gambas-playground.proko.eu/?gist=debd3987d4db75099032a86927978046 Click this link to run this code]'''
'''[https://gambas-playground.proko.eu/?gist=debd3987d4db75099032a86927978046 Click this link to run this code]'''
<lang gambas>Public Sub Main()
<syntaxhighlight lang="gambas">Public Sub Main()
Dim siCount As Short
Dim siCount As Short


Line 1,444: Line 1,444:
Next
Next


End</lang>
End</syntaxhighlight>
Output:
Output:
<pre>
<pre>
Line 1,451: Line 1,451:


=={{header|Go}}==
=={{header|Go}}==
<lang go>func loweralpha() string {
<syntaxhighlight lang="go">func loweralpha() string {
p := make([]byte, 26)
p := make([]byte, 26)
for i := range p {
for i := range p {
Line 1,457: Line 1,457:
}
}
return string(p)
return string(p)
}</lang>
}</syntaxhighlight>


=={{header|Groovy}}==
=={{header|Groovy}}==
<lang groovy>def lower = ('a'..'z')</lang>
<syntaxhighlight lang="groovy">def lower = ('a'..'z')</syntaxhighlight>
Test
Test
<lang groovy>assert 'abcdefghijklmnopqrstuvwxyz' == lower.join('')</lang>
<syntaxhighlight lang="groovy">assert 'abcdefghijklmnopqrstuvwxyz' == lower.join('')</syntaxhighlight>


=={{header|Haskell}}==
=={{header|Haskell}}==
<lang haskell>lower = ['a' .. 'z']
<syntaxhighlight lang="haskell">lower = ['a' .. 'z']


main = print lower</lang>
main = print lower</syntaxhighlight>


Or, equivalently:
Or, equivalently:
<lang haskell>alpha :: String
<syntaxhighlight lang="haskell">alpha :: String
alpha = enumFromTo 'a' 'z'
alpha = enumFromTo 'a' 'z'


main :: IO ()
main :: IO ()
main = print alpha</lang>
main = print alpha</syntaxhighlight>


{{Out}}
{{Out}}
Line 1,480: Line 1,480:


=={{header|Huginn}}==
=={{header|Huginn}}==
<lang huginn>import Algorithms as algo;
<syntaxhighlight lang="huginn">import Algorithms as algo;
import Text as text;
import Text as text;


Line 1,500: Line 1,500:
)
)
);
);
}</lang>
}</syntaxhighlight>
{{Out}}
{{Out}}
<pre>abcdefghijklmnopqrstuvwxyz
<pre>abcdefghijklmnopqrstuvwxyz
Line 1,512: Line 1,512:


E.g.
E.g.
<lang unicon>every a := put([], !&lcase) # array of 1 character per element
<syntaxhighlight lang="unicon">every a := put([], !&lcase) # array of 1 character per element
c := create !&lcase # lazy generation of letters in sequence</lang>
c := create !&lcase # lazy generation of letters in sequence</syntaxhighlight>


<lang icon>
<syntaxhighlight lang="icon">
procedure lower_case_letters() # entry point for function lower_case_letters
procedure lower_case_letters() # entry point for function lower_case_letters
return &lcase # returning lower caser letters represented by the set &lcase
return &lcase # returning lower caser letters represented by the set &lcase
Line 1,523: Line 1,523:
write(lower_case_letters()) # output of result of function lower_case_letters()
write(lower_case_letters()) # output of result of function lower_case_letters()
end
end
</syntaxhighlight>
</lang>


=={{header|J}}==
=={{header|J}}==
'''Solution''':<lang j> thru=: <. + i.@(+*)@-~
'''Solution''':<syntaxhighlight lang="j"> thru=: <. + i.@(+*)@-~
thru&.(a.&i.)/'az'
thru&.(a.&i.)/'az'
abcdefghijklmnopqrstuvwxyz</lang>
abcdefghijklmnopqrstuvwxyz</syntaxhighlight>
or<lang J> u:97+i.26
or<syntaxhighlight lang="j"> u:97+i.26
abcdefghijklmnopqrstuvwxyz</lang>
abcdefghijklmnopqrstuvwxyz</syntaxhighlight>
or<lang J> ([-.toupper)a.
or<syntaxhighlight lang="j"> ([-.toupper)a.
abcdefghijklmnopqrstuvwxyz</lang>
abcdefghijklmnopqrstuvwxyz</syntaxhighlight>
and, obviously, other variations are possible.
and, obviously, other variations are possible.


=={{header|Java}}==
=={{header|Java}}==
<lang java>public class LowerAscii {
<syntaxhighlight lang="java">public class LowerAscii {


public static void main(String[] args) {
public static void main(String[] args) {
Line 1,544: Line 1,544:
System.out.printf("lower ascii: %s, length: %s", sb, sb.length());
System.out.printf("lower ascii: %s, length: %s", sb, sb.length());
}
}
}</lang>
}</syntaxhighlight>


Output:
Output:
Line 1,558: Line 1,558:
For Unicode characters beyond this range, in ES5 we have to enter a pair of Unicode number escapes.
For Unicode characters beyond this range, in ES5 we have to enter a pair of Unicode number escapes.


<lang JavaScript>(function (cFrom, cTo) {
<syntaxhighlight lang="javascript">(function (cFrom, cTo) {


function cRange(cFrom, cTo) {
function cRange(cFrom, cTo) {
Line 1,574: Line 1,574:
return cRange(cFrom, cTo);
return cRange(cFrom, cTo);


})('a', 'z');</lang>
})('a', 'z');</syntaxhighlight>


Returns:
Returns:
<lang JavaScript>["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]</lang>
<syntaxhighlight lang="javascript">["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]</syntaxhighlight>


===ES6===
===ES6===
Line 1,583: Line 1,583:
In ES6, the new '''String.fromCodePoint()''' method can can return 4-byte characters (such as Emoji, for example) as well as the usual 2-byte characters.
In ES6, the new '''String.fromCodePoint()''' method can can return 4-byte characters (such as Emoji, for example) as well as the usual 2-byte characters.


<lang JavaScript>(function (lstRanges) {
<syntaxhighlight lang="javascript">(function (lstRanges) {


function cRange(cFrom, cTo) {
function cRange(cFrom, cTo) {
Line 1,604: Line 1,604:
['a', 'z'],
['a', 'z'],
['🐐', '🐟']
['🐐', '🐟']
]);</lang>
]);</syntaxhighlight>


Output:
Output:


<lang JavaScript>[["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"],
<syntaxhighlight lang="javascript">[["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"],
["🐐", "🐑", "🐒", "🐓", "🐔", "🐕", "🐖", "🐗", "🐘", "🐙", "🐚", "🐛", "🐜", "🐝", "🐞", "🐟"]]</lang>
["🐐", "🐑", "🐒", "🐓", "🐔", "🐕", "🐖", "🐗", "🐘", "🐙", "🐚", "🐛", "🐜", "🐝", "🐞", "🐟"]]</syntaxhighlight>


{{works with|ECMAScript|6}}
{{works with|ECMAScript|6}}
<lang JavaScript>var letters = []
<syntaxhighlight lang="javascript">var letters = []
for (var i = 97; i <= 122; i++) {
for (var i = 97; i <= 122; i++) {
letters.push(String.fromCodePoint(i))
letters.push(String.fromCodePoint(i))
}</lang>
}</syntaxhighlight>


Or, if we want to write a more general ES6 function:
Or, if we want to write a more general ES6 function:


<lang JavaScript>(() => {
<syntaxhighlight lang="javascript">(() => {
// enumFromTo :: Enum a => a -> a -> [a]
// enumFromTo :: Enum a => a -> a -> [a]
const enumFromTo = (m, n) => {
const enumFromTo = (m, n) => {
Line 1,673: Line 1,673:
['🐐', '🐟']
['🐐', '🐟']
]));
]));
})();</lang>
})();</syntaxhighlight>
{{Out}}
{{Out}}
<pre>a b c d e f g h i j k l m n o p q r s t u v w x y z
<pre>a b c d e f g h i j k l m n o p q r s t u v w x y z
Line 1,681: Line 1,681:


=={{header|jq}}==
=={{header|jq}}==
<lang jq>"az" | explode | [range( .[0]; 1+.[1] )] | implode'</lang>
<syntaxhighlight lang="jq">"az" | explode | [range( .[0]; 1+.[1] )] | implode'</syntaxhighlight>
produces:
produces:


Line 1,687: Line 1,687:


=={{header|Jsish}}==
=={{header|Jsish}}==
<lang javascript>/* Generate the lower case alphabet with Jsish, assume ASCII */
<syntaxhighlight lang="javascript">/* Generate the lower case alphabet with Jsish, assume ASCII */
var letterA = "a".charCodeAt(0);
var letterA = "a".charCodeAt(0);
var lowers = Array(26);
var lowers = Array(26);
Line 1,703: Line 1,703:
26
26
=!EXPECTEND!=
=!EXPECTEND!=
*/</lang>
*/</syntaxhighlight>


{{out}}
{{out}}
Line 1,716: Line 1,716:
{{works with|Julia|0.6}}
{{works with|Julia|0.6}}


<lang julia>@show collect('a':'z')
<syntaxhighlight lang="julia">@show collect('a':'z')
@show join('a':'z')</lang>
@show join('a':'z')</syntaxhighlight>


{{out}}
{{out}}
Line 1,725: Line 1,725:
=={{header|K}}==
=={{header|K}}==
<tt>`c$</tt> casts a list of integers to a string of characters; <tt>!26</tt> produces a list of the integers from 0 to 25. So the lower-case ASCII alphabet can be generated using:
<tt>`c$</tt> casts a list of integers to a string of characters; <tt>!26</tt> produces a list of the integers from 0 to 25. So the lower-case ASCII alphabet can be generated using:
<lang k>`c$97+!26</lang>
<syntaxhighlight lang="k">`c$97+!26</syntaxhighlight>
{{out}}
{{out}}
<pre>"abcdefghijklmnopqrstuvwxyz"</pre>
<pre>"abcdefghijklmnopqrstuvwxyz"</pre>


=={{header|Keg}}==
=={{header|Keg}}==
<lang keg>a(55*|:1+)</lang>
<syntaxhighlight lang="keg">a(55*|:1+)</syntaxhighlight>


=={{header|Kotlin}}==
=={{header|Kotlin}}==
<lang scala>// version 1.3.72
<syntaxhighlight lang="scala">// version 1.3.72


fun main() {
fun main() {
Line 1,739: Line 1,739:


println(alphabet)
println(alphabet)
}</lang>
}</syntaxhighlight>


{{out}}
{{out}}
Line 1,747: Line 1,747:


=={{header|Lambdatalk}}==
=={{header|Lambdatalk}}==
<lang scheme>
<syntaxhighlight lang="scheme">


1) We define code2char & char2code as primitives:
1) We define code2char & char2code as primitives:
Line 1,770: Line 1,770:
{S.map code2char {S.serie {char2code 0} {char2code 9}}}
{S.map code2char {S.serie {char2code 0} {char2code 9}}}
-> 0 1 2 3 4 5 6 7 8 9
-> 0 1 2 3 4 5 6 7 8 9
</syntaxhighlight>
</lang>


=={{header|LC3 Assembly}}==
=={{header|LC3 Assembly}}==
<lang lc3asm> .ORIG 0x3000
<syntaxhighlight lang="lc3asm"> .ORIG 0x3000


LD R0,ASCIIa
LD R0,ASCIIa
Line 1,787: Line 1,787:


ASCIIa .FILL 0x61
ASCIIa .FILL 0x61
ASCIIz .FILL 0x7A</lang>
ASCIIz .FILL 0x7A</syntaxhighlight>
Output:
Output:
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>


=={{header|Lingo}}==
=={{header|Lingo}}==
<lang lingo>alphabet = []
<syntaxhighlight lang="lingo">alphabet = []
repeat with i = 97 to 122
repeat with i = 97 to 122
alphabet.add(numtochar(i))
alphabet.add(numtochar(i))
end repeat
end repeat
put alphabet
put alphabet
-- ["a", "b", "c", ... , "x", "y", "z"]</lang>
-- ["a", "b", "c", ... , "x", "y", "z"]</syntaxhighlight>


=={{header|Logo}}==
=={{header|Logo}}==
Straightforward, assuming ASCII:
Straightforward, assuming ASCII:
<lang logo>show map "char iseq 97 122</lang>
<syntaxhighlight lang="logo">show map "char iseq 97 122</syntaxhighlight>
Slightly less straightforward, but without the magic numbers:
Slightly less straightforward, but without the magic numbers:
<lang logo>show map "char apply "iseq map "ascii [a z]</lang>
<syntaxhighlight lang="logo">show map "char apply "iseq map "ascii [a z]</syntaxhighlight>
Same output either way:
Same output either way:
{{Out}}
{{Out}}
Line 1,810: Line 1,810:
=={{header|Lua}}==
=={{header|Lua}}==
===to table===
===to table===
<lang Lua>function getAlphabet ()
<syntaxhighlight lang="lua">function getAlphabet ()
local letters = {}
local letters = {}
for ascii = 97, 122 do table.insert(letters, string.char(ascii)) end
for ascii = 97, 122 do table.insert(letters, string.char(ascii)) end
Line 1,817: Line 1,817:


local alpha = getAlphabet()
local alpha = getAlphabet()
print(alpha[25] .. alpha[1] .. alpha[25]) </lang>
print(alpha[25] .. alpha[1] .. alpha[25]) </syntaxhighlight>
{{Out}}
{{Out}}
<pre>yay</pre>
<pre>yay</pre>


===to string===
===to string===
<lang Lua>#!/usr/bin/env luajit
<syntaxhighlight lang="lua">#!/usr/bin/env luajit
local function ascii(f,t) local tab={} for i=f,t do tab[#tab+1]=string.char(i) end
local function ascii(f,t) local tab={} for i=f,t do tab[#tab+1]=string.char(i) end
return table.concat(tab)
return table.concat(tab)
end
end
print(ascii(97,122))</lang>
print(ascii(97,122))</syntaxhighlight>
{{Out}}
{{Out}}
<pre>> ./lowercaseascii.lua
<pre>> ./lowercaseascii.lua
Line 1,832: Line 1,832:


=={{header|M2000 Interpreter}}==
=={{header|M2000 Interpreter}}==
<syntaxhighlight lang="m2000 interpreter">
<lang M2000 Interpreter>
\\ old style Basic, including a Binary.Or() function
\\ old style Basic, including a Binary.Or() function
Module OldStyle {
Module OldStyle {
Line 1,842: Line 1,842:
}
}
CALL OldStyle
CALL OldStyle
</syntaxhighlight>
</lang>


=={{header|Maple}}==
=={{header|Maple}}==
<lang Maple>seq(StringTools:-Char(c), c = 97 .. 122);</lang>
<syntaxhighlight lang="maple">seq(StringTools:-Char(c), c = 97 .. 122);</syntaxhighlight>
{{Out}}
{{Out}}
<pre>"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"</pre>
<pre>"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"</pre>
Line 1,862: Line 1,862:
'''Method 1''': Using a Range Variable.
'''Method 1''': Using a Range Variable.


<syntaxhighlight lang="mathcad">
<lang Mathcad>
-- user-defined function that returns the ASCII code for string character ch.
-- user-defined function that returns the ASCII code for string character ch.
code(ch):=str2vec(ch)[0
code(ch):=str2vec(ch)[0
Line 1,883: Line 1,883:


-- Characters are indexable within the string; for example: substr(lcString,3,1)="d"
-- Characters are indexable within the string; for example: substr(lcString,3,1)="d"
</lang>
</syntaxhighlight>


'''Method 2''': Using a Function.
'''Method 2''': Using a Function.


<syntaxhighlight lang="mathcad">
<lang Mathcad>
-- Mathcad Express lacks the programming capability of Mathcad Prime, so uses the built-in if function to implement a recursive solution (if(predicate,true expr, false expr)).
-- Mathcad Express lacks the programming capability of Mathcad Prime, so uses the built-in if function to implement a recursive solution (if(predicate,true expr, false expr)).


Line 1,902: Line 1,902:
charseq(code("α"),code("ω"))="αβγδεζηθικλμνξοπρςστυφχψω"
charseq(code("α"),code("ω"))="αβγδεζηθικλμνξοπρςστυφχψω"


</syntaxhighlight>
</lang>


=={{header|Mathematica}} / {{header|Wolfram Language}}==
=={{header|Mathematica}} / {{header|Wolfram Language}}==
<lang Mathematica>start = 97;
<syntaxhighlight lang="mathematica">start = 97;
lowerCaseLetters = Table[FromCharacterCode[start + i], {i, 0, 25}]</lang>
lowerCaseLetters = Table[FromCharacterCode[start + i], {i, 0, 25}]</syntaxhighlight>
{{Out}}
{{Out}}
<pre>{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}</pre>
<pre>{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}</pre>


=={{header|MATLAB}} / {{header|Octave}}==
=={{header|MATLAB}} / {{header|Octave}}==
<lang MATLAB> 'a':'z'</lang>
<syntaxhighlight lang="matlab"> 'a':'z'</syntaxhighlight>
or alternatively
or alternatively
<lang MATLAB> char(96+[1:26])</lang>
<syntaxhighlight lang="matlab"> char(96+[1:26])</syntaxhighlight>
{{Out}}<pre> abcdefghijklmnopqrstuvwxyz</pre>
{{Out}}<pre> abcdefghijklmnopqrstuvwxyz</pre>


=={{header|Maxima}}==
=={{header|Maxima}}==
<syntaxhighlight lang="maxima">
<lang Maxima>
delete([], makelist(if(alphacharp(ascii(i))) then parse_string(ascii(i)) else [], i, 96, 122));</lang>
delete([], makelist(if(alphacharp(ascii(i))) then parse_string(ascii(i)) else [], i, 96, 122));</syntaxhighlight>
{{Out}}
{{Out}}
<pre> [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z] </pre>
<pre> [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z] </pre>


=={{header|Mercury}}==
=={{header|Mercury}}==
<lang mercury>:- module gen_lowercase_ascii.
<syntaxhighlight lang="mercury">:- module gen_lowercase_ascii.
:- interface.
:- interface.


Line 1,938: Line 1,938:
io.print_line(Alphabet, !IO).
io.print_line(Alphabet, !IO).


:- end_module gen_lowercase_ascii.</lang>
:- end_module gen_lowercase_ascii.</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 1,945: Line 1,945:


=={{header|MiniScript}}==
=={{header|MiniScript}}==
<lang MiniScript>letters = []
<syntaxhighlight lang="miniscript">letters = []
for i in range(code("a"), code("z"))
for i in range(code("a"), code("z"))
letters.push char(i)
letters.push char(i)
end for
end for


print letters</lang>
print letters</syntaxhighlight>


{{out}}
{{out}}
Line 1,956: Line 1,956:


=={{header|MIPS Assembly}}==
=={{header|MIPS Assembly}}==
<lang mips>main:
<syntaxhighlight lang="mips">main:
li $t0,'a'
li $t0,'a'
li $t1,26
li $t1,26
Line 1,968: Line 1,968:
end_program:
end_program:
j end_program ;halt the cpu - we're done
j end_program ;halt the cpu - we're done
nop</lang>
nop</syntaxhighlight>


=={{header|MUMPS}}==
=={{header|MUMPS}}==
===Caché===
===Caché===
{{works with|Caché ObjectScript}}
{{works with|Caché ObjectScript}}
<syntaxhighlight lang="mumps">
<lang MUMPS>
LOWASCMIN
LOWASCMIN
set lowstr = ""
set lowstr = ""
Line 1,979: Line 1,979:
write lowstr
write lowstr
quit
quit
</syntaxhighlight>
</lang>


{{out}}<pre>
{{out}}<pre>
Line 1,988: Line 1,988:
===Standard MUMPS===
===Standard MUMPS===
{{works with|DSM, MSM}}
{{works with|DSM, MSM}}
<syntaxhighlight lang="mumps">
<lang MUMPS>
LONG SET D=""
LONG SET D=""
FOR X=97:1:122 WRITE D,$C(X) SET D=","
FOR X=97:1:122 WRITE D,$C(X) SET D=","
Line 1,998: Line 1,998:
W !
W !
Q
Q
</syntaxhighlight>
</lang>


{{out}}<pre>
{{out}}<pre>
Line 2,008: Line 2,008:


=={{header|Nanoquery}}==
=={{header|Nanoquery}}==
<lang nanoquery>lowercase = list()
<syntaxhighlight lang="nanoquery">lowercase = list()
for i in range(ord("a"), ord("z"))
for i in range(ord("a"), ord("z"))
lowercase.append(chr(i))
lowercase.append(chr(i))
end
end
println lowercase</lang>
println lowercase</syntaxhighlight>
{{out}}
{{out}}
<pre>[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]</pre>
<pre>[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]</pre>


=={{header|Neko}}==
=={{header|Neko}}==
<syntaxhighlight lang="actionscript">/**
<lang ActionScript>/**
<doc>Generate lower case ASCII, in Neko</doc>
<doc>Generate lower case ASCII, in Neko</doc>
**/
**/
Line 2,031: Line 2,031:
}
}


$print(generated, "\n")</lang>
$print(generated, "\n")</syntaxhighlight>


{{out}}
{{out}}
Line 2,039: Line 2,039:


=={{header|NESL}}==
=={{header|NESL}}==
<lang nesl>lower_case_ascii = {code_char(c) : c in [97:123]};</lang>
<syntaxhighlight lang="nesl">lower_case_ascii = {code_char(c) : c in [97:123]};</syntaxhighlight>
=={{header|NetLogo}}==
=={{header|NetLogo}}==
====Rationale====
====Rationale====
Line 2,046: Line 2,046:
Since the phrase has duplicates and spaces, we use other list tools to produce just the sorted alphabet
Since the phrase has duplicates and spaces, we use other list tools to produce just the sorted alphabet
====Code====
====Code====
<lang netlogo>
<syntaxhighlight lang="netlogo">
to-report alphabet-lower
to-report alphabet-lower
let sample "sphinx of black quartz judge my vow"
let sample "sphinx of black quartz judge my vow"
Line 2,053: Line 2,053:
report alphabet
report alphabet
end
end
</syntaxhighlight>
</lang>
====Output====
====Output====
<pre>
<pre>
Line 2,063: Line 2,063:


=={{header|Nim}}==
=={{header|Nim}}==
<lang nim># A slice just contains the first and last value
<syntaxhighlight lang="nim"># A slice just contains the first and last value
let alpha: Slice[char] = 'a'..'z'
let alpha: Slice[char] = 'a'..'z'
echo alpha # (a: a, b: z)
echo alpha # (a: a, b: z)
Line 2,082: Line 2,082:
let alphaSeq = toSeq 'a'..'z'
let alphaSeq = toSeq 'a'..'z'
echo alphaSeq # @[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]
echo alphaSeq # @[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z]
echo alphaSeq[10] # k</lang>
echo alphaSeq[10] # k</syntaxhighlight>


=={{header|OCaml}}==
=={{header|OCaml}}==
<lang ocaml># Array.make 26 'a' |> Array.mapi (fun i c -> int_of_char c + i |> char_of_int);;
<syntaxhighlight lang="ocaml"># Array.make 26 'a' |> Array.mapi (fun i c -> int_of_char c + i |> char_of_int);;
- : char array =
- : char array =
[|'a'; 'b'; 'c'; 'd'; 'e'; 'f'; 'g'; 'h'; 'i'; 'j'; 'k'; 'l'; 'm'; 'n'; 'o';
[|'a'; 'b'; 'c'; 'd'; 'e'; 'f'; 'g'; 'h'; 'i'; 'j'; 'k'; 'l'; 'm'; 'n'; 'o';
'p'; 'q'; 'r'; 's'; 't'; 'u'; 'v'; 'w'; 'x'; 'y'; 'z'|]</lang>
'p'; 'q'; 'r'; 's'; 't'; 'u'; 'v'; 'w'; 'x'; 'y'; 'z'|]</syntaxhighlight>


=={{header|Oforth}}==
=={{header|Oforth}}==
Oforth characters are integers. This list is a list of 26 integers
Oforth characters are integers. This list is a list of 26 integers
<lang Oforth>'a' 'z' seqFrom</lang>
<syntaxhighlight lang="oforth">'a' 'z' seqFrom</syntaxhighlight>


If necessary, these integers can be added to a string to have a indexed string of chars
If necessary, these integers can be added to a string to have a indexed string of chars
<lang Oforth>StringBuffer new 'a' 'z' seqFrom apply(#<<c)</lang>
<syntaxhighlight lang="oforth">StringBuffer new 'a' 'z' seqFrom apply(#<<c)</syntaxhighlight>


=={{header|PARI/GP}}==
=={{header|PARI/GP}}==


<lang parigp>Strchr(Vecsmall([97..122]))</lang>
<syntaxhighlight lang="parigp">Strchr(Vecsmall([97..122]))</syntaxhighlight>


Output:<pre>"abcdefghijklmnopqrstuvwxyz"</pre>
Output:<pre>"abcdefghijklmnopqrstuvwxyz"</pre>


=={{header|Pascal}}==
=={{header|Pascal}}==
<lang pascal>program lowerCaseAscii(input, output, stdErr);
<syntaxhighlight lang="pascal">program lowerCaseAscii(input, output, stdErr);
var
var
alphabet: set of char;
alphabet: set of char;
Line 2,113: Line 2,113:
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
];
];
end.</lang>
end.</syntaxhighlight>


=={{header|Perl}}==
=={{header|Perl}}==
<lang Perl>print 'a'..'z'</lang>
<syntaxhighlight lang="perl">print 'a'..'z'</syntaxhighlight>


=={{header|Phix}}==
=={{header|Phix}}==
<!--<lang Phix>(phixonline)-->
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #004080;">string</span> <span style="color: #000000;">az</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""</span>
<span style="color: #004080;">string</span> <span style="color: #000000;">az</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">ch</span><span style="color: #0000FF;">=</span><span style="color: #008000;">'a'</span> <span style="color: #008080;">to</span> <span style="color: #008000;">'z'</span> <span style="color: #008080;">do</span>
<span style="color: #008080;">for</span> <span style="color: #000000;">ch</span><span style="color: #0000FF;">=</span><span style="color: #008000;">'a'</span> <span style="color: #008080;">to</span> <span style="color: #008000;">'z'</span> <span style="color: #008080;">do</span>
Line 2,126: Line 2,126:
<span style="color: #0000FF;">?</span><span style="color: #000000;">az</span>
<span style="color: #0000FF;">?</span><span style="color: #000000;">az</span>
<span style="color: #0000FF;">?</span><span style="color: #7060A8;">tagset</span><span style="color: #0000FF;">(</span><span style="color: #008000;">'z'</span><span style="color: #0000FF;">,</span><span style="color: #008000;">'a'</span><span style="color: #0000FF;">)</span>
<span style="color: #0000FF;">?</span><span style="color: #7060A8;">tagset</span><span style="color: #0000FF;">(</span><span style="color: #008000;">'z'</span><span style="color: #0000FF;">,</span><span style="color: #008000;">'a'</span><span style="color: #0000FF;">)</span>
<!--</lang>-->
<!--</syntaxhighlight>-->
Using tagset() is obviously easier, but you have to remember its parameters are (finish,start=1,step=1), that way round so that start ''can'' be omitted and default to 1 (ditto step).<br>
Using tagset() is obviously easier, but you have to remember its parameters are (finish,start=1,step=1), that way round so that start ''can'' be omitted and default to 1 (ditto step).<br>
In Phix there is really not much difference between 1..26 and 'a'..'z', and none ''at all'' between 'a'..'z' and 97..122.
In Phix there is really not much difference between 1..26 and 'a'..'z', and none ''at all'' between 'a'..'z' and 97..122.
Line 2,136: Line 2,136:


=={{header|Phixmonti}}==
=={{header|Phixmonti}}==
<lang Phixmonti>0 tolist
<syntaxhighlight lang="phixmonti">0 tolist
'a' 'z' 2 tolist
'a' 'z' 2 tolist
for
for
tochar 0 put
tochar 0 put
endfor
endfor
print</lang>
print</syntaxhighlight>
Simplest
Simplest
<lang Phixmonti>include ..\Utilitys.pmt
<syntaxhighlight lang="phixmonti">include ..\Utilitys.pmt
( 'a' 'z' ) for tochar print endfor</lang>
( 'a' 'z' ) for tochar print endfor</syntaxhighlight>


=={{header|PHP}}==
=={{header|PHP}}==
<lang php><?php
<syntaxhighlight lang="php"><?php
$lower = range('a', 'z');
$lower = range('a', 'z');
var_dump($lower);
var_dump($lower);
?></lang>
?></syntaxhighlight>


=={{header|Picat}}==
=={{header|Picat}}==
<lang Picat>main =>
<syntaxhighlight lang="picat">main =>
Alpha1 = (0'a..0'z).map(chr),
Alpha1 = (0'a..0'z).map(chr),
println(Alpha1),
println(Alpha1),
Alpha2 = [chr(I) : I in 97..122],
Alpha2 = [chr(I) : I in 97..122],
println(Alpha2).</lang>
println(Alpha2).</syntaxhighlight>


{{out}}
{{out}}
Line 2,165: Line 2,165:


=={{header|PicoLisp}}==
=={{header|PicoLisp}}==
<lang>(mapcar char (range (char "a") (char "z")))</lang>
<syntaxhighlight lang="text">(mapcar char (range (char "a") (char "z")))</syntaxhighlight>


=={{header|PL/I}}==
=={{header|PL/I}}==
<lang PL/I>gen: procedure options (main); /* 7 April 2014. */
<syntaxhighlight lang="pl/i">gen: procedure options (main); /* 7 April 2014. */
declare 1 ascii union,
declare 1 ascii union,
2 letters (26) character (1),
2 letters (26) character (1),
Line 2,182: Line 2,182:
put edit (letters) (a);
put edit (letters) (a);


end gen;</lang>
end gen;</syntaxhighlight>
Output:
Output:
<pre>
<pre>
Line 2,188: Line 2,188:
</pre>
</pre>
Alternative, using library:
Alternative, using library:
<lang> /* Accessing library lower-case ASCII (PC only). */
<syntaxhighlight lang="text"> /* Accessing library lower-case ASCII (PC only). */


letter = lowercase('A');
letter = lowercase('A');
i = index(collate(), letter);
i = index(collate(), letter);
put skip list (substr(collate, i, 26));</lang>
put skip list (substr(collate, i, 26));</syntaxhighlight>
Output:
Output:
<pre>
<pre>
Line 2,200: Line 2,200:


=={{header|PL/M}}==
=={{header|PL/M}}==
<lang pli>100H: /* PRINT THE LOWERCASE LETTERS */
<syntaxhighlight lang="pli">100H: /* PRINT THE LOWERCASE LETTERS */


/* CP/M BDOS SYSTEM CALL */
/* CP/M BDOS SYSTEM CALL */
Line 2,215: Line 2,215:
CALL PR$STRING( .LC );
CALL PR$STRING( .LC );


EOF</lang>
EOF</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 2,222: Line 2,222:


=={{header|PL/SQL}}==
=={{header|PL/SQL}}==
<lang PL/SQL>Declare
<syntaxhighlight lang="pl/sql">Declare
sbAlphabet varchar2(100);
sbAlphabet varchar2(100);
Begin
Begin
Line 2,233: Line 2,233:
End loop;
End loop;
Dbms_Output.Put_Line(sbAlphabet);
Dbms_Output.Put_Line(sbAlphabet);
End;</lang>
End;</syntaxhighlight>
Output:
Output:
<pre>
<pre>
Line 2,244: Line 2,244:


=={{header|Plain English}}==
=={{header|Plain English}}==
<lang plainenglish>To run:
<syntaxhighlight lang="plainenglish">To run:
Start up.
Start up.
Generate the lowercase ASCII alphabet giving a string.
Generate the lowercase ASCII alphabet giving a string.
Line 2,257: Line 2,257:
If the letter is the little-z byte, exit.
If the letter is the little-z byte, exit.
Add 1 to the letter.
Add 1 to the letter.
Repeat.</lang>
Repeat.</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 2,264: Line 2,264:


=={{header|PowerShell}}==
=={{header|PowerShell}}==
<syntaxhighlight lang="powershell">
<lang PowerShell>
$asString = 97..122 | ForEach-Object -Begin {$asArray = @()} -Process {$asArray += [char]$_} -End {$asArray -join('')}
$asString = 97..122 | ForEach-Object -Begin {$asArray = @()} -Process {$asArray += [char]$_} -End {$asArray -join('')}
$asString
$asString
</syntaxhighlight>
</lang>
{{Out}}
{{Out}}
<pre>
<pre>
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
</pre>
</pre>
<syntaxhighlight lang="powershell">
<lang PowerShell>
$asArray
$asArray
</syntaxhighlight>
</lang>
{{Out}}
{{Out}}
<pre>
<pre>
Line 2,306: Line 2,306:


'''Alternative:'''
'''Alternative:'''
<syntaxhighlight lang="powershell">
<lang PowerShell>
-join [Char[]] (97..122)
-join [Char[]] (97..122)
</syntaxhighlight>
</lang>
{{Out}}
{{Out}}
<pre>
<pre>
Line 2,315: Line 2,315:


'''Alternative as of PowerShell-v6.0.0rc:'''
'''Alternative as of PowerShell-v6.0.0rc:'''
<syntaxhighlight lang="powershell">
<lang PowerShell>
-join ('a'..'z')
-join ('a'..'z')
</syntaxhighlight>
</lang>
{{Out}}
{{Out}}
<pre>
<pre>
Line 2,325: Line 2,325:
=={{header|Prolog}}==
=={{header|Prolog}}==
Works with SWI-Prolog 6.5.3
Works with SWI-Prolog 6.5.3
<lang Prolog>a_to_z(From, To, L) :-
<syntaxhighlight lang="prolog">a_to_z(From, To, L) :-
maplist(atom_codes, [From, To], [[C_From], [C_To]]),
maplist(atom_codes, [From, To], [[C_From], [C_To]]),
bagof([C], between(C_From, C_To, C), L1),
bagof([C], between(C_From, C_To, C), L1),
maplist(atom_codes,L, L1).
maplist(atom_codes,L, L1).
</syntaxhighlight>
</lang>
Output :
Output :
<pre> ?- a_to_z(a, z, L).
<pre> ?- a_to_z(a, z, L).
Line 2,336: Line 2,336:


=={{header|Python}}==
=={{header|Python}}==
<lang Python># From the standard library:
<syntaxhighlight lang="python"># From the standard library:
from string import ascii_lowercase
from string import ascii_lowercase


# Generation:
# Generation:
lower = [chr(i) for i in range(ord('a'), ord('z') + 1)]</lang>
lower = [chr(i) for i in range(ord('a'), ord('z') + 1)]</syntaxhighlight>


Or, as a particular instance of a more general enumeration pattern:
Or, as a particular instance of a more general enumeration pattern:
{{Works with|Python|3.7}}
{{Works with|Python|3.7}}
<lang python>'''Enumeration a-z'''
<syntaxhighlight lang="python">'''Enumeration a-z'''


from inspect import signature
from inspect import signature
Line 2,444: Line 2,444:
# MAIN ---
# MAIN ---
if __name__ == '__main__':
if __name__ == '__main__':
main()</lang>
main()</syntaxhighlight>
{{Out}}
{{Out}}
<pre>Enumeration a-z:
<pre>Enumeration a-z:
Line 2,459: Line 2,459:
The word ''constant'' causes the preceding nest to be evaluated during compilation so ''alpha$'' is a literal, not an expression computed during program evaluation.
The word ''constant'' causes the preceding nest to be evaluated during compilation so ''alpha$'' is a literal, not an expression computed during program evaluation.


<lang Quackery>[ [] 26 times [ i^ char a + join ] ] constant is alpha$ ( --> $ )
<syntaxhighlight lang="quackery">[ [] 26 times [ i^ char a + join ] ] constant is alpha$ ( --> $ )


alpha$ echo$</lang>
alpha$ echo$</syntaxhighlight>


{{Out}}
{{Out}}
Line 2,468: Line 2,468:


=={{header|R}}==
=={{header|R}}==
<lang R># From constants built into R:
<syntaxhighlight lang="r"># From constants built into R:
letters
letters


# Or generate the same with:
# Or generate the same with:
sapply(97:122, intToUtf8)</lang>
sapply(97:122, intToUtf8)</syntaxhighlight>


=={{header|Racket}}==
=={{header|Racket}}==
<lang racket>(define lowercase-letters (build-list 26 (lambda (x) (integer->char (+ x (char->integer #\a))))))</lang>
<syntaxhighlight lang="racket">(define lowercase-letters (build-list 26 (lambda (x) (integer->char (+ x (char->integer #\a))))))</syntaxhighlight>


=={{header|Raku}}==
=={{header|Raku}}==
Line 2,482: Line 2,482:
{{works with|rakudo|2015-10-21}}
{{works with|rakudo|2015-10-21}}


<lang perl6>say my @letters = 'a'..'z';</lang>
<syntaxhighlight lang="raku" line>say my @letters = 'a'..'z';</syntaxhighlight>


* <code>'a'..'z'</code> is a range literal, it constructs an immutable <code>Range</code> object.
* <code>'a'..'z'</code> is a range literal, it constructs an immutable <code>Range</code> object.
Line 2,490: Line 2,490:
===ASCII version===
===ASCII version===
This version only works under ASCII machines &nbsp; (where the values of the lowercase '''a''' through the lowercase '''z''' characters are contiguous (and consecutive).
This version only works under ASCII machines &nbsp; (where the values of the lowercase '''a''' through the lowercase '''z''' characters are contiguous (and consecutive).
<lang rexx>/* REXX ---------------------------------------------------------------
<syntaxhighlight lang="rexx">/* REXX ---------------------------------------------------------------
* 08.02.2014 Walter Pachl
* 08.02.2014 Walter Pachl
*--------------------------------------------------------------------*/
*--------------------------------------------------------------------*/
say xrange('a','z')</lang>
say xrange('a','z')</syntaxhighlight>
'''Output:'''
'''Output:'''
<pre>abcdefghijklmnopqrstuvwxyz</pre>
<pre>abcdefghijklmnopqrstuvwxyz</pre>
Line 2,507: Line 2,507:
Note that on an '''EBCDIC''' system, &nbsp; there are &nbsp; '''41''' &nbsp; characters between (lowercase) &nbsp; <big><big> a </big></big> &nbsp; ──► &nbsp; <big><big> z </big></big> &nbsp; &nbsp;
Note that on an '''EBCDIC''' system, &nbsp; there are &nbsp; '''41''' &nbsp; characters between (lowercase) &nbsp; <big><big> a </big></big> &nbsp; ──► &nbsp; <big><big> z </big></big> &nbsp; &nbsp;
<br>(inclusive), &nbsp; some of which don't have viewable/displayable glyphs.
<br>(inclusive), &nbsp; some of which don't have viewable/displayable glyphs.
<lang rexx>/*REXX program creates an indexable string of lowercase ASCII or EBCDIC characters: a─►z*/
<syntaxhighlight lang="rexx">/*REXX program creates an indexable string of lowercase ASCII or EBCDIC characters: a─►z*/
$= /*set lowercase letters list to null. */
$= /*set lowercase letters list to null. */
do j=0 for 2**8; _=d2c(j) /*convert decimal J to a character. */
do j=0 for 2**8; _=d2c(j) /*convert decimal J to a character. */
if datatype(_, 'L') then $=$ || _ /*Is lowercase? Then add it to $ list.*/
if datatype(_, 'L') then $=$ || _ /*Is lowercase? Then add it to $ list.*/
end /*j*/ /* [↑] add lowercase letters ──► $ */
end /*j*/ /* [↑] add lowercase letters ──► $ */
say $ /*stick a fork in it, we're all done. */</lang>
say $ /*stick a fork in it, we're all done. */</syntaxhighlight>
'''output'''
'''output'''
<pre>
<pre>
Line 2,519: Line 2,519:


=={{header|Ring}}==
=={{header|Ring}}==
<lang ring>for i in 'a':'z'
<syntaxhighlight lang="ring">for i in 'a':'z'
put i
put i
next</lang>
next</syntaxhighlight>


=={{header|Ruby}}==
=={{header|Ruby}}==
<lang ruby>p ('a' .. 'z').to_a
<syntaxhighlight lang="ruby">p ('a' .. 'z').to_a
p [*'a' .. 'z']</lang>
p [*'a' .. 'z']</syntaxhighlight>


=={{header|Rust}}==
=={{header|Rust}}==
<lang rust>fn main() {
<syntaxhighlight lang="rust">fn main() {
// An iterator over the lowercase alpha's
// An iterator over the lowercase alpha's
let ascii_iter = (0..26)
let ascii_iter = (0..26)
Line 2,534: Line 2,534:
println!("{:?}", ascii_iter.collect::<Vec<char>>());
println!("{:?}", ascii_iter.collect::<Vec<char>>());
}</lang>
}</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 2,542: Line 2,542:
=={{header|S-lang}}==
=={{header|S-lang}}==
Char_Type is just an integer-type so a "range array" can be easily created:
Char_Type is just an integer-type so a "range array" can be easily created:
<lang S-lang>variable alpha_ch = ['a':'z'], a;</lang>
<syntaxhighlight lang="s-lang">variable alpha_ch = ['a':'z'], a;</syntaxhighlight>
If you need single-char strings, convert thusly:
If you need single-char strings, convert thusly:
<lang S-lang>variable alpha_st = array_map(String_Type, &char, alpha_ch);</lang>
<syntaxhighlight lang="s-lang">variable alpha_st = array_map(String_Type, &char, alpha_ch);</syntaxhighlight>
Let's take a peek:
Let's take a peek:
<lang S-lang>print(alpha_st[23]);
<syntaxhighlight lang="s-lang">print(alpha_st[23]);
foreach a (alpha_ch)
foreach a (alpha_ch)
() = printf("%c ", a);
() = printf("%c ", a);
</syntaxhighlight>
</lang>
{{out}}
{{out}}
<pre>"x"
<pre>"x"
Line 2,556: Line 2,556:
=={{header|Scala}}==
=={{header|Scala}}==
{{libheader|Scala}}
{{libheader|Scala}}
<lang scala>object Abc extends App {
<syntaxhighlight lang="scala">object Abc extends App {
val lowAlpha = 'a' to 'z' //That's all
val lowAlpha = 'a' to 'z' //That's all
// Now several tests
// Now several tests
Line 2,573: Line 2,573:
scala.compat.Platform.currentTime - executionStart
scala.compat.Platform.currentTime - executionStart
} ms]")
} ms]")
}</lang>{{out}}
}</syntaxhighlight>{{out}}
Successfully completed without errors. [within 675 ms]
Successfully completed without errors. [within 675 ms]
Line 2,580: Line 2,580:
=={{header|Scheme}}==
=={{header|Scheme}}==
{{works with|Gauche Scheme}}
{{works with|Gauche Scheme}}
<lang Scheme>(map integer->char (iota 26 (char->integer #\a)))</lang>
<syntaxhighlight lang="scheme">(map integer->char (iota 26 (char->integer #\a)))</syntaxhighlight>
{{output}}
{{output}}
<pre>
<pre>
Line 2,588: Line 2,588:


=={{header|Seed7}}==
=={{header|Seed7}}==
<lang seed7>$ include "seed7_05.s7i";
<syntaxhighlight lang="seed7">$ include "seed7_05.s7i";


const proc: main is func
const proc: main is func
Line 2,599: Line 2,599:
end for;
end for;
writeln(lower);
writeln(lower);
end func;</lang>
end func;</syntaxhighlight>


{{out}}
{{out}}
Line 2,607: Line 2,607:


=={{header|Sidef}}==
=={{header|Sidef}}==
<lang ruby>var arr = 'a'..'z';
<syntaxhighlight lang="ruby">var arr = 'a'..'z';
say arr.join(' ');</lang>
say arr.join(' ');</syntaxhighlight>


=={{header|Smalltalk}}==
=={{header|Smalltalk}}==
<lang smalltalk>| asciiLower |
<syntaxhighlight lang="smalltalk">| asciiLower |
asciiLower := String new.
asciiLower := String new.
97 to: 122 do: [:asciiCode |
97 to: 122 do: [:asciiCode |
asciiLower := asciiLower , asciiCode asCharacter
asciiLower := asciiLower , asciiCode asCharacter
].
].
^asciiLower</lang>
^asciiLower</syntaxhighlight>


=={{header|Snobol}}==
=={{header|Snobol}}==
<lang sml> &ALPHABET ('a' LEN(25)) . OUTPUT ;* Works in ASCII but not EBCDIC.</lang>
<syntaxhighlight lang="sml"> &ALPHABET ('a' LEN(25)) . OUTPUT ;* Works in ASCII but not EBCDIC.</syntaxhighlight>


=={{header|SPL}}==
=={{header|SPL}}==
<lang spl>> i, 1..26
<syntaxhighlight lang="spl">> i, 1..26
d = [i+96,0]
d = [i+96,0]
a[i] = #.str(d)
a[i] = #.str(d)
Line 2,630: Line 2,630:
> i, 1..#.size(a,1)
> i, 1..#.size(a,1)
#.output(a[i],#.rs)
#.output(a[i],#.rs)
<</lang>
<</syntaxhighlight>
{{out}}
{{out}}
<pre>
<pre>
Line 2,637: Line 2,637:


=={{header|Standard ML}}==
=={{header|Standard ML}}==
<lang sml>val lowercase_letters = List.tabulate (26, fn x => chr (x + ord #"a"));</lang>
<syntaxhighlight lang="sml">val lowercase_letters = List.tabulate (26, fn x => chr (x + ord #"a"));</syntaxhighlight>


=={{header|Stata}}==
=={{header|Stata}}==
<lang stata>// built-in: lowercase and uppercase letters
<syntaxhighlight lang="stata">// built-in: lowercase and uppercase letters
display c(alpha)
display c(alpha)
display c(ALPHA)
display c(ALPHA)
Line 2,652: Line 2,652:
mata
mata
char(97..122)
char(97..122)
end</lang>
end</syntaxhighlight>


=={{header|SuperCollider}}==
=={{header|SuperCollider}}==
Previously, it was claimed that the method that maps ascii number to character is polymorphic on collections. However, that doesn't seem to be the case – at least not anymore in the newer version (3.10.2). A fix was added below the original code.
Previously, it was claimed that the method that maps ascii number to character is polymorphic on collections. However, that doesn't seem to be the case – at least not anymore in the newer version (3.10.2). A fix was added below the original code.
<syntaxhighlight lang="supercollider">
<lang SuperCollider>
(97..122).asAscii; // This example unfortunately throws an error
(97..122).asAscii; // This example unfortunately throws an error
// for me when running it on version 3.10.2
// for me when running it on version 3.10.2
Line 2,676: Line 2,676:




</syntaxhighlight>
</lang>
Backwards:
Backwards:
<syntaxhighlight lang="supercollider">
<lang SuperCollider>
"abcdefghijklmnopqrstuvwxyz".ascii
"abcdefghijklmnopqrstuvwxyz".ascii
// answers [ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122 ]
// answers [ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122 ]
</syntaxhighlight>
</lang>


=={{header|Swift}}==
=={{header|Swift}}==
<lang Swift>var letters = [Character]()
<syntaxhighlight lang="swift">var letters = [Character]()


for i in 97...122 {
for i in 97...122 {
let char = Character(UnicodeScalar(i))
let char = Character(UnicodeScalar(i))
letters.append(char)
letters.append(char)
}</lang>
}</syntaxhighlight>


=={{header|Tcl}}==
=={{header|Tcl}}==
The most common way of doing this in Tcl would be to use a simple literal; it's only 51 characters after all:
The most common way of doing this in Tcl would be to use a simple literal; it's only 51 characters after all:
<lang tcl>set alpha {a b c d e f g h i j k l m n o p q r s t u v w x y z}</lang>
<syntaxhighlight lang="tcl">set alpha {a b c d e f g h i j k l m n o p q r s t u v w x y z}</syntaxhighlight>
Though it could be done like this as well:
Though it could be done like this as well:
<lang tcl>set alpha [apply {{} {
<syntaxhighlight lang="tcl">set alpha [apply {{} {
scan "az" "%c%c" from to
scan "az" "%c%c" from to
for {set i $from} {$i <= $to} {incr i} {
for {set i $from} {$i <= $to} {incr i} {
Line 2,701: Line 2,701:
}
}
return $l
return $l
}}]</lang>
}}]</syntaxhighlight>


=={{header|UNIX Shell}}==
=={{header|UNIX Shell}}==
In bash or ksh93 with <tt>braceexpand</tt> set:
In bash or ksh93 with <tt>braceexpand</tt> set:
<lang sh>lower=({a..z})</lang>
<syntaxhighlight lang="sh">lower=({a..z})</syntaxhighlight>


In zsh with <tt>braceccl</tt> set:
In zsh with <tt>braceccl</tt> set:
<lang sh>lower=({a-z})</lang>
<syntaxhighlight lang="sh">lower=({a-z})</syntaxhighlight>


Either way, you can display the result like this:
Either way, you can display the result like this:


<lang sh>echo "${lower[@]}"</lang>
<syntaxhighlight lang="sh">echo "${lower[@]}"</syntaxhighlight>


{{Out}}<pre>a b c d e f g h i j k l m n o p q r s t u v w x y z</pre>
{{Out}}<pre>a b c d e f g h i j k l m n o p q r s t u v w x y z</pre>
Line 2,718: Line 2,718:
=={{header|Ursa}}==
=={{header|Ursa}}==
Creates a string named low containing the lower case ASCII alphabet.
Creates a string named low containing the lower case ASCII alphabet.
<lang ursa>decl int i
<syntaxhighlight lang="ursa">decl int i
decl string low
decl string low
for (set i (ord "a")) (< i (+ (ord "z") 1)) (inc i)
for (set i (ord "a")) (< i (+ (ord "z") 1)) (inc i)
set low (+ low (chr i))
set low (+ low (chr i))
end for
end for
out low endl console</lang>
out low endl console</syntaxhighlight>


=={{header|VBA}}==
=={{header|VBA}}==
Line 2,730: Line 2,730:
{{works with|Visual Basic|6}}
{{works with|Visual Basic|6}}


<syntaxhighlight lang="vb">
<lang vb>
Option Explicit
Option Explicit


Line 2,750: Line 2,750:
Erase strarrTemp
Erase strarrTemp
End Function
End Function
</syntaxhighlight>
</lang>
{{out}}
{{out}}
<pre>a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z</pre>
<pre>a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z</pre>


=={{header|VBScript}}==
=={{header|VBScript}}==
<lang vb>Function ASCII_Sequence(range)
<syntaxhighlight lang="vb">Function ASCII_Sequence(range)
arr = Split(range,"..")
arr = Split(range,"..")
For i = Asc(arr(0)) To Asc(arr(1))
For i = Asc(arr(0)) To Asc(arr(1))
Line 2,763: Line 2,763:


WScript.StdOut.Write ASCII_Sequence(WScript.Arguments(0))
WScript.StdOut.Write ASCII_Sequence(WScript.Arguments(0))
WScript.StdOut.WriteLine</lang>
WScript.StdOut.WriteLine</syntaxhighlight>
{{out}}
{{out}}
<pre>C:\>cscript /nologo ascii_sequence.vbs a..z
<pre>C:\>cscript /nologo ascii_sequence.vbs a..z
Line 2,772: Line 2,772:


=={{header|Verilog}}==
=={{header|Verilog}}==
<lang Verilog>module main;
<syntaxhighlight lang="verilog">module main;
integer i;
integer i;
Line 2,783: Line 2,783:
end
end
endmodule
endmodule
</syntaxhighlight>
</lang>
{{out}}
{{out}}
<pre>a b c d e f g h i j k l m n o p q r s t u v w x y z </pre>
<pre>a b c d e f g h i j k l m n o p q r s t u v w x y z </pre>
Line 2,789: Line 2,789:


=={{header|Vim Script}}==
=={{header|Vim Script}}==
<lang vim>let lower = []
<syntaxhighlight lang="vim">let lower = []
for c in range(0, 25)
for c in range(0, 25)
let lower += [nr2char(c + char2nr("a"))]
let lower += [nr2char(c + char2nr("a"))]
endfor</lang>
endfor</syntaxhighlight>


or:
or:
<lang vim>echo map(range(char2nr('a'), char2nr('z')), 'nr2char(v:val)')</lang>
<syntaxhighlight lang="vim">echo map(range(char2nr('a'), char2nr('z')), 'nr2char(v:val)')</syntaxhighlight>


=={{header|Visual Basic}}==
=={{header|Visual Basic}}==
Line 2,807: Line 2,807:
String.Join() is used to print the list, converted to array, without looping through it.
String.Join() is used to print the list, converted to array, without looping through it.


<lang vbnet>Module LowerASCII
<syntaxhighlight lang="vbnet">Module LowerASCII


Sub Main()
Sub Main()
Line 2,818: Line 2,818:


End Module
End Module
</syntaxhighlight>
</lang>


{{out}}
{{out}}
Line 2,826: Line 2,826:


=={{header|Vlang}}==
=={{header|Vlang}}==
<lang vlang>fn loweralpha() string {
<syntaxhighlight lang="vlang">fn loweralpha() string {
mut p := []u8{len: 26}
mut p := []u8{len: 26}
for i in 97..123 {
for i in 97..123 {
Line 2,832: Line 2,832:
}
}
return p.bytestr()
return p.bytestr()
}</lang>
}</syntaxhighlight>


=={{header|WebAssembly}}==
=={{header|WebAssembly}}==
<lang WebAssembly>(module $lowercase
<syntaxhighlight lang="webassembly">(module $lowercase


(import "wasi_unstable" "fd_write"
(import "wasi_unstable" "fd_write"
Line 2,871: Line 2,871:
drop
drop
)
)
)</lang>
)</syntaxhighlight>


{{out}}
{{out}}
Line 2,880: Line 2,880:


=={{header|Wren}}==
=={{header|Wren}}==
<lang javascript>var alpha = []
<syntaxhighlight lang="javascript">var alpha = []
for (c in 97..122) alpha.add(String.fromByte(c))
for (c in 97..122) alpha.add(String.fromByte(c))
System.print(alpha.join())</lang>
System.print(alpha.join())</syntaxhighlight>


{{out}}
{{out}}
Line 2,890: Line 2,890:


=={{header|xEec}}==
=={{header|xEec}}==
<lang xEec>h$` h$` >0_0 t h$y ms p h? jn00_0 p r h#1 ma t jn0_0 >00_0 p p r p</lang>
<syntaxhighlight lang="xeec">h$` h$` >0_0 t h$y ms p h? jn00_0 p r h#1 ma t jn0_0 >00_0 p p r p</syntaxhighlight>


=={{header|XLISP}}==
=={{header|XLISP}}==
<lang lisp>(defun ascii-lower ()
<syntaxhighlight lang="lisp">(defun ascii-lower ()
(defun add-chars (x y s)
(defun add-chars (x y s)
(if (<= x y)
(if (<= x y)
(add-chars (+ x 1) y (string-append s (string (integer->char x))))
(add-chars (+ x 1) y (string-append s (string (integer->char x))))
s))
s))
(add-chars 97 122 ""))</lang>
(add-chars 97 122 ""))</syntaxhighlight>


=={{header|XPL0}}==
=={{header|XPL0}}==
<lang XPL0>char I, A(26);
<syntaxhighlight lang="xpl0">char I, A(26);
for I:= 0 to 26-1 do A(I):= I+^a</lang>
for I:= 0 to 26-1 do A(I):= I+^a</syntaxhighlight>


=={{header|Z80 Assembly}}==
=={{header|Z80 Assembly}}==
<lang z80> org &8000
<syntaxhighlight lang="z80"> org &8000
ld a,'a' ;data
ld a,'a' ;data
ld b,26 ;loop counter
ld b,26 ;loop counter
Line 2,922: Line 2,922:


Alphabet:
Alphabet:
ds 26,0 ;reserve 26 bytes of ram, init all to zero.</lang>
ds 26,0 ;reserve 26 bytes of ram, init all to zero.</syntaxhighlight>


{{out}}
{{out}}
Line 2,935: Line 2,935:


=={{header|zkl}}==
=={{header|zkl}}==
<lang zkl>["a".."z"] // lasy list
<syntaxhighlight lang="zkl">["a".."z"] // lasy list
["a".."z"].walk() //-->L("a","b","c","d","e",...
["a".."z"].walk() //-->L("a","b","c","d","e",...
"a".toAsc().pump(26,List,"toChar") // another way to create the list
"a".toAsc().pump(26,List,"toChar") // another way to create the list
"a".toAsc().pump(26,String,"toChar") // create a string
"a".toAsc().pump(26,String,"toChar") // create a string
//-->"abcdefghijklmnopqrstuvwxyz"
//-->"abcdefghijklmnopqrstuvwxyz"
Utils.Helpers.lowerLetters // string const</lang>
Utils.Helpers.lowerLetters // string const</syntaxhighlight>


=={{header|Zig}}==
=={{header|Zig}}==
<lang zig>const std = @import("std");
<syntaxhighlight lang="zig">const std = @import("std");


pub fn main() !void {
pub fn main() !void {
Line 2,956: Line 2,956:
try stdout_wr.print("{c} ", .{l});
try stdout_wr.print("{c} ", .{l});
try stdout_wr.writeByte('\n');
try stdout_wr.writeByte('\n');
}</lang>
}</syntaxhighlight>