text:
Solve the New York Times Spelling Bee
The New York Times periodically runs a puzzle they call the "Spelling Bee" in which they list six "allowed" letters plus one "mandatory" letter and challenge the reader to form as many five-letter-or-longer dictionary words as possible out of those letters. Each "allowed" letter can appear 0 or more times. The mandatory letter must appear at least once in each word. No other letters are allowed. Proper nouns are not acceptable answers.
For example, in last week's puzzle, the allowed letters were {"A", "C", "D", "H", "I", and "R"}, while the mandatory letter was "N".
Allowed answers for this set of letters range from 5-letter words "ranch", "naiad", and "nadir", up to 9-letter words "cnidarian" and "circadian".
The more words you find, the higher the Times rates your intelligence. Your challenge: write a solver in the language of your choice.
Additional rules and tips:

If your programming environment or operating system provides a list of words, you may use it. If not, you must include code for loading a word list from disk or the internet; you can not assume it has been magically loaded into a variable outside your code.
The word list should be generic, not limited to only those words that contain the mandatory letter, and not limited to words that meet the length or other requirements here. In other words, all dictionary searches should be done by your code, not some pre-processor.
If a word is capitalized in the dictionary, treat it as a proper noun. If your dictionary does not distinguish proper nouns, find a different dictionary.
Different dictionaries will deliver different sets of answers, but given the test case above, you must return at least 20 qualifying answers, and the words "harridan", "niacin", and "circadian" must be on it. The words "Diana", "Adrian", and "India", as proper nouns, must not be.
Your code should take the form of a function or program that accepts two variables: a string or list of characters representing the allowed letters, and a character representing the required letter. It should return a list of allowed answers in any order.
Except to the extent my rules here dictate otherwise, standard loopholes are forbidden.
In the event my rule summary here deviates from the rules at the New York Times, follow the rules here.
Shortest byte count wins, though I plan to call out excellent solutions using novel algorithms or that are otherwise interesting to me, assuming any such are submitted.

I might recommend just specifying the appropriate wordlist and its file name, a la "Let's Play Hangman".

Also the standard here is to allow a program or function, why is this limited to a function specifically?

"you can not assume it has been magically loaded into a variable outside your code" - how about just accepting a list of words as an input to the (program or) function?

The word india is also the code word for the letter I in international radio communication, and hence not a proper noun, so could be listed in the dictionary as such (CSW has it for example and that has no proper nouns).

@briantist I suppose a program that follows the other rules would be fine. I will modify the terms accordingly.

The New York Times Spelling Bee allows words of length four (not five) or longer.

bash/dash/ash with grep and egrep, 31 30 29 bytes
egrep ^[$1$2]\{5,}$ z|grep $2

This assumes you have a a word list in a file named z. The word list I used was kindly provided by briantist.
Example:
$ echo 'egrep ^[$1$2]\{5,}$ z|grep $2' > program; chmod +x program
$ ./program acdhir n | tr '\n' ' '
acarian acaridan acini ahind anana anarch anarchic arachnid arachnidan arcana arnica cairn canard cancan candid candida canid canna cannach caranna carina chain characin chicana china chinar chinch cinch circadian cnida cnidarian cranch crania dharna diarian dinar dinic drain handcar harridan inarch indican indicia indri iridian nadir naiad naira nanna niacin nicad rachidian radian ranarian ranch rancid randan ricin

I'm no bash expert, but do you need that space between the opening { and grep?

Also note the rule changes, and the subsequent changes I made to the wordlist.

@briantist I tried, and apparently I do. However, if it can be an entire program, I can just put it into a file...

I'm not sure this solution (while awesomely short) meets the spec. By my reading, all result words have to be at least five letters long, but this one outputs words like "an", which are too short.

Oh, whoops. Didn't see that, sorry.

? egrep ^(?=$2)[$1$2]\{5,}$

PowerShell, 50 44 41 39 43 bytes
param($a,$m)gc z|sls $m|sls "^[$a$m]{5,9}$"

Notes

Using a scriptblock (unnamed function) because there's still a requirement for a function full program.
Takes the "allowed" letters as a single string.
Using The English Open Word List which is provided as a series of lists (one for each letter). I've combined them all into a single file named z, but I only included words that are between 5 and 9 letters, inclusive due to the new rule, the wordlist and my gist have been updated to not exclude any of the original words (of any size). Here's the list, for anyone else to use.

Explanation
Reads the wordlist file z as lines and does two regular expression matches (by way of Select-String with the sls alias). The first sls matches the mandatory letter, so the result is all the words that contain the letter, then that gets piped into the second sls which uses an expression that, in the case of the example input, looks like this: ^[acdhirn]{5,9}$ (so it matches only words that consist of those letters and no others, between 5 and 9 characters in length, inclusive).
Invocation and Output
&{param($a,$m)gc z|sls $m|sls ^[$a$m]+$} 'acdhir' 'n'

Output (57 words):
acarian
acaridan
acini
ahind
anana
anarch
anarchic
arachnid
arcana
arnica
cairn
canard
cancan
candid
candida
canid
canna
cannach
caranna
carina
chain
characin
chicana
china
chinar
chinch
cinch
circadian        #
cnida
cnidarian
cranch
crania
dharna
diarian
dinar
dinic
drain
handcar
harridan         #
inarch
indican
indicia
indri
iridian
nadir
naiad
naira
nanna
niacin           #
nicad
rachidian
radian
ranarian
ranch
rancid
randan
ricin

See spec clarification, please don't assume the dictionary has been pre-processed to remove short words.

@MichaelStern you just added that; you should make it clearer from the beginning. Specifying a specific wordlist as I suggested also would have made this point moot. I don't care much since it only adds 6 bytes to my answer, but now you've got 3 existing answers written with the old rule.

I agree, it would have been better if I had thought to specify it originally.

@MichaelStern code and wordlist have been updated.

