Generate lower case ASCII alphabet: Difference between revisions

m (→‎{{header|NESL}}: added header for NetLogo)
Line 2,039:
<lang nesl>lower_case_ascii = {code_char(c) : c in [97:123]};</lang>
=={{header|NetLogo}}==
Since NetLogo has no "ASC" type reporters, we will have to enumerate the characters.
<lang netlogo></lang>
To make an omission easier to detect, we use a phrase, instead of a list
Since the phrase has duplicates and spaces, we use other list tools to produce just the sorted alphabet
===Code===
<lang netlogo></lang>
to-report alphabet-lower
let sample "sphinx of black quartz judge my vow"
let alphabet sort remove-duplicates remove " " n-values length sample [ c -> item c sample ]
if length alphabet != 26 [ user-message "ERROR: invalid sample for alphabet function" ]
report alphabet
end
</lang>
=== Output ===
<pre>
observer> print alphabet-lower
[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]
observer> write alphabet-lower
["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|Nim}}==