[Question]
  [
# Introduction
Every letter in the English alphabet can be represented as an ASCII code. For example, `a` is `97`, and `S` is `83`. As we all know, the formula for averaging two numbers \$x\$ and \$y\$ is \$\frac{x+y}{2}\$. I'm pretty sure you can see where this is going. Your challenge is to average two letters.
# Challenge
Your program must take two letters as input, and output the average of the ASCII values in it. If the average is a decimal, you should truncate it.
* Input will always be two ASCII letters. You can assume they will always be valid, but the case may vary. Basically, both letters will be in the range `97-122` or `65-90`. The second letter will always have a greater ASCII value than the first. If your language has no method of input, you may take input from command line arguments or from a variable.
* You must output the ASCII character signified by the average of the two numbers. As stated above, it should always be truncated to `0` decimal places. If your language has no method of output, you may store it in a variable. Exit codes and return values are considered valid output methods.
# Example I/O
* `Input: A, C`  
`Output: B`
* `Input: a, z`  
`Output: m`
* `Input: d, j`  
`Output: g`
* `Input: B, e`  
`Output: S`
* `Input: Z, a`  
`Output: ]`
# Rules
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer in bytes wins!
  
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 20 bytes
```
a=>b=>(char)(a+b>>1)
```
[Try it online!](https://tio.run/##Sy7WTS7O/O9Wmpdsk5yRWKSDYIEIO7s02/@JtnZJtnYaIL6mRqJ2kp2doeZ/a67wosySVI00DfVEdU0N9WR1TU3r/wA "C# (Visual C# Interactive Compiler) ‚Äì Try It Online")
[Answer]
# x86-16 machine code, IBM PC DOS, ~~13~~ ~~12~~ 10 bytes
Binary (xxd):
```
00000000: a182 0002 c4d0 e8cd 29c3            ..........
```
Listing:
```
A1 0082     MOV  AX, [0082H]    ; load two chars into AH and AL from command line
02 C4       ADD  AL, AH         ; AL = AL + AH 
D0 E8       SHR  AL, 1          ; AL = AL / 2 
CD 29       INT  29H            ; write to console 
C3          RET                 ; return to DOS 
```
Standalone PC DOS executable. Input is via command line, output to console.
Example:
[![enter image description here](https://i.stack.imgur.com/ROu9m.png)](https://i.stack.imgur.com/ROu9m.png)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 4 bytes
```
OSH·ªå
```
[Try it online!](https://tio.run/##y0rNyan8/98/2OPh7p7///8rpSjpKChlKQEA "Jelly ‚Äì Try It Online")
# Explanation
```
OSH·ªå  Main Link: takes (a, b)
O     (ord(a), ord(b))
 S    sum; ord(a) + ord(b)
  H   halve; (ord(a) + ord(b)) / 2
   ·ªå  chr
```
[Answer]
# [Poetic](https://mcaweb.matc.edu/winslojr/vicom128/final/index.html), 163 bytes
```
software inside a computer
a robot+a man+a keypad+a plan=a PC
still,P.C.this,P.C.that?i await a day i crush a PC
resist P.C,Google,or an Apple
i do Linux,i suppose
```
[Try it online!](https://mcaweb.matc.edu/winslojr/vicom128/final/tio/index.html?LYwxDsIwEAT7vGJ7rPwAIZSChiJfuOCDnHB8lu@ikNcHC9GMpphd06dvVBmSTSKD8NClrM61I1Sd1E@EhXLjm/dCsUlJlM@EcejMJaUw9kPvs9hfyC8C2ki8vUXaIXjU1Wb8JpVNzNHScFN9JQ5aQRnXUhJ3gqi4S14/QWBrKWp8jMMxUfwC)
Poetic is an esolang I made in 2018 for a class project. It's basically brainfuck with word-lengths instead of symbols.
(I actually use PC myself. üòâ)
[Answer]
# [J](http://jsoftware.com/), 17 bytes
```
(+/<.@%#)&.(3&u:)
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/NbT1bfQcVJU11fQ0jNVKrTT/a3KlJmfkK6g7qSvYKqQpqDs6q0NFcqEiiVUwkXSoSEqWusJ/AA "J ‚Äì Try It Online")
* `(+/<.@%#)` truncated average...
* `&.` ["Under"](https://code.jsoftware.com/wiki/Vocabulary/ampdot), which applies a transform, then the verb it modifies -- truncated avg in this case -- then the inverse transform....
* `3&u:` convert to ascii byte integer.
That is, it converts each letter to its ascii number, gets the truncated average of those, and applies the inverse of "convert to ascii number", which takes an ascii number and returns a letter.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 22 bytes
```
->a,b{""<<(a+b).sum/2}
```
[Try it online!](https://tio.run/##KypNqvyfZvtf1y5RJ6laScnGRiNRO0lTr7g0V9@o9n9BaUmxQrS6o7O6jnpiFZBIyVKP1ctNLKiuSa5Ji9ZK1kvOSCwqjq39DwA "Ruby ‚Äì Try It Online")
[Answer]
# [R](https://www.r-project.org/), ~~56~~ 37 bytes
```
intToUtf8(mean(utf8ToInt(scan(,""))))
```
[Try it online!](https://tio.run/##K/r/PzOvJCQ/tCTNQiM3NTFPoxTICsn3zCvRKE4GcnWUlDSB4L9SYorSfwA "R ‚Äì Try It Online")
**Description**
* `intToUtf8()` converts the average into its ASCII character.
* `mean()` takes the average which is automatically truncated.
* `utf8ToInt()` converts the inputs into two ASCII numbers.
* `scan()` allows inputs.
[Answer]
# [Keg](https://github.com/JonoCode9374/Keg) `-ir` `-oc`, ~~5~~ 2 bytes (SBCS)
Works in all 3 test cases.
```
+¬Ω
```
[Try it online!](https://tio.run/##y05N///fXttI/1HLkv//HZ0B "Keg ‚Äì Try It Online")
# Explanation
```
-ir will *not* try to evaluate the input
+   Add them
 ¬Ω  Halve the value
-oc Output all as a character, if possible
Implicit print. The output is print nice by default.
```
```
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), 8 bytes
**Solution:**
```
`c$.5*+/
```
[Try it online!](https://tio.run/##y9bNz/7/PyFZRc9US1tfKbFK6f9/AA "K (oK) ‚Äì Try It Online")
**Explanation:**
Sum, multiply by 0.5 and convert to ASCII. 
```
`c$.5*+/ / the solution
      +/ / sum (add-over)
   .5*   / multiply by 0.5
`c$      / convert to ASCII
```
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 56 bytes
```
printf \\x$(printf %x $[`printf "(%d+%d)/2" \'$1 \'$2`])
```
[Try it online!](https://tio.run/##S0oszvj/v6AoM68kTSEmpkJFA8pWrVBQiU6AcpQ0VFO0VVM09Y2UFGLUVQxBhFFCrOb///8d/zsDAA "Bash ‚Äì Try It Online")
[Answer]
# Shakespeare Programming Language, 144 bytes
[Try it online!](https://tio.run/##TYsxDsIwEAS/sg@Ijj5dCopUIKVCiOLsHGBC7BCfBXm9sanoZlazcXnmvKPuwZ@GjslODXVW0bc0WPFS4bz3KitqAvYjanWp1h4W8ZidH3/PPz2FBBehd8ErBXXiFUb0LQXKFtOMcN1K1INh3A2WlYZFeCqfjXJm8wUj)
(Whitespace added for readability)
```
/.Ajax,.Puck,.Act I:.Scene I:.[Enter Ajax and Puck]
Ajax:Open mind.
Puck:Open mind.
You is the quotient betweenthe sum ofyou I a big cat.
Speak thy.
```
Simple enough, just finds the average. ASCII characters and numbers are identical in SPL, so this language was ideal for the task.
[Answer]
# dzaima/APL, 11 bytes
```
(+/√∑‚â¢)‚ç¢‚éïUCS
```
[Try it online!](https://tio.run/##SyzI0U2pSszMTfz/P@1R2wQNbf3D2x91LtJ81LvoUd/UUOfg/0AKKJGm7qiuoO6szgXjJgK5VQhuCpCbpf4fAA "APL (dzaima/APL) ‚Äì Try It Online") dzaima/APLs `‚éïUCS` - convert to/from char currently ignores the fractional part of the given number, so no floor is necessary.
[Answer]
# [Befunge-98 (PyFunge)](https://pythonhosted.org/PyFunge/), 7 bytes
```
~~+2/,@
```
[Try it online!](https://tio.run/##S0pNK81LT9W1tNAtqAQz//@vq9M20tdx@P/f0RkA "Befunge-98 (PyFunge) ‚Äì Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 31 bytes
```
lambda*A:chr(sum(map(ord,A))/2)
```
[Try it online!](https://tio.run/##Jcu9CoMwEADg2T5FtruTg4KjoBB8jOpwNgQtzQ/RDvryacTtW7547EvwTbbdmL/iZiO1bt9Lwu3n0EnEkAxromdD2YakhGe1evVC0MAwALFCkMLzpin8AE3to4pp9fsVGLoe2GIh5T8 "Python 2 ‚Äì Try It Online")
[Answer]
# [jq](https://stedolan.github.io/jq/), 23 characters
```
[explode|add/2]|implode
```
Sample run:
```
bash-5.0$ jq -Rr '[explode|add/2]|implode' <<< 'AC'
B
```
[Try it online!](https://tio.run/##yyr8/z86taIgJz8ltSYxJUXfKLYmMxfM/f/f0ZkrsYorJetffkFJZn5e8X/doP@6RQA "jq ‚Äì Try It Online")
[Answer]
# Excel, 28 bytes
```
=CHAR((CODE(A1)+CODE(B1))/2)
```
[Answer]
# [Lua](https://www.lua.org/), ~~42~~ 41 bytes
```
a=...print(a.char(a:byte()+a:byte(2)>>1))
```
[Try it online!](https://tio.run/##yylN/P8/0VZPT6@gKDOvRCNRLzkjsUgj0SqpsiRVQ1MbyjDStLMz1NT8D1RbBQA "Lua ‚Äì Try It Online")
Removed 1 byte using [ouflak's method](https://codegolf.stackexchange.com/a/195630/71126) of taking input as a single command line argument.
Takes input as a single command line argument of two characters. Uses the convenient operator precedence of `>>`.
Note that this is actually a full standalone Lua 5.3 program, because command line arguments are accessible as a top-level vararg.
[Answer]
# [Julia 1.0](http://julialang.org/), 26 bytes
```
a\b=Char(sum(Int[a,b])√∑2)
```
TIO was timing out for me, so only tested at REPL.
[Try it online!](https://tio.run/##yyrNyUw0rPj/PzEmydY5I7FIo7g0V8MzryQ6UScpVvPwdiPN/w7FGfnlCuqO6jHqzupcUJ4hkBel/h8A "Julia 1.0 ‚Äì Try It Online")
[Answer]
# [Preproc](https://gitlab.com/PavelBraginskiy/preproc), 1187 bytes
```
#define A
#define B,
#define C,,
#define D,C
#define E,D
#define F,E
#define G,F
#define H,G
#define I,H
#define J,I
#define K,J
#define L,K
#define M,L
#define N,M
#define O,N
#define P,O
#define Q,P
#define R,Q
#define S,R
#define T,S
#define U,T
#define V,U
#define W,V
#define X,W
#define Y,X
#define Z,Y
#define a Z H
#define b,a
#define c,b
#define d,c
#define e,d
#define f,e
#define g,f
#define h,g
#define i,h
#define j,i
#define k,j
#define l,k
#define m,l
#define n,m
#define o,n
#define p,o
#define q,p
#define r,q
#define s,r
#define t,s
#define u,t
#define v,u
#define w,v
#define x,w
#define y,x
#define z,y
#define _(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,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j08T7VVG7VWK7VUCzVXMzVVEzVWIzVUA9VXPdVVHdVWuge9ET0olapE/VMf6q96V29vh78/KlYt1VQNVVev6kU9qyf1qB5UTVXVvbpTt@pGXasrdakuVEWdq7IqqSLFwmf@tEhULES/o6NKXyplZ7li7uR4XrbzbKP8vVE6bMRE8fEqPlwlRMnXlpR@Kc3Ockm24ew823DfG@lhY0@0P17tszvYf23F31vvuRN9UD9e5k8b2Wxms5XN@Gem2XTZ9NkM2Wxns5PNbuHzPw "Preproc ‚Äì Try It Online")
Defines a macro `$` which can be called (as shown in the footer of the TIO link above)
This challenge is barely possible in preproc (pure macro) -- if the input can be non-alphanumeric characters too, it would not be possible.
I don't see any simple way to shorten this code -- it might be possible to make the part to take the (n)th element shorter, but that would come at the cost of making the initial macro definitions significantly longer.
[Answer]
# [Python 2](https://docs.python.org/2/), ~~33~~ 32 bytes
-1B from Embodiment of Ignorance using bit ops. 
Exactly as specified. For a Python 3 answer change the `/` into `//`.
```
lambda a,b:chr(ord(a)+ord(b)>>1)
```
[Try it online!](https://tio.run/##K6gsycjPM/qfqGCrEPM/JzE3KSVRIVEnySo5o0gjvyhFI1FTG0QladrZGWr@LyjKzCvRSNRQclTSUXJW0tTkgoskAkWqUERSgCJZQJH/AA "Python 2 ‚Äì Try It Online")
[Answer]
# [Lua](https://www.lua.org/), ~~63~~ 60 bytes
```
s=io.read()print(s.char(math.floor((s:byte()+s:byte(2))/2)))
```
Takes the two letters with no delimeters, i.e. `AB`, `j$`, `|1`, etc....  
[Try it online!](https://tio.run/##yylN/P@/2DYzX68oNTFFQ7OgKDOvRKNYLzkjsUgjN7EkQy8tJz@/SAMolFRZkqpRrKkNY@kYaWrqA7Hm//@OzgA "Lua ‚Äì Try It Online")
*Saved 3 bytes thanks to PhillipRoman*
[Answer]
# [MarioLANG](https://github.com/tomsmeding/MarioLANG), 63 bytes
```
,
)
,
>[!(>[!
"=#="=#
  - ( >
) ( + -
!+< ) [
#=" !-<)
    #=".
```
[Try it online!](https://tio.run/##y00syszPScxL//9fh0uTS4fLLlpRA4i5lGyVbYGYS0FBV0FDwY5LE0hqK@hyKWrbKGgqRHMBZRUUdW00gQoUFIAcvf//nVIB "MarioLANG ‚Äì Try It Online")
Super golfable, I'm sure - not really able to think in MarioLANG yet. Calculates \$\lfloor\frac{x+y}{2}\rfloor\$.
[Answer]
# Zsh, ~~33~~ 31 characters
```
a=({$1..$2} 0)
echo ${a[$#a/2]}
```
This one does no character code conversion.
Sample run:
```
manatwork ~ % set -- A C    
manatwork ~ % a=({$1..$2} 0);echo ${a[$#a/2]}
B
```
[Try it online!](https://tio.run/##qyrO@P8/0VajWsVQT0/FqFbBQJMrNTkjX0GlOjFaRTlR3yi29v///47/nQE "Zsh ‚Äì Try It Online")
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/), 15 bytes
```
: f + 2/ emit ;
```
[Try it online!](https://tio.run/##S8svKsnQTU8DUf//WymkKWgrGOkrpOZmlihYA/kFCvllqUUQfkppgUJxQWJyKoSrp6SgoGunoATUk1ykYM2l7qig7qxQwKWeqKBeBaJTFNSzQLSTgnoqiI5SAEoVcP0HAA "Forth (gforth) ‚Äì Try It Online")
### Code Explanation
```
: f      \ start a new word definition
  +      \ add top two stack arguments
  2/     \ divide top stack value by 2
  emit   \ output char of resulting ascii value
;        \ end word definition
```
[Answer]
# [K4](http://kx.com/download), ~~9~~ 8 bytes
**Solution:**
```
10h$_avg
```
**Examples:**
```
q)k)10h$_avg"AC"
"B"
q)k)10h$_avg"az"
"m"
q)k)10h$_avg"dj"
"g"
```
**Explanation:**
~~Unfortunately the space is needed.~~ Turns out the space isn't necessary!
```
10h$_avg / the solution
     avg / calculate mean
    _    / floor
10h$     / cast to char
```
**Bonus:**
* `10h$-256+avg` for a 12 byte Q version (more/less hacky than `10h$(_)avg` for 10)
[Answer]
# [Hexagony](https://github.com/m-ender/hexagony), ~~14~~ 13 bytes
```
|*;:2@+/',{,|
```
[Try it online!](https://tio.run/##y0itSEzPz6v8/79Gy9rKyEFbX12nWqfm///EFAA "Hexagony ‚Äì Try It Online")
[![Image](https://i.stack.imgur.com/bYRZN.png)](https://i.stack.imgur.com/bYRZN.png)
Linear control flow: `,{,'+{*2':;@`
I decide to plug it in [the Hexagony brute forcer program](https://codegolf.stackexchange.com/a/165095/69850), and it can't find a 12-byte program. At least for that specific linear code.
Other possible linear control flows:
```
,{,'+'2=':;@
,{,'+'2{=:;@
,},"+{*2':;@
,},"+'2=':;@
,},"+'2{=:;@
,{,'+{+2':;@
```
(none of them results in a 12-byte solution (there are only some non-halting 12-byte solutions); nevertheless, the brute force program has room for improvement.)
[Answer]
# [Perl 5](https://www.perl.org/), ~~31~~ 30 bytes
```
$x+=ord for@ARGV;print chr$x>>1
```
[Try it online!](https://tio.run/##K0gtyjH9/1@lQts2vyhFIS2/yMExyD3MuqAoM69EITmjSKXCzs7w////if9TAQ "Perl 5 ‚Äì Try It Online")
Shortened to 30 bytes thanks to comment by [Dadsdy](https://codegolf.stackexchange.com/users/118038/dadsdy)
[Answer]
# [Red](http://www.red-lang.org), 18 bytes
```
func[a][average a]
```
[Try it online!](https://tio.run/##K0pN@R@UmhIdy5Vm9T@tNC85OjE2OrEstSgxPVUhMfZ/QVFmXolCmkK0spKjkoKykrNSLBeSWCJIrApVLAUklqUU@x8A "Red ‚Äì Try It Online")
Takes the input as a list of two letters.
If this is not acceptable:
# [Red](http://www.red-lang.org), 20 bytes
```
func[a b][a + b / 2]
```
[Try it online!](https://tio.run/##K0pN@R@UmhIdy5Vm9T@tNC85OlEhKRZIaCskKegrGMX@LyjKzCtRSFNQVnJUAhLOSlwIkUSQSBWySApIJEvpPwA "Red ‚Äì Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), 3 bytes
```
Ymc
```
[Try it online!](https://tio.run/##y00syfn/PzI3@f9/dUcXdQA "MATL ‚Äì Try It Online")
### Explanation
```
Ym   % Implicit input: string of two letters. Implicitly convert to ASCII, and take mean
c    % Implicitly round down, and convert to char
     % Implicit display
```
[Answer]
# [Runic Enchantments](https://github.com/Draco18s/RunicEnchantments/tree/Console), 7 bytes
```
ii+2,k@
```
[Try it online!](https://tio.run/##KyrNy0z@/z8zU9tIJ9vh/39HhSgA "Runic Enchantments ‚Äì Try It Online")
Input is space sepatrated. Use invalid inputs at your own peril.
]