Mathematica, 143 130 bytes
Join@@StringCases[Join@@StringCases[WordList[],RegularExpression["^["<>#2<>#<>"]{5,9}$"]],RegularExpression["\w+(?="<>#<>")\w+"]]&

Invocation (with input)
Join@@StringCases[Join@@StringCases[WordList[],RegularExpression["^["<>#2<>#<>"]{5,9}$"]],RegularExpression["\w+(?="<>#<>")\w+"]]&["n","acdhir"]

Output (20 words)
{"anarchic", "arachnid", "cairn", "canard", "cancan", "candid", "candida", "chain", "china", "cinch", "circadian", "cnidarian", "dinar", "drain", "handcar", "harridan", "niacin", "radian", "ranch", "rancid"}

Explanation
Join@@    // Shortened version of Flatten; removes {} from StringCases lists
    StringCases[    // Find substrings in a string/list that match a regex pattern.
        Join@@
            StringCases[
                WordList[],    // Built-in function; returns a list of English words.
                RegularExpression[
                    "^["<>#2<>#<>"]{5,9}$"    // Take the WordList, and find 5-9 letter
                                              // words with any character in the
                                              // the first or second arguments.
                                              // In this case, "x" would be "achdir",
                                              // and "y" is the letter "n".
                                              // <> is for string concatenation.
                ]
            ],
        RegularExpression[
            "\w+(?="<>#<>")\w+"              // Take the result from the previous
                                              // StringCases function, and find words
                                              // that actually have the character(s) in
                                              // the second argument in them.
                                              // In this case, find words that actually
                                              // have the letter "n" in them.
        ]
    ]
&    // Define an anonymous function.
["n","acdhir"]    // Pass arguments to the function; "#" is "n", and "#2" is "acdhir".

Welcome to the site! :)

Nice first answer! Here are a couple of golfing tips: you can replace Function[{x,y},...] with ...& as long as you replace every occurrence of x with # and every occurrence of y with #2. (In this case, you call x once and y twice, so you can save one additional byte by exchanging the order of the arguments.) You can also save bytes by giving a name to the function Join@@StringCases[#,RegularExpression[#2]& and using the name twice, or perhaps Fold. Remember, clarity is not key here: using as few bytes as possible is ... happy golfing!

Python 3.6  84  78 bytes
-6 bytes thanks to WuTheFWasThat (splitlines -> split and {c}and 4<len(w)<10 -> {c*(4<len(w)<10)})
lambda s,c:[w for w in open('z').read().split()if{*w}-{*s}=={c*(4<len(w)<10)}]

An unnamed function that takes a string and a character. Returns a list created by keeping those entries (ws) from a file where the set of remaining letters after removing any that are in the "can use" set ({*s}) is the set of the single "must use" character. The *s in {*x} unpack the strings to save bytes over set(x). The word-length check is 4<len(w)<10 and string multiplication saves a byte (since {*w}-{*s} can never result in a set containing an empty string).
Requires a file in the current directory named simply z containing the list of words separated by newlines (or carriage returns or both).
Taking a list of words would be preferable at 58 bytes.
With s='acdhri' and c='n' and using a file containing all entries and suffixed entries from the Chambers Scrabble™ Words (CSW) dictionary A.K.A. SOWPODS (which explicitly excludes proper nouns) we get the following resulting list of 85 words:
['acarian', 'acaridan', 'acaridian', 'acinar', 'acini', 'acinic', 'acridin', 'adhan', 'ahind', 'anana', 'anarch', 'anarchic', 'anicca', 'aniridia', 'aniridic', 'arachnid', 'arcadian', 'arcan', 'arcana', 'arnica', 'cairn', 'canada', 'canard', 'cancan', 'cancha', 'candid', 'candida', 'canid', 'canna', 'cannach', 'caranna', 'cardan', 'carina', 'chain', 'chana', 'characin', 'chicana', 'china', 'chinar', 'chinch', 'cinch', 'circadian', 'cnida', 'cnidarian', 'cranachan', 'cranch', 'crani', 'crania', 'darrain', 'dharna', 'diarian', 'dinar', 'dinic', 'dinna', 'drain', 'hainch', 'hanch', 'handcar', 'hariana', 'harridan', 'hinahina', 'inarch', 'india', 'indican', 'indicia', 'indri', 'iridian', 'nadir', 'naiad', 'naira', 'nandin', 'nandina', 'nanna', 'naric', 'niacin', 'nicad', 'rachidian', 'radian', 'radicand', 'ranarian', 'ranch', 'rancid', 'randan', 'ranid', 'ricin']

The word "india", is listed by this dictionary even though, due to the rules of Scrabble™, it explicitly excludes proper nouns, as: "(In international radio communication) a code word for the letter i [-S]" ('-S' indicating "inidas" is also acceptable), of course we could use any other file listing the words, but do note that "india" is also listed in TWL, the equivalent dictionary used in official Scrabble™ tournaments in the U.S. and Canada.

Don't presume your wordlist has already been screened to remove 1-4 character words.

@MichaelStern I may be blind, was that in the spec?

@MichaelStern Also note, both other entries have done the same!

@MichaelStern the other 2 answers do that (started by me), because you had us go out and find a wordlist instead of specifying one. I, accordingly, did so, and since I had to pre-process it into a single file anyway, I kept only 5-9 words. It wasn't restricted in the spec (and I've put my wordlist up for anyone to use).

I have clarified the rules, but the intent is to create code that finds words that follows the Spelling Bee rules. Pre-processing the dictionary changes the challenge. None of this is intended as disrespect of your code, which can be adapted easily.

@MichaelStern I have updated the code to reflect the updated spec.

@JonathanAllan Your list also contains china. The wordlist I use doesn't contain india or any other proper nouns, and is available for use (linked in my answer).

@briantist china seems indisputably valid - it should appear as both a noun and a proper noun in a normal dictionary. EDIT: I see it in your list too.

@JonathanAllan right you are!

@WuTheFWasThat - thanks for the saves! (FYI it's standard practice to just comment with such help)

Perl 6, 48 41 bytes

{grep /^@_*[$^a@_*]+$/,grep *.comb>4,1.IO.words}

{grep /^@_**5..*$/&/$(@_[0])/,1.IO.words}

Expects a whitespace-separated wordlist as a file called 1 in the current directory.
Expects the required character as the first argument, and a list of the additional allowed characters as the second argument (or as multiple arguments, it doesn't matter), all in lowercase.
How it works
{                                       } # A lambda. (@_ is the flattened argument list.)
                              1.IO.words  # Read words from file as a lazy sequence.
 grep /          /&/        /             # Filter words which match *both* these regexes:
       ^@_**5..*$                         #   1) Consists of 5+ allowed chars.
                    $(@_[0])              #   2) Contains the required char.

Perl, 43 + 1 (-n switch)
/^[^\p{Lu}](?i)(?=.*n)[acdhirn]{5,9}$/&&say

Run on linux:
perl -nE '/^[^\p{Lu}](?i)(?=.*n)[acdhirn]{5,9}$/&&say' < /usr/share/dict/american-english

Output: 33 words without proper nouns
anarchic
arachnid
banana
bandana
bandanna
branch
canard
cancan
candid
circadian
crania
enrich
errand
farina
grandad
granddad
handcar
harridan
maharani
mandarin
maniac
marina
niacin
ocarina
ordain
picnic
piranha
rancid
saccharin
tannin
unhand
urchin
zinnia

Powershell, 41 bytes
Inspired by briantist's answer.
briantist uses 3 cmdlets to make a solution. I would like to keep within one cmdlet.
param($a,$m)sls "^(?=.*$m)[$a$m]{5,9}$" z

As with the briantist's answer, I used The English Open Word List files combined into a single file named z.
As in other answers, the regex subpattern ^[$a$m]{5,9}$ asserts when a line contains allowed and required chars only.
The basic difference: (?=.*$m) asserts that the required character can be matched somewhere in a line, without consuming characters. See docs.
Unfortunately, sls provides additional information, not matches only. The rules don't forbid it :-). To display only words, you need to get the value of the Line property (47 bytes) or call the cmdlet gc (43 or 44 bytes).
Test script:
$f = {

                                                    # the output contains words and extra info
 param($a,$m)sls "^(?=.*$m)[$a$m]{5,9}$" z          # 41 bytes, 1 command
#param($a,$m)sls $m z|sls "^[$a$m]{5,9}$"           # 40 bytes, 2 commands

                                                    # only words solutions:
#param($a,$m)sls "^(?=.*$m)[$a$m]{5,9}$" z|% l*e    # 47 bytes, 1 command + 1 property
#param($a,$m)gc z|sls "^(?=.*$m)[$a$m]{5,9}$"       # 44 bytes, 2 commands
#param($a,$m)gc z|sls $m|sls "^[$a$m]{5,9}$"        # 43 bytes, 3 commands, briantist's https://codegolf.stackexchange.com/a/111293/80745

}

&$f 'acdhir' 'n'

Output:
z:542:acarian
z:547:acaridan
z:854:acini
z:2134:ahind
z:3624:anana
z:3644:anarch
z:3647:anarchic
z:5042:arachnid
z:5117:arcana
z:5466:arnica
z:14834:cairn
z:15334:canard
z:15341:cancan
z:15363:candid
z:15364:candida
z:15414:canid
z:15435:canna
z:15440:cannach
z:15866:caranna
z:16065:carina
z:17442:chain
z:17721:characin
z:18241:chicana
z:18408:china
z:18411:chinar
z:18418:chinch
z:19142:cinch
z:19213:circadian
z:20286:cnida
z:20288:cnidarian
z:23975:cranch
z:23983:crania
z:28928:dharna
z:29121:diarian
z:29648:dinar
z:29687:dinic
z:32006:drain
z:48944:handcar
z:49311:harridan
z:54033:inarch
z:54380:indican
z:54393:indicia
z:54473:indri
z:56194:iridian
z:70546:nadir
z:70575:naiad
z:70595:naira
z:70655:nanna
z:71643:niacin
z:71659:nicad
z:87803:rachidian
z:87884:radian
z:88295:ranarian
z:88304:ranch
z:88321:rancid
z:88329:randan
z:92641:ricin

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Evolution of Powers of Two
This is a repost of Evolution of “Hello World!”, originally written by user Helka Homba
It should not be closed as a duplicated, due to meta consensus here.
The original was asked over two years ago and was last active more than six months ago. I have permission from Helka Homba to post this here
Since the original, many languages have been invented, and many people have joined the site who have never had an opportunity to answer the original, so I feel that this repost is acceptable.

The challenge is to make a program that prints 2^n to stdout, where n is the number of your program. The catch is that your program must have a Levenshtein distance of 10 or less from the program in the answer submitted before yours.
How This Will Work
Below I will submit the first answer using C#, which prints 2^(n=1)=2.
The next person to answer must modify the code with up to 10 single character insertions, deletions, or substitutions so that when it is run in the language of the new answer, it prints 2^n (with n being the answer number). For example, the 25th answer (let's say it's in Pyth) would print 2^25, or 33554432.
This will continue on until everyone get stuck because there is no new language the last answer's program can be made to run in by only changing 10 characters. The communal goal is to see how long we can keep this up, so try not to make any obscure or unwarranted  character edits (this is not a requirement however).
Formatting
Please format your post like this:
#Answer N - [language]

    [code]

[notes, explanation, observations, whatever]

Where N is the answer number (increases incrementally, N = 1, 2, 3,...).
You do not have to tell which exact characters were changed. Just make sure the Levenshtein distance is from 0 to 10.
If you answer in some language or the resulting code is just a mess, do please explain what you did and why it works, though this isn't required.
Rules
The key thing to understand about this challenge is that only one person can answer at a time and each answer depends on the one before it.
There should never be two answers with the same N. If two people happen to simultaneously  answer for some N, the one who answered later (even if it's a few seconds difference) should graciously delete their answer.
Furthermore...

A user may not submit two answers in a row.  (e.g. since I submitted answer 1 I can't do answer 2, but I could do 3.)
Try to avoid posting too many answers in a short time frame.
Each answer must be in a different programming language.

You may use different major versions of a language, like Python 2/3
Languages count as distinct if they are traditionally called by two different names. (There may be some ambiguities here but don't let that ruin the contest.)

You do not have to stick to ASCII, you can use any characters you want. Levenshtein distance will be measured in unicode characters.
The output should only be 2^n and no other characters. (Leading/trailing whitespace is fine, as is unsuppressible output like >>> or ans=)
If your language doesn't have stdout use whatever is commonly used for quickly outputting text (e.g. console.log or alert in JavaScript).
When the power of two you have to output gets very large, you may assume infinite memory, but not an infinite integer size. Please be wary of integer overflows.
You may make use of scientific notation or whatever your languages most natural way of representing numbers is. (Except for unary, DO NOT output in unary)

Please make sure your answer is valid. We don't want to realize there's a break in the chain five answers up. Invalid answers should be fixed quickly or deleted before there are additional answers.
Don't edit answers unless absolutely necessary.
Scoring
Once things settle down, the user who submits the most (valid) answers wins. Ties go to the user with the most cumulative up-votes.
Edit these when you post an answer:
Leaderboard

13 languages
Okx
8 languages
zeppelin
4 languages
Pavel
Jonathan Allan
Kritixi Lithos
Riker
3 languages
boboquack
2 languages
bmarks
Conor O'Brien
Destructible Watermelon
ovs
Tom Carpenter
1 language
ATaco
Blocks
Dennis
dzaima
Erik the Outgolfer
ETHproductions
ghosts_in_the_code
Leo
Lynn
Matheus Avellar
Nathaniel
Qwerp-Derp
R. Kap
Taylor Raine
nimi
Mistah Figgins
PidgeyUsedGust
steenbergh

Languages used so far:

C# (Pavel)
/// (boboquack)
Retina (Dennis)
Jelly (Jonathon Allan)
Pyth (boboquack)
><> (Destructible Watermelon)
Minkolang (Kritixi Lithos)
Perl (Pavel)
Python (Qwerp-Derp)
dc (R. Kap)
Charcoal (Jonathon Allan)
Self Modifying BrainFuck (Leo)
SOGL (dzaima)
ShapeScript (Jonathon Allan)
Pyke (boboquack)
Ruby (Nathaniel)
05AB1E (ovs)
STATA (bmarks)
bc (Kritixi Lithos)
Japt (Okx)
2sable (Kritixi Lithos)
Cheddar (Jonathon Allan)
Pylons (Okx)
Bash (zeppelin)
Pushy (Okx)
CJam (Erik the Outgolfer)
MATL (Okx)
MATLAB (Tom Carpenter)
Octave (Kritixi Lithos)
R (ovs)
JavaScript ES7 (Tom Carpenter)
Convex (Okx)
Mathematica (ghosts_in_the_code)
Pip (Okx)
Stacked (Conor O'Brien)
GolfScript (Okx)
Actually (Lynn)
RProgN (Okx)
Scheme (bmarks)
Element (Okx)
J (Blocks)
Cubix (ETHproductions)
zsh (zeppelin)
VBA (Taylor Raine)
Fish (zeppelin)
Reticular (Okx)
Perl 6 (Pavel)
RProgN2 (ATaco)
PHP (Matheus Avellar)
Jolf (Conor O'Brien)
Haskell (nimi)
Befunge-98 (Mistah Figgins)
Gnuplot (zeppelin)
QBIC (steenbergh)
FOG (Riker)
Qwerty-RPN (Okx)
Korn Shell (ksh) (zeppelin)
Julia (Riker)
Python 3 (Pavel)
Vimscript (Riker)
Dash (zeppelin)
Vitsy (Okx)
csh (zeppelin)
Ohm (Okx)
Bosh (zeppelin)
es-shell (Riker)
Gol><> (PidgeyUsedGust)

This question works best when you sort by oldest.

A snippet would really be nice

@KritixiLithos I don't know how to do those, feel free to edit one in though!

For a snippet, you'd need to specify a default answer heading format

Does it matter if there is ans =  in the output - i.e. like: https://i.stack.imgur.com/Asn1g.png? I should have checked that before I posted and subsequently deleted 26 (apologies Okx). If it doesn't then 26/27 could be put back unless somebody does another one before we find out.

@TomCarpenter the question states that The output should only be 2^n and no other characters. (Leading/trailing whitespace is fine)

Can the output be like so: 1.07374e9 instead of instead of a really long number?

@Blocks That is acceptable, I'm editing the question to reflect that.

@TomCarpenter that is acceptable, I'm going to make the edit.

Does "Levenshtein distance will be measured in UTF-8 characters" mean that the edit distance is computed between strings of Unicode codepoints (and the "UTF-8" is a red herring, since in this sense it doesn't matter whether you use UTF-8, UTF-16, UCS4 or something else)?

@SamiLiedes pavel responded in chat, it's just unicode codepoints yeah. (i.e. if the code point is different, it's a character difference)

I extracted the codes. I believe the edit distance of #18 is 12 and that of #44, #47, #52, #57, #60 and #66 is 11. Turns out computing edit distances by hand is error prone.

@SamiLiedes why is 18 a distance of 12? 10 chars were added. I think your code borked.

@TomCarpenter also, I know it's much belated, but meta says that's ok as long as it's part of your default answer format. (i.e. you can't print 'ans =', but if returning a value automatically outputs that it's ok)

@Riker: Yeah, it counted whitespace differences at ends of line too.

@SamiLiedes ah, though I'm pretty sure that's unintentional. Oh well.

Answer 64, Ohm, distance 10
64º,;S)1'a"bc"<<x
2^63
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^
exit
 @n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:py print(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Added 64º,;S)1'a
Only the 64º, is actual code, the rest is just junk.
This program will print the correct output, but it will also ask for some STDIN after it has printed 264.

How in the world has this gone on? Nice job.

Answer 67, Gol><>, distance 6
We van use the trampoline # to just append the code in reverse. By removing S)1'a the ; can be reused, needing only 6 characters to be added.
#64º,;n*:"C"
"bc"<<x
2^66
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^
quit()
@n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:
py
p
riker
i
n
t
(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#

Try it online!
I think keeping the # allows for some other languages to use it as a commented line.

Just FWIW, if a bounty is given for the last answer your answer probably won't get it. The general winner of answer chaining challenges is either the last answerer that remains last for 1-2 wks, or the person with the most answers.

Don't really care for the bounty — just thought it'd be a shame to let this die.

Answer 17: 05AB1E, Distance of 3
#"Ａ#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#β”6904”±r«"$2
puts 16384 8*

Try it online!

Well done on exploiting the fact the 05AB1E doesn't throw errors.

Answer 24: Bash, distance 8
#23#2ej
printf $[2**24]
#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2
#puts 16384 8*di 2^18o8*'

Try It Online !

Answer 51, Haskell, distance 10
--2@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024
print(2^51)--;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Remove 2 NL, replace ^ at the beginning with -, prepend another -, delete * within the print, replace 2nd * with ^, overwrite 49with 51, insert -- after the print.

You removed the newlines...i cri evry tim

seriously why did you remove the newlines

Because haskell comments are --, so it's a lower edit distance than prepending -- twice.

@DestructibleWatermelon: line comment -- is 2 bytes, removing NL just 1

Answer 3: Retina, distance 3
/class HelloWorld {static void Main() {
    System.Console.Write(2);
}}//4|
8

Appended |\n8 (distance 3).
Try it online!

Answer 4: Jelly distance 3
/class HelloWorld {static void Main() 0{
    System.Console.Write(2);
0}}//4|
8Ḥ

Try it online!
all insertions: 00Ḥ.
0{ and 0} are there to suppress parsing errors (pop from empty list due to the { and } being quicks that turn monads into dyads using the left and right argument respectively).
Ḥ "unhalves" 8 to make 16.

Why does the first { (after class HelloWorld) not need a 0 before it, but the other two do?

Each line is parsed as a link (function) before anything runs, the final one being the entry point to the program. The parser would be fine without the () before the second open brace on the first line. The third line cannot start with a brace as there is no monad on which to act.

Answer 5: Pyth
32 "/class HelloWorld {static void Main() 0{
    System.Console.Write(2);
0}}//4|
8Ḥ

Prints the numeric literal 32, then the space between the 2 and the " suppresses printing of the (auto-completed) string literal.
+4 characters - 32 "
Try it on herokuapp

Answer 6 - ><>
32""/class HelloWorld {static void Main() 0{;n***~
    System.Console.Write(2);
0}}//4|
8Ḥ

replaced a space with ", the code pushes 3, 2, 4, then reverses, pushes 4,2,3, then pops 3 off the stack, and multiplies 2, 4, 4, 2, for 64, outputs it and halts
Try it online
maybe use https://www.fishlanguage.com/playground

Answer 8: Perl
#327;N.""/class HelloWorld {static void Main() 0{;n***~
#    System.Console.
print(256);
#0}}//4|
#8Ḥ

Exactly distance of 10: +4 # for comments, +1 newline after System.Console., +3 for transforming write into print, +2 for turning 2 into 256.
I wasn't going to participate, but I wanted to make sure some regular langs were added before anything got too insane.
Try it online!

Answer 20: Japt, distance 8
2**20$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2
#puts 16384 8*di 2^18*/

Try it online!
Modifications:
Changed 2^19 to 2**20 at the start of the program, to calculate the power (4)
Replaced # with $ on the first line so that everything past it is interpreted as JS (1)
On the last line, removed the / and added a */ at the end of the program, so the comment takes up the whole program (3)

Sorry, my answer above was incorrect. The last digit should be 8 instead of 7.

@bmarks Thanks, edited.

Answer 27: MATL, distance 4
27W%2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

Try it online!
Added 27W%
Explanation:
  W   2 to the power of
27    27
   %  Start of single line comment

Answer 42: Cubix, distance 8
2^41 NB.`(expt 2 39); ^ exit @ⁿ.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Try it online!
The lert(2**31 in the middle was changed to 44******O@.

Answer 60, Vimscript, distance 10
"bc<<<2^57 #x??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:py print(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Changed the 2 # on the start of the middle two lines to ", added a " in front of the first line, and :py<space> in front of the last line.
For clarification:
" is a line comment in vimscript (at least at the start of a line), and doesn't need to be matched.
Vim can run python code, so this is really equivalent to asking python for the answer.

If this is running Python code, why doesn't this error, like everywhere?

@Pavel only the last line is run as python code.

Sorry, made that comment before you fixed it.

Answer 49: PHP, distance 6
<?#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024
print(2**49);#0}}//4|
#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Added <? and ?> to open and close PHP tags, respectively.
Replaced 48 with 49.
# starts a comment on PHP, so nothing is considered except for
<? print(2**49); ?>

Here's a screenshot of proper syntax highlihgting and output to help visualize:

Answer 50: Jolf, distance 10
^2@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024
print(2**49);#0}}//4|
#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Try it here!
Prepended ^2@2( (+5)
Removed ± and ß from #ß6904±r (+2)
Removed ó from óout (+1)
Removed <? from <?#"#28@P2* (+2)
Total: 10. Remove all the non-ASCII characters!
Explanation
( stops parsing, so the code looks like:
^2@2
^      exponentiate
 2     two
  @2   to the 50 (char code of 2)

Answer 52. Befunge-98, distance 8 + 2
Thanks to @DestructibleWatermelon for golfing a byte!
--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej#printf("%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024
print(2^51)--;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Try it Online!
Added '3k before the 2, and '2k*. between the 2 and @.
-- does nothing,
'3k2 puts 52 2s onto the stack, and
'2k*.@ multiplies them together, prints the number, and exits
Also, I added a d" after printf("% to make other people's lives easier, as I had 2 extra characters. It doesn't affect the Befunge-98 program.

Answer 2: ///
/class HelloWorld {static void Main() {
    System.Console.Write(2);
}}//4

+4 chars - ///4
Try it online!

Regarding the answer you deleted: I changed the 8 hour requirement to a more subjective "Just try not to post too much". Feel free to undelete.

@Pavel I want to post another answer again! :P

@boboquack In regards to the edit to the question you just proposed: Different versions of the same language count as the same language. Listing "Python" alone under "Languages used..." seems to be good enough.

@R.Kap Thanks, that actually wasn't what I intended to edit in. The browser just auto-saved an earlier unproposed edit of the post where I copied language names, just to notice you already edited in the language names. When I went to add the multi-posters to the list, my saved version came up without my knowing.

Answer 7: Minkolang, Distance: 4
327;N.""/class HelloWorld {static void Main() 0{;n***~
    System.Console.Write(2);
0}}//4|
8Ḥ

Try it online!
I added 7;N. to the program. Basically 3, 2 and 7 are pushed to the stack and then 2 is raised to the seventh power using ;. This is then outputted as a Number and then the program stops on the .

Answer 10: dc, Distance of 5
#327;N.""/class HelloWorld {static void Main() 0{;n***~
#    System.Console.
1024p#rint(512);
#0}}//4|
#8

Here is a valid dc program which outputs 1024.
Try it online!

That's not how the challenge works, yours is the 10th answer and should print 2^10

@Leo Oh, sorry about that. That's what I get for not reading the post properly. EDIT: It has been updated

Answer 11: Charcoal, distance 5
Ａ#327;N.""/class HelloWorld {static void Main() 0{;n***~
#    System.Console.
1024p#rint(512);
#0}}//4|
β2048

Try It Online!
The uppercase Greek letters Ａ and β are variables which are assigned the ASCII characters following. The final value is implicitly printed.

Wait, why did you change yours to answer 10? Mine was the 10th answer.

@R.Kap I have moved back to 11 with an edit like I made before.

Just a note, if you happen to use Charcoal in the future ⎚ (clear) is shorter

@ASCII-only Ah, right - thanks!

Answer 12: Self-modifying Brainfuck
Ａ#327;N<.""/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
1024p#rint(512);
#0}}//4|
#β6904

Try it online!
SMBF is just like brainfuck, except the source code is available on the tape to the left of the starting position. Here we have the number to print in reverse at the end of the code, and we do <. four times to print all four digits.
I added a < before each . in the code (there were 3 of them), an extra <., and modified the final number. Distance should be 8.

Answer 29: Octave, Distance: 1
disp(2^29)%2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

Try it online!
All I had to do was to change the 28 to 29

Answer 31: JavaScript ES7, Distance 7
alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

ES7 supports the ** operator for power.
You can try online here.

Answer 33: Mathematica, distance 9
2^33 (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'*)

Explanation
Puts everything inside comments and outputs 2^33
Please verify that this answer is valid before putting your own because I am new at this and don't want to end up breaking the chain.

Answer 37: Actually, distance 7
2:37@ⁿ.óout (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Replaced   36?# with :37@ⁿ.ó.
Try it online!

Answer 38: RProgN, distance 10
2 38 ^ exit @ⁿ.óout (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Try it online!
Replaced 2:37 with 2 38 ^ exit  (10) (note the trailing space)
Explanation:
2            2
     ^       to the power of
  38         38
       exit  Stop the prgram

Answer 66, es (shell) + bc, distance 8
#64º,;S)1'a
"bc"<<x
2^66
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^
quit()
@n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:
py
p
riker
i
n
t
(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Changed exit to quit(), and added iker after the first r. I couldn't resist and I wanted to add 4 more characters.

But we need to work towards a goal ;_;

That sounds like a distance of 8 to me.

@SamiLiedes you're right, fixing.

Answer 47: Perl 6, distance 10
#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024
print(2**47);#0}}//4|
#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Perl 6 is considered distinct from Perl. I tried to set up C down the road by adding "% after printf, hopefully someone uses that.
Try it online!

Answer 48: RProgN2, distance 9
"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf("% $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024
print(2**47);#0}}//4|
#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^

Added a " to the start which stopped everything from breaking, the [[[ at the end clears the memory, and 268*^ calculates the new answer. Implicitly printed.
Try it online!

Are you sure this counts? I already posted an RProgN version 1 answer, and I don't think multiple versions of the same language are allowed.

RProgN 2 is a full rework of RProgN 1, Much like how Perl 6 is considered different enough from Perl 5, this is considered valid.

Answer 1: C#
class HelloWorld {static void Main() {
    System.Console.Write(2);
}}

Pro tip: comment out what you don't need.
Try it online!

Answer 9: Python 2
#327;N.""/class HelloWorld {static void Main() 0{;n***~
#    System.Console.
print(512);
#0}}//4|
#8

A very simple port of Perl to Python, with a distance of 4.
Try it online!

Just saying, you could have done *2 for a distance of 2

@KritixiLithos True, but it's below 10 anyway and Python 2 complained about the non-UTF8 char at the end.

@Qwerp-Derp Don't you mean non-ASCII character? Ḥ is a UTF-8 character

Answer 13: SOGL 0.8.2, distance 5
Ａ#327;N<.""/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
1024p#rint(512);
#0}}//4|
#β”6904”±r«

A little explanation:
Ａ#327;N<.               do some random stuff
         "...”          push that string
              6904”     push "6904"
                   ±    reverse
                    r   convert to number
                     «  bitshift left

note: to run this you'll have to replace the newlines to ¶ because that's how the interpreter was made to work.

Answer 15: Pyke
"Ａ#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
1024p#rint(512);
#0}}//4|
#β”6904”±r«"$2 16384*s

Substitutes two ' for two ", adds two $, substitutes 0* for 2(space) and adds *s. (8)
"Ａ#327;N<." String literal, put on stack
"..."$ Is it all lower? No, so put 0 on the stack instead
"/class HelloWorld...#β”6904”±r«" String literal, put on stack
"..."$ Is it all lower? No, so put 0 on the stack instead
2 16384 Numeric literals, put on stack
* Multiply top two numbers on stack, put 32768 on the stack instead
s Sum the whole stack: replace whole stack with 32768
(implicit print stack)
Try it online!

This has been an exercise in learning a language just enough to get past the challenge :D

Answer 18: STATA, distance 10
/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2
puts 16384 8*/di 2^18

Added /* and /di 2^18

Answer 19: bc, 165 bytes, distance: 6
2^19#/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2
#puts 16384 8*/di 2^18

Try it online!
Distance:

Hashes on the first and last line (2)
2^19 (4)

Sorry, my answer above was incorrect. The last digit should be 8 instead of 7.

@bmarks Edited the change

Answer 21: 2sable, 161 bytes, distance: 3
2**20$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2
#puts 16384 8*di 2^18o8*

Try it online!
Distance:

Inserted o (evaluates 2**a where a is the value on top of stack)
Inserted 8
Removed /

Answer 22. Cheddar, distance 10
print 2**22
'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2
#puts 16384 8*di 2^18o8*'

Try it online!
inserted print, changed a 0 to a 2 to print the evaluation of 2**22; inserted a new line and a ' and added a trailing ' wrapping the rest into an unused string.

Answer 23: Pylons, distance 7
#23#2ejprint 2**22
'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2
#puts 16384 8*di 2^18o8*'

Try it online!
Added #23#2ej to the start of the program.
Explanation:
#23#     Push the number 23 to the stack
    2    Push the digit 2 to the stack
     e   Calculate 2^23
      j  Print stack as a string and terminate the program

Answer 25: Pushy, distance 4
2 25e#2ej
printf $[2**24]
#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#ß”6904”±r«"$2
#puts 16384 8*di 2^18o8*'

Try it online!
Added 2 25e# to the start of the program, and removed #23#.
Explanation:
2       Push 2
  25    Push 25
    e   Power
     #  Print

I don't have a clue why this works... it just does.

I think you've misunderstood how the distance measurement works.

Yeah, just noticed the distance is 5, not 4.

I think that's correct. (Sorry, it looked like you were subtracting the length of #23# from that of 2 25e#N, but I see now that you weren't doing that at all, my mistake.)

Wow, someone used Pushy... and the reason this doesn't print other things is because it hits the i, which exits the program, before it can spew out anything else.

@FlipTack I'll try and use it more ;)

Answer 26: CJam, distance 9
2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

Try it online!
That e# at the start saved me much hassle.
Explanation before the e#:2 25)# e# Program.
2      e# 2.
  25   e# 25.
    )  e# Increment.
     # e# Power.
Added: )#
Removed: \n\n\n\n\n\n\n

Answer 28: MATLAB, distance 9
disp(2^28)%2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

Helpfully in the last answer, all of the extraneous code was converted into a MATLAB style comment (%) leaving just 27W as code. This can be converted into code for MATLAB using the disp function to display 2^28 without including ans=.

I used this calculator for the Levenshtein distance because it nicely handles multi-line inputs.

Answer 30: R, Distance of 9
cat(2**30)#2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

Try it online!

cat(2^30) would have reduced the distance to 7 and is more idiomatic.

Answer 34: Pip, distance 5
2**34  (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'*

Try it online!
Changed 2^33 to 2**34 (3)
Added a space (1)
Accidentally removed a trailing ) while copying (1)
Explanation:
2**34 is pretty obvious.
Pip counts two spaces as a comment.

The mathematica answer had a trailing )--did you remove that?

That must have been a mistake copying. I'll edit the distance, so as not to force others' answers to change.

Answer 35: Stacked, distance 10
2  35^out (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Try it online! Changelog:
changed (+3): 2**34 => 2  35
inserted (+4): 35 => 35^out
removed: (+3): ”6904”±r« => 6904±r

Answer 36: GolfScript, distance 3
2  36?#out (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Try it online!
Explanation:
Changed 35 to 36 (1)
Changed ^ to ? (1)
Added # (1)

Answer 39: Scheme, distance 9
(expt 2 39); ^ exit @ⁿ.óout (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Added (expt (with trailing space)
Changed 8 to 9
Added );

Doesn’t this need a print call or something? Or do top-level values get printed in Scheme? (I think that e.g. an answer like 2**39 would be invalid in Python, and this looks similar to that.)

@Lynn Top level values get printed (or so it appears when I click run in Dr. Racket).

Answer 40: Element, distance 6
2 40^`(expt 2 39); ^ exit @ⁿ.óout (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Try it online!
Added 2 40^`
There are no comments or program terminators added, because Element will only print when it comes across a ` character.

Answer 41: J, distance: 6
2^41 NB.`(expt 2 39); ^ exit @ⁿ.óout (*2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Changed from 2 40^ to 2^41 NB.

This outputs perfectly fine on the official J Android app

Alright then, it counts!

Looking at this, it also works like echo program|jconsole, which is another way to invoke J code. So it's valid even by that measure. (It has 3 leading spaces, which is fine as per the challenge definition.)

Answer, 43: Zsh, distance 10
#2^41 NB.`(expt 2 39); ^ exit @ⁿ.óout (*2 32#e#a44******O@)//2 25)#e#2ej#
printf $[2**43]
bye
'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n*
**~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Try It Online !

Well darn, you beat me to it :P

@ConorO'Brien thanks for the clarification

Answer 44: VBA, Distance 10
Anonymous immediate window routine that takes no input and outputs to the VBE immediate window.
?2^44'#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Added ?2^43'and recondensed lines

Argh, you removed my beloved line breaks again !!

Answer 45: Fish (shell), distance 10

Finally, a command
line shell for the 90s

(c) fishshell.com
math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024p#rint(512);#0}}//4|
#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Note that this does not work on TIO Nexus due to lack of white space in ...45#2..., but works just nice on my fish, version 2.0.0.

Answer 65, Bosh (Schily Bourne Shell), distance 10
#64º,;S)1'a
"bc"<<x
2^65
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^
exit
 @n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:
py
p
r
i
n
t
(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Added #, newline in front of bc, replaced 63 with 65, the rest are dummy newlines.

Answer 57: Korn Shell (ksh), distance 10
bc<<<2^57 #x??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@) //2 25)
#e
#2ej
#printf("%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Try It Online !

Answer 61, Dash, distance 10
"bc"<<x
2^61
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^
exit
 @n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:py print(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Changes:

Added " after "bc +1
Replaced < with a newline +1
Appended x +1
Replaced 57 with 61 +2
Removed # +1
Added newline after x +1
Added # +1
Surrounded exit with newlines +2

Total: 1+1+1+2+1+1+1+2=10

Can you add an explanation for what you did?

Answer 62: Vitsy, distance 9
297*1-^N;"bc"<<x
2^61
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^
exit
 @n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:py print(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Try it online!
Added 297*1-^N; (9)
Explanation:
2           2
      ^     to the power of
 9          (9
   *        multiplied by
  7         7
     -      minus
    1       one)
       N    print as integer
        ;   terminate program

Answer 63, C Shell (csh), distance 10
"bc"<<x
2^63
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^
exit
 @n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:py print(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Erased answer #62 by @Okx (sorry !), changed 61 to 63.

Dang it, I should've added another character to mess you up :P

Answer 46: Reticular, distance 9
28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.óout (*2 32#e#a44******O@)//2 25)#e#2ej#printf $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.#1024p#rint(512);#0}}//4|
#ß6904±r"$2 #puts 16384 8*di 2^18o8*'*

Added 28@P2*Jp;
Explanation:
2         Push 2
 8@P      Push 8th prime 0-indexed (23)
    2     Push 2
     *    Multiply (46)
      J   Exponentiate
       p  Print
        ; Terminate progrma

Try it online!

Answer 55: FOG, distance 8
?92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej
#printf("%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

? does nothing, 92a5* makes 55, 2p@ powers and ends the program, auto-outputting.  Also added a newline before #printf.
I inserted 9 before the first 2, 5*2p@ after it.

Answer 54, QBIC, distance 8
?2^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej#printf("%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Removed newline
Added # after the `
Prepended ?2^54┘
Removed Herobrine

for a total Levenstein distance of 8.
The # at the start of the previous answer creates a 'silent string literal' in QBIC: it declares and fills A$, but doesn't use it right away. All the code up until the backtick is placed into that string. There is a backtick in that code, so we need to manually add another # to repeat this trick (with B$).

Answer 68, Jellyfish, distance 10
PC68º,;n*:"C"
BBc"<<x
2**66
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^
qut()
@n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:
py
p
r1ker
s
n
t
(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#

Try it online!

Answer 69, Vyxal, distance 6
`C68º,;n*:"C"
BBc"<<x
2**66
x
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.#(expt 2 39); ^
qut()
@n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:
py
p
r1ker
s
n
t
(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#`69E

Try it Online!

Added a backtick att tthe start and end
Appended 69E
Removed an existing backtick

haha 69 nice.

Answer 70 - Desmos, distance 8
`C68º,;n*:"C"
BBc"<<x
2**66
o=2^{70}
#??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.#(expt 2 39); ^
qut()
@n.out (*2 32#e#a44******O@) //2 25)
"e
"2ej
:
py
p
r1ker
s
n
t
(2**60)
"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#`69E

Try it on Desmos!
Changed line 4 from x to o=2^{70} (1 substitution + 7 insertions = distance of 8).
The entirety of this relies on the fact that Desmos treats all lines as distinct expressions/equations. That is, if lines 1 and 2 aren't defined by each other, then line 2 will still "run" even if line 1 causes an error.
Output is shown in the grey box next to a proper variable declaration, which is what happens on line 4 of the code. All others are basically junk due to various reasons. Line 4 had to be edited, though, because a stray x could display the line y=x on the graph.

Answer 14 ShapeScript, distance 9
'Ａ#327;N<.""/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
1024p#rint(512);
#0}}//4|
#β”6904”±r«'0*16384

Try it online!
Place everything in a string by enclosing between two 's, multiply that string by 0 with 0* then push the integers 1, 6, 3, 8, and 4 onto the stack, which then gets implicitly printed.
...should be ripe for a change to ...2*16384.

Answer 16: Ruby, distance 8
#"Ａ#327;N<."$"/class HelloWorld {static void Main() 0{;n***~
#    System<.Console<.<.
#1024p#rint(512);
#0}}//4|
#β”6904”±r«"$2
puts 16384*4

added 2 #'s, a newline and puts, and changed s to 4.

Glad to see I didn't stuff it up! :D

Answer 32: Convex, distance 7
2 32#e#alert(2**31)//2 25)#e#2ej#printf $[2**24]#'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024p#rint(512);#0}}//4|#ß”6904”±r«"$2 #puts 16384 8*di 2^18o8*'

Try it online!
Added 2 32#e#.
Explanation:
2       Push 2
  32    Push 32
    #   Power
     e# Line comment

Answer 58: Julia, distance 10
#bc<<<2^57 #x??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@) //2 25)
#e
#2ej
print(2^58) #"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Try it online!

Answer 59, Python 3, Distance of 3
#bc<<<2^57 #x??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@) //2 25)
#e
#2ej
print(2**59) #"%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Answer 53, Gnuplot, distance 5
#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej#printf("%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024
print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Answer 56: Qwerty-RPN, distance 7
2 56^#x??92a5*2p@^54┘#--2'3k:'2k*.@2(#"#28@P2*Jp;math 2\^45#2^41 NB.`#(expt 2 39); ^ exit @n.out (*2 32#e#a44******O@)//2 25)#e#2ej
#printf("%d" $[2**43]bye'$/*#"A#327;N<."$"/class HelloWorld {static void Main() 0{;n***~#    System<.Console<.<.#1024print(2**53)--0;#0}}//4|#6904r"$2 #puts 16384 8*di 2^18o8*'*[[[268*^?>

Added 2 56^#x (7)
Explanation:
2       Push 2
 56     Push 56
   ^    Calculate exponent
    #   Print
     x  Terminate program

Unfortunately, there is no online interpreter for this language.

This should be answer 56.

I didn't see the because if I look at the answer above, it says 54. Apparently 55 was posted before 54? It goes 50-55-51-52-53-54 sorted by oldest first.

I posted a bad answer, then deleted it. I edited it into a good answer after, but that was after 4 other answers. Look at the rev history.

@Riker well, I guess you messed up the order there! I'll edit my answer anyway.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Letter, Number, Symbol, Space, Repeat
There are 97 ASCII characters that people encounter on a regular basis. They fall into four categories:

Letters (52 total)
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

Numbers or Digits (10 total)
0123456789

Symbols & Punctuation (32 total)
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

Whitespace (3 total)
Space  , tab \t, and newline \n. (We'll treat newline variants like \r\n as one character.)

For conciseness, we'll call these categories L, N, S, and W respectively.
Choose any of the 24 permutations of the letters LNSW you desire and repeat it indefinitely to form a programming template for yourself.
For example, you might choose the permutation NLWS, so your programming  template would be:
NLWSNLWSNLWSNLWSNLWS...

You need to write a program or function based on this template, where:

Every L is replaced with any letter (ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz).
Every N is replaced with any number (0123456789).
Every S is replaced with any symbol (!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~).
Every W is replaced with any whitespace character ( \t\n).

Basically, your code must follow the pattern
<letter><number><symbol><whitespace><letter><number><symbol><whitespace>...

as the question title suggests, except you may choose a different ordering of the four character categories, if desired.
Note that:

Replacements for a category can be different characters. e.g. 9a ^8B\t~7c\n] validly conforms to the template NLWSNLWSNLWS (\t and \n would be their literal chars).
There are no code length restrictions. e.g. 1A +2B - and 1A +2B and 1A  and 1 all conform to the template NLWSNLWSNLWS....

What your template-conformed code must do is take in one unextended ASCII character and output a number from 0 to 4 based on what category it is a member of in the categorization above. That is, output 1 if the input is a letter, 2 if a number, 3 if a symbol, and 4 if whitespace. Output 0 if the input is none of these (a control character).
For input, you may alternatively take in a number 0 to 127 inclusive that represents the code of the input ASCII character.
The input (as char code) and output pairs your code must have are precisely as follows:
in out
0 0
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 4
10 4
11 0 or 4
12 0 or 4
13 0 or 4
14 0
15 0
16 0
17 0
18 0
19 0
20 0
21 0
22 0
23 0
24 0
25 0
26 0
27 0
28 0
29 0
30 0
31 0
32 4
33 3
34 3
35 3
36 3
37 3
38 3
39 3
40 3
41 3
42 3
43 3
44 3
45 3
46 3
47 3
48 2
49 2
50 2
51 2
52 2
53 2
54 2
55 2
56 2
57 2
58 3
59 3
60 3
61 3
62 3
63 3
64 3
65 1
66 1
67 1
68 1
69 1
70 1
71 1
72 1
73 1
74 1
75 1
76 1
77 1
78 1
79 1
80 1
81 1
82 1
83 1
84 1
85 1
86 1
87 1
88 1
89 1
90 1
91 3
92 3
93 3
94 3
95 3
96 3
97 1
98 1
99 1
100 1
101 1
102 1
103 1
104 1
105 1
106 1
107 1
108 1
109 1
110 1
111 1
112 1
113 1
114 1
115 1
116 1
117 1
118 1
119 1
120 1
121 1
122 1
123 3
124 3
125 3
126 3
127 0

Inputs 11, 12, and 13 correspond to characters that are sometimes considered whitespace, thus their outputs may be 0 or 4 as you desire.
The shortest code in bytes wins.

Cookies to the first answer in a 2d language.

So just use BF and use letters SSSS

This basically excluded all conventional programming languages  Also, what to do with languages that uses its own code page e.g. Jelly?

@Chris SSSS is not a permutation of LNSW

I will almost guarantee you will not get many if any answers

Are all other characters in the Unicode range considered symbols, or are some letters and a sprinkling numbers and whitespace (as per appearance), or are they banned?

Other characters are not allowed.

@ChristopherPeart There are quite a few languages where they will just ignore no ops

Unary will win!

Is it acceptable to have leading and trailing whitespace in the output? (eg. \n<space>1\n<space>)

Use brainF with LNSW. Use anything for the LNW, and put the program in the S.

Haskell 300 bytes
This code should have no trailing newline. The function m1 takes the input as a Char and returns the answer as a Char.
f1 (l1 :n1 :p1 :y1 :l2 :n2 :p2 :y2 :r3 )x1 |y1 >p1 =b1 (x1 )y2 (f1 (r3 )x1 )y1 (n1 )n2 |p2 <p1 =b1 (x1 )y1 (n1 )p2 (f1 (p2 :y2 :r3 )x1 )l2 |p2 >p1 =b1 (x1 )p1 (l2 )l1 (n2 )n1
;b1 (x1 )s1 (r1 )b1 (r2 )r3 |x1 <s1 =r1 |x1 >b1 =r2 |s1 <b1 =r3
;m1 =f1 "d0 \t4 \r0 ~d3 {d1 `d3 [d1 @d3 :d2 /d3 !d4 \n0 ?d0 "

I couldn't resist a challenge that someone claimed was impossible for "conventional" languages.
You may dispute whether Haskell counts, but the majority of keywords and identifiers are multiple characters and cannot be used. However, top level function definitions, lists, string literals, strict comparisons, pattern matching and branching with guards work, as long as letters come just before digits, and if symbols also come just before letters we have escape characters like \t and \r. Unfortunately the permutations that work for general programming don't allow numeric literals, so I couldn't get numbers in any useful way.
How it works:

The intervals of character classes are encoded in the string on the last line, with boundary characters at most of the symbol places and the results in most of the digit places, although some at the ends are padding.
The main function is m1.
x1 is the character being analyzed.
The f1 function breaks up the string with list pattern matching, and has three branches: for when the boundaries are symbols larger than space, for when the boundaries are escaped control characters smaller than space, and for handling the final comparison to space itself. The names of the list pieces are mnemonic for the first branch: Letter, Number, sPace, sYmbol, Remainder.
The b1 function handles branching for two boundary characters s1 < b1 at a time.

Try it online

Welcome to the site! My guess is this will be shorter than most non-conventional languages that can actually achieve the required result.

Gret answer!  I tried using Haskell but gave up after a short while ...

Retina, 113 bytes
Letter, Number, Space, Symbol, Repeat
T1 `a0 @a0 `b1	:D0
+T1 `d9 `a2
+T1 `a9	\n9 `a4
+T1 `l9 @L9 `a1
+T1 `d9 @p9 `d3
\b4
$n3
\b3
$n2
\b2
$n1
\b1
$n0
\n

Try it online!
Test it on itself!
Retina seems like a nice tool for this job: we can use all types of characters flexibly in stage configuration, and we have some predefined character classes that can be useful.
I think this problem could be solved with either Replacement stages or Transliteration stages; I've chosen the Transliterations because they are more flexible and they have the most useful character classes.
Regarding the pattern of the source, I was forced to put symbols right before letters in order to use \n for newlines (I actually had a shorter solution using the more practical ¶ for newlines, but non-ascii characters are banned).
Explanation
The first stages are transliterations. We use + and 1 as options to keep the pattern going but they won't affect the result of the stage. The syntax is T`from`to to map each character of from to the character in the same position in to. If to is shorter than from, its final character is repeated as much as needed. If from has repeated characters, only the first occurrence of each one is considered. Some letters correspond to character classes, e.g. d is equivalent to 0123456789.
T1 `a0 @a0 `b   :D0

With this we map some characters to other characters of the same class in order to "make some room" for following transliterations. (a->b,0->1,space->tab,@->;). The final :D0 is just a smiley :D0
+T1 `d9 `a2

We start with digits, d is the character class 0-9, here we're transforming 0->a,1-9->2,space->2: the transliterations for 0 and space are wrong, but those characters have been eliminated by the previous transliteration.
+T1 `a9 \n9 `a4

Whitespace, transform a->a,(9,tab,\n,space)->4. 9 was already removed in the previous stage.
+T1 `l9 @L9 `a1

Letters, here we use two different character classes (for lack of a more complete one): l for lowercase letters and L for uppercase letters. They all get mapped to 1, along with some other characters which have been dealt with in the previous stages
+T1 `d9 @p9 `d3

Symbols. Since every other class has been turned into a digit, here we map all digits to themselves with d->d, and then all printable characters to 3 with p->3. Digits are also among printable characters, but the first transliteration wins.
Now we need to assign 0 to control characters, but I've found no valid way to explicitly address that class. Instead, we'll convert each digit to unary: control characters are not digits and so they are considered as the empty string, which equals 0 in unary. Unfortunately, the unary conversion command in retina is $*, which are two symbols near each other, so we'll instead convert "manually" using substitutions.
\b4
$n3
\b3
$n2
\b2
$n1
\b1
$n0

Our unary digit is $n, which is a replacement pattern for newlines. \b matches a "boundary", where an alphanumeric word starts or ends: in our case this will always match before any number. We are basically replacing each number n with a newline plus n-1.
\n

In the end, we count the number of newlines and get the desired result.

Cardinal 2240 2224 bytes
Template used LSNW
a%1
a:1 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a+1 a+1 a+1 a+1 a.1 x.1 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a.0 a>0 a+1 a+1 a+1 a+1 a.1 x>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a+1 a+1 a+1 a.0 x>1 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a+1 a+1 a.0 x>1 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a>0 a+1 a+1 a+1 a.0 x>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a+1 a.0 x>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a+1 a+1 a+1 a.0 x>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a>1 a+1 a.0 x>1 a>1 a>1 a>1 a>1 a>1 a>1 a+1 a+1 a+1 a.0
a>1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a>1 a>1 a>1 a>1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a>1 a>1 a>1 a>1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a>1 a>1 a>1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a>1 a>1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a>1 a>1 a>1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a>1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a>1 a>1 a>1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^1 a>1 a-1 J^1 a-1 J^1 a-1 J^1 a-1 J^0 a.0

The code has a trailing newline.
How it works:
This code has a lot of characters that aren't used.
% releases a pointer in all directions. 3 of them just hit the end of a line and die.
The last pointer takes in an input at the :
This input is then compared to each value from 0 to 127.
Prints:
0 for 0-8
4 for 9-12
0 for 13-31
4 for 32
3 for 33-47
2 for 48-57
3 for 58-64
1 for 65-90
3 for 91-96
1 for 97-122
3 for 123-126
0 for 127
Operations used:
J = Skip next operation if non-zero
^ = Change direction to up
> = Change direction to left
- = Decrement
+ = Increment
: = Take input
% = Create pointers at start of program
x = Remove pointer
0 = Set active value of pointer to 0
Try it online

Perl 5, 293 bytes
291 bytes code + 2 for -0p.
I have been advised the command-line flags are free, but I've added them here for visibility, as the TIO link doesn't include -0, for easier testing.
y 0-a 1"a 1#a 1$a 1%a 1&a 1'a 1(a 1)a 1*a 1+a 1,a 1.a 1/a 1_a 1{a 1|a 1}a 1~a 0!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 1!a 0;s 0\s
0\t
0;s 0\d
0\r
0;s 0\w
0\n
0;y 1!a 9-a 1_a 0-Z 1;s 0\w
0\u 3\u 0;s 1\S
1\u 0\u 1;s 0\t
0\u 4\u 0;s 0\r
0\u 2\u 0;s 0\n
0\u 1\u 0

Try it online!
This is a particularly tricky challenge to solve in almost any language, so I'm pretty happy I was able to (finally, lots of tinkering on and off for quite some time) get this working in Perl. Hopefully the additional whitespace before and after the number isn't an issue.
Selecting the sequence order was particularly tricky, but forunately s/// and y/// can accept any other character as a delimiter so it was possible to use letter, space, number, symbol, which allows for s 0...0...0; and y 0...0...0;.
The first thing required for the appraoch was to replace _ with ! so that \w would only match [0-9a-zA-Z], then replace all whitespace (\s) with \t, all digits with \r and all remaining word characters (\w) with \n for easy matching later on. Then, using the y/// operator, all remaining symbols are converted to word characters ! to _ and all other chars (between 9 and a) are shifted down 9 places, turning them into letters or numbers. These are then replaced via \w with 3 and the other, previously made substitutions are replaced with their numbered values.

Whitespace, 1332 bytes
Y0! Y0! Y0! Y0!
Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0!
Y0! Y0! Y0! Y0!
Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0!
Y0!
Y0! Y0!
Y0! Y0! Y0!
Y0!
Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0!
Y0! Y0! Y0!
Y0!
Y0!
Y0!
Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0!
Y0! Y0! Y0!
Y0!
Y0!
Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0! Y0!
Y0! Y0!
Y0! Y0! Y0!
Y0!
Y0!
Y0!
Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0!
Y0! Y0! Y0!
Y0!
Y0!
Y0!
Y0! Y0! Y0! Y0! Y0!
Y0! Y0! Y0! Y0!
Y0! Y0!
Y0! Y0!

Order is 1234/LNSW (letter, digit, symbol, whitespace).
Try it online (input as integer representing the unicode of a character).
Explanation:
Whitespace is a stack-based language where every character except for spaces, tabs and new-lines are ignored. Here is the same program without the YO! (333 bytes):
[S S S N
_Push_0][S N
S _Duplicate_0][T   N
T   T   _Read_STDIN_as_integer][T   T   T   _Retrieve][S N
S _Duplicate_input(9)][S N
S _Duplicate_input(10][S N
S _Duplicate_input(32)][S N
S _Duplicate_input(33-47)][S N
S _Duplicate_input(48-57)][S N
S _Duplicate_input(58-64)][S N
S _Duplicate_input(65-90)][S N
S _Duplicate_input(91-96)][S N
S _Duplicate_input(97-122)][S N
S _Duplicate_input(123-126)][S S S T    S S T   N
_Push_9][T  S S T   _Subtract][N
T   S S N
_If_0_Jump_to_Label_WHITESPACE][S S S T S T S N
_Push_10][T S S T   _Subtract][N
T   S S N
_If_0_Jump_to_Label_WHITESPACE][S S S T S S S S S N
_Push_32][T S S T   _Subtract][S N
S _Duplicate][N
T   S S N
_If_0_Jump_to_Label_WHITESPACE][N
T   T   S T N
_If_negative_Jump_to_Label_NONE][S S S T    T   S S S S N
_Push_48][T S S T   _Subtract][N
T   T   N
_If_negative_Jump_to_Label_SYMBOL][S S S T  T   T   S T S N
_Push_58][T S S T   _Subtract][N
T   T   S S N
_If_negative_Jump_to_Label_DIGIT][S S S T   S S S S S T N
_Push_65][T S S T   _Subtract][N
T   T   N
_If_negative_Jump_to_Label_SYMBOL][S S S T  S T T   S T T   N
_Push_91][T S S T   _Subtract][N
T   T   T   N
_If_negative_Jump_to_Label_LETTER][S S S T  T   S S S S T   N
_Push_97][T S S T   _Subtract][N
T   T   N
_If_negative_Jump_to_Label_SYMBOL][S S S T  T   T   T   S T T   N
_Push_123][T    S S T   _Subtract][N
T   T   T   N
_If_negative_Jump_to_Label_LETTER][S S S T  T   T   T   T   T   T   N
_Push_127][T    S S T   _Subtract][N
T   T   N
_If_negative_Jump_to_Label_SYMBOL][N
S N
S T N
_Jump_to_Label_NONE][N
S S S N
_Create_Label_WHITESPACE][S S S T   S S N
_Push_4][T  N
S T _Print_as_integer][N
N
N
_Exit][N
S S N
_Create_Label_SYMBOL][S S S T   T   N
_Push_3][T  N
S T _Print_as_integer][N
N
N
_Exit][N
S S S S N
_Create_Label_DIGIT][S S S T    S N
_Push_2][T  N
S T _Print_as_integer][N
N
N
_Exit][N
S S T   N
_Create_Label_LETTER][S S S T   N
_Push_1][T  N
S T _Print_as_integer][N
N
N
_Exit][N
S S S T N
_Create_Label_NONE][S S S N
_Push_0][T  N
S T _Print_as_integer]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.
Try it online.
Program in pseudo-code:
If the input is 9, 10 or 32: call function WHITESPACE()
Else-if the input is below 32: call function NONE()
Else-if the input is below 48: call function SYMBOL()
Else-if the input is below 58: call function DIGIT()
Else-if the input is below 65: call function SYMBOL()
Else-if the input is below 91: call function LETTER()
Else-if the input is below 97: call function SYMBOL()
Else-if the input is below 123: call function LETTER()
Else-if the input is below 127: call function SYMBOL()
Else (the input is 127 or higher): call function NONE()

WHITESPACE():
  Print 4
  Exit program
SYMBOL():
  Print 3
  Exit program
DIGIT():
  Print 2
  Exit program
LETTER():
  Print 1
  Exit program
NONE():
  Print 0
  (Implicit exit with error: Exit not defined)


text:
Blink the webcam light!
This challenge is inspired by Blink the CAPS LOCK by zeppelin.
Most webcams feature a small integrated LED light, indicating if the webcam is in use, as controlled by a hardware mechanism to prevent spying.

Your task is to blink it:

Turn it on.
Wait for 0.5 (±0.1) seconds.
Turn it off again.
Wait for 0.5 (±0.1) seconds;
Repeat.

Please include a GIF or video of the webcam blinking, if possible. If an answer doesn't have the GIF, please add a GIF of the program running.
Rules

If your language is missing a subsecond sleep command, your program may use a 1 second delay instead, at a penalty of an additional byte. (replacing .5 with 1)

If your language, for some reason, doesn't support .5, your penalty is 2 bytes. (replacing 0.5 with 1)

Your program must loop unless halted by the user.
Your LED can start either on or off; whichever is more beneficial can be used.
If your LED has a turning-off delay, then it doesn't have to be taken into account, unless if you want to provide an additional version.

See this comment and its answer for more information.

Scoring
This is code-golf, which means the shortest answer in bytes wins.

My laptop's webcam LED takes a while (around 0.3 seconds, it seems) to turn off after the video device stops being accessed. Does this have to be taken into account?

@Doorknob No, but you can provide a version that takes it into account if you'd like.

The penalty should only be 1 byte, since you can just use .5

@Elronnd I was going to add that, but I forgot.

MATLAB, 40 bytes
while 1;w=webcam;pause(.5);delete(w);end

Creates an infinite while loop and each time through the loop, a webcam object is initialized (turns on the webcam), the script is paused for 0.5 seconds using pause, and then the webcam object is deleted (turning the webcam off).

The delay between each blink is more than 0.5

@haykam The directions (and comments) indicate that inaccuracies due to the hardware are acceptable unless I'm misreading them.

Ok... do you mind maybe adding an additional golf that does it so it looks like 0.5s?

@haykam It's impossible, it's a limitation of MATLAB (and maybe the hardware itself). I am already showing it being turned off and back on as fast as possible.

Last beep was good

Python, 82 bytes
(Uses OpenCV for accessing the webcam.)
import cv2,time
s=time.sleep
while 1:w=cv2.VideoCapture(0);s(.5);w.release();s(.5)

Javascript (ES6), 100 bytes
(f=_=>navigator.getUserMedia({video:1},x=>s(_=>x.getTracks()[0].stop(s(f,500)),500),s=setTimeout))()

During my testing, I saw a delay between the camera being activated and the LED turning on, so the timing may not be perfect. It also must run on an https:// page.

@haykam thanks for the edit, but for some reason this script doesn't work inside the snippet iframe sandbox

Scratch in  scratchblocks2, 61 bytes
when gf clicked
turn video[on v
wait(.5)secs
turn video[off v

Sorry about the absolutely terrible video. My LED has a slight turning-on delay, it is very faint, and the GIF is 18 MB.

@JonathanFrech I've taken a look at some Scratch answers and they all seem to use scratchblocks2.  Secondly, I was doing what the challenge required?

"Please include a GIF or video of the webcam blinking, if possible. If an answer doesn't have the GIF, please add a GIF of the program running."
I included everything else above it.

You are right. I seldom see a Scratch answer but it appears that your answer satisfies both the current byte count consensus and challenge-specific rules. Sorry for my partially uninformed critique.