[Question]
  [
Write a function or program which takes as input a set of distinct, non-negative integers \$\{x\_1, \ldots, x\_n\}\$ and outputs the smallest gap between any two values in the set, i.e. \$\min\_{i\neq j}|x\_i-x\_j|\$.
### Scoring
**This is not code golf.** Your score is the smallest gap of the set of code points of characters in your code (**highest score wins**). In other words: convert your code to integer code points (using ASCII or whatever code page is standard for your language); remove duplicates; use that as input to your program; the output is your score.
For instance, if your code is `min(alldifferences(input))`, to get your score convert `m->109`, `i->105`, `n->110`, `(->40`, ... and your score will be 1, since the codepoints for `m` and `n` are only 1 apart.
You may assume that the input contains at least 2 distinct values; behaviour is undefined otherwise. Your code must include at least two distinct characters.
If your encoding is ASCII, you can use [this online R code](https://tio.run/##FcqxEYAwCADAVbhUZAMbB7B3gwQ0hXASKJwe9eu3TIYVOKT5UMFZ4RqCfTDjVHMMGXcQhvOy6yb@jV8ylkfDoGknOJQmnGRUar4 "R – Try It Online") to verify your score.
### Test cases
```
Input         | Output
0 1 2 3 4     | 1
2 4 8 16 32   | 2
1             | undefined
3 14 159 2653 | 11
4 6 8 9 12 14 | 1
3 14 2        | 1
```
[Default rules](https://codegolf.meta.stackexchange.com/questions/2447/default-for-code-golf-input-output-methods) for input/output apply. In particular, since the input is a set, you may assume any structure for the input.
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), score: ~~22~~ ~~49~~ 69 (~~5~~ 4 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage))
```
ê¥êн
```
Uses the [05AB1E encoding](https://github.com/Adriandmen/05AB1E/wiki/Codepage), where the bytes have the codepoints [`[234,165,234,14]`](https://tio.run/##ARkA5v9vc2FiaWX//8W@xIZJU2v//8OqwqXDqtC9) (`ê¥` are 69 apart).
+27 score by porting [*@Arnauld*'s approach](https://codegolf.stackexchange.com/a/196794/52210) of sorting.  
+20 score (and even -1 byte at the same time) thanks to *@Grimmy*.
[Try it online](https://tio.run/##yy9OTMpM/f//8KpDSw@vurD3//9oIzNTYx1jHUMTHUNTy1gA) or [verify all test cases](https://tio.run/##NYy9DcIwFIRXiVJfwfuxsasMYrkAiYKKAgkpCzAAO9BkBxqyADOwiDkjpXg63d2773I9HM@ndpuncfjeH8M4zW1d3s91@bwaWik7CBQGrygKR4JEmNIJzyAOCRkag/UPCraQ3hG5yBBl1vugpKka0h6JXd4gnajGXQz4q9f6Aw).
**Explanation:**
```
ê     # Sort and uniquify the (implicit) input-list (in ascending order)
 ¥    # Get the deltas of this sorted list
  ê   # Sort and uniquify this again
   н  # Pop this list and push its first item
      # (which is output implicitly as result)
```
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), Score = 12
```
⊇ᶠl₂ˢ-ˢȧˢ⌋
```
[Try it online!](https://tio.run/##ATUAyv9icmFjaHlsb2cy///iiofhtqBs4oKCy6Ity6LIp8ui4oyL//9bMywxNCwxNTksMjY1M13/Wg "Brachylog – Try It Online")
The minimum gap is 12, between `⊇` and `⌋`, and also between `ᶠ` and `ˢ` ([see the code page](https://github.com/JCumin/Brachylog/wiki/Code-page)).
### Explanation
```
⊇ᶠ             Find all subsets of the input
  l₂ˢ          Only keep those that have a length of 2
     -ˢ        Compute the difference of each subset
       ȧˢ      Compute the absolute value of each difference 
         ⌋     Output is the smallest one
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 13 bytes, score 3
```
Ｉ⌊Ｅθ⌊ΦＥθ↔⁻ιλλ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/z@gKDOvRMM5sbhEwzczLzO3NFfDN7FAo1BHAcZ1y8wpSS2CiTomFefnlJakglSXFmtk6ijkaGpqQkggsP7/PzraoMLZUkfBoMIQTDqbgkg3QxBpaQYiHV1ApCtY1tU5Nva/blkOAA "Charcoal – Try It Online") Link is to verbose version of code and takes the code's own code points as input. Explanation:
```
   θ            Input array
  Ｅ             Map over elements
       θ        Input array
      Ｅ         Map over elements
          ι     Outer element
           λ    Inner element
        ↔⁻      Take the difference
     Φ      λ   Filter out zero values
 ⌊  ⌊           Take the minimum of the minima
Ｉ               Cast to string for implicit print
```
Charcoal's loop variables are implicit but fortunately `Map` consumes two variables and even more fortunately there is no variable `j` so there is actually a minimum difference of 3.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes, score = 24
This is most probably sub-optimal. Uses [Jelly code page](https://github.com/DennisMitchell/jellylanguage/wiki/Code-page).
```
ṢIṢ1ị
```
[Try it online!](https://tio.run/##y0rNyan8///hzkWeQGz4cHf3////ow0qnMx1FAwqTCxBpLEhiHSxiAUA "Jelly – Try It Online") (with the code points of the source code)
### Commented
```
ṢIṢ1ị  - a monadic link taking a list, e.g. [183, 73, 49, 216]
Ṣ      - sort in ascending order -> [49, 73, 183, 216]
 I     - get increments -> [24, 110, 33]
  Ṣ    - sort in ascending order -> [24, 33, 110]
   1ị  - extract the first element -> 24
```
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 3 bytes, score = 36
```
ȯọ⌋
```
[Try it online!](https://tio.run/##S0/MTPz//8T6h7t7H/V0/0991Dbxf7SxgqGJglEsAA "Gaia – Try It Online")
Uses the [Gaia codepage](https://github.com/splcurran/Gaia/blob/master/codepage.md). `ȯọ` are [36 apart](https://tio.run/##S0/MTPz//8T6h7t7H/V0wxmPGuaqPGraWuR0aNmjton/AQ).
[Answer]
# [MathGolf](https://github.com/maxbergmark/mathgolf), score = 35
```
ê│╓
```
[Try it online!](https://tio.run/##y00syUjPz0n7///wqkdTmh5Nnfz/v6GxpYKhuaWCkaEJAA "MathGolf – Try It Online")
Uses [MathGolf's codepage](https://github.com/maxbergmark/mathgolf/blob/master/code_page.py) along with [this simple Python script](https://tio.run/##PZLXclJRGIXveYojtsRoLLFGY@@9VzRG0rAAxlhiG0Q8HkYuKPvfnBNjQgkQiiUxZSQ4mdn/jJeHd1gvgjiT8W5dfbOaf2R40OftaDTcvt6@bn/PQJ/WpTk5CbMKcxFWDlYeVhZWCoEMkiaSn5C0YAVhBWCVYJVh1iCrSIagEwI1Na8KkBXoU9Bj0BPQ49CjMCagC8gZyJq2wuVcuWr1mrUtreva1m9o37hp85aOrdu279i5q3O3U3M52jTnnq69@/YfOHjo8JGjx46fOHnq9Jmz585fuHjp8pWr167fuHnL5bp9p/tuzz13b1//wKDn/oOHj7w@/@OhJ8NPnz1/MfLy1es3bxEJ8sdlHte4yBme5BTnuMAlLvMUf@dvXOEQf@Aw51nnWZ7nGV7kX7zEksdURmVVDsHCnzin@Sv/5CpPc0yVVFUtIRJVFfVb1VRaldUiZAwyDpmACEJMgtKgDEiCCJQFxUBJ0BfQGOgzRBRCQMxCVCDGIAIQNdD4slfQBGgUJEBFUB6UAkVBFVABNAVq0nMgC2SC4qAEqAwqQZgQEUgDMgTZFFHIgD3NE3aiHrCz9fdqrh6y87ZpF@1ZGON13Z6DUUQ4raYRziE8iUgKkTQvIGyoHzAstQBjFO@WVHO0FI87HY5@35Dm1jzeZp@lf0Ep4ex0aP4hj3e45f9/2vs93t4Wd2tro/EX).
```
ê    Take user input as array of integers
 │   Take differences
  ╓  Find minimum
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-g`](https://codegolf.meta.stackexchange.com/a/14339/), 6 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1), score: 43
```
n¹än¹n
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LWc&code=brnkbrlu&input=WzExMCwxODUsMjI4XQ) (includes codepoints test case)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), score 53
```
’ÞIṂ
```
**[Try it online!](https://tio.run/##y0rNyan8//9Rw8zD8zwf7mz6//9/tLGOgqGJjoJRLAA "Jelly – Try It Online")**
The code page is [here](https://github.com/DennisMitchell/jelly/wiki/Code-page). The code points are `253 20 73 179` which has minimal difference of `73-20=53` as may be seen in this [self-evaluation](https://tio.run/##y0rNyan8///wDK/MRxvXPWrc8ahh5sOdLWUO////BzIPz/N8uLMJAA "Jelly – Try It Online").
### How?
```
      ’ÞIṂ - Link: list of numbers, L     e.g. [253, 20, 73, 179]
 20:   Þ   - sort L by:
253:  ’    -   decrement                       [20, 73, 179, 253]
 73:    I  - incremental differences           [53, 106, 74]
179:     Ṃ - minimum                           53
```
[Answer]
# [Runic Enchantments](https://github.com/Draco18s/RunicEnchantments/tree/Console), Score 1 (79 bytes)
```
D?)0]li[0y̤<<<<<<<<
Ro"/{~D-{:ii"6Xkq";$~\"akq"/~{R{0[il]0)?/:}S-:}}:{)?"E͍$;
```
[Try it online!](https://tio.run/##LcYxCoMwAEDRvaf4BBcHMQVbShRc9AJ2EdRB2iUoFQsdJCQ38BYeR8@Uduib3vvz0g/vizyU3agbuexb9neqJhEbV0RGaS2u9TCLNHCt6H@JnamMbPTYyTCPlb1HylplwlyUxxqk3j/JCZE0jGg6FvaNjLOkYkIQY3AURCguCTUDMykBbUtPcsNScqx8AQ "Runic Enchantments – Try It Online")
(Note that due to the way input is coerced to the most appropriate type and we want `decimal value 49` not `decimal value 1` for such bytes; this applies to the newline, `0`, `6` (etc), as well as the injection of all the spaces).
There's a few reasons I can't score higher. In decreasing order of troublesomeness.
1. `@` and `?` are adjacent (`?` is required for conditionals, `@` is one of two terminators)
2. `:` and `;` are adjacent (`:` is required to duplicate the top of the stack for non-destructive comparisons, `;` is the other terminator)
3. `<` and `;` are adjacent
4. `>` and `?` are adjacent (using other entry points possible, but we're already score-limited, `v` is best option as `^` and `]` are adjacent)
5. `D` and `E` are adjacent (replacing `D` with `/` or `\` or not using `E`val possible)
6. `l` and `k` are adjacent (`l` is required to read all input, `k` is required to inject a newline and entry point into the evaluated code; `E`val not strictly needed)
7. `}` and `~` are adjacent (pop-discarding an arbitrary value without corrupting the stack is difficult otherwise, `[]` does work, but limits score to 2, assuming we could overcome the other points, `0*+` also works, but `+` and `*` are adjacent)
8. `o` and `q` limit score to 2
9. `[` and `]` limit score to 2 (but not strictly necessary, just simplifies the input reading process, but `lril1-` is still score limited to 3 on its own plus `r` and `q` are adjacent as well as `0` and `1`)
10. `l` and `o` limit score to 3
11. pre-processing the code and injecting troublesome bytes with reflection necessitates a minimum of 2 of `1234567890`, all of which are going to cause low score limits.
[Answer]
# [MATL](https://github.com/lmendo/MATL), Score 16
```
SdS9z)
```
[Try it online!](https://tio.run/##y00syfn/Pzgl2LJK8/9/9eAUIK0OAA "MATL – Try It Online")
For anything up to `SdS)` I could get a score of 17, but generating a `1` for indexing (because `X<` is too close to `S`) bumped the score down to 16.
Let's see if any ASCII-based language beats this...
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 12 bytes, score = 35
```
ạ€`«/Ƈ€«/€«/
```
[Try it online!](https://tio.run/##y0rNyan8///hroWPmtYkHFqtf6wdyADSEPL/4RlemYcnADmH23GrAgA "Jelly – Try It Online")
A monadic link taking a list of (optionally distinct) integers as its argument and returning the smallest gap. Generates an outer table of absolute differences between the inputs, filters out zero differences, finds the smallest in each row and then the smallest of those values. [TIO link](https://tio.run/##y0rNyan8///hroWPmtYkHFqtf6wdyADSEPL/4RlemYcnADmH23GrAgA "Jelly – Try It Online") has a footer to translate the code into numeric codepoints within Jelly codepage (technically each is +1, but there is no effect on differences between pairs).
[Pairwise differences shown here](https://tio.run/##y0rNyan8///hroWPmtYkHFqtf6wdyADSEPL/4RlemYcnADmH27msHzXMUdC1U3jUMNcayA08Oin5MEh1JG79AA)
[Answer]
# [R](https://www.r-project.org/), 47 bytes, score = 2
```
`-`=`mi\x6E`;`~`=diff;`?`=`s\x63\x61\x6E`;-~?""
```
[Try it online!](https://tio.run/##K/r/P0E3wTYhNzOmwsw1wTqhLsE2JTMtzTrBHihaDBQ0BmJDiKRunb2S0n8TBTMFQwMFQ1MFQ3MFQ4v/AA "R – Try It Online")
---
The input is assumed to be unique and sorted ascending.
## [Verify the score here](https://tio.run/##K/r/P03BViGtNC@5JDM/T6NYUyE3M08jJTMtTaM4v6hEozQvs7A0VaO0JM0iJN8zrwSoAgT@p2koJegm2CbkZsbEVJi5Jlgn1CXYgrRZJ9gDhYtBosYgwhAqr1tnH6MUo6Sk@R8A "R – Try It Online")
[Answer]
# **C++, score : 1, bytes : 132**
```
#include <cmath>
int f(int* a,int c){int m=abs(a[0]-a[1]),i,j,d;for(i=-1;++i<c;)for(j=i;++j<c;)m=(d=abs(a[i]-a[j]))<m?d:m;return m;}
```
~~The very need of the `abs` function kills my score, and any other C++ answer's.~~  
It's actually `return`.
[Try it online!](https://tio.run/##fU/BToQwFLzzFZP1sNSFZFH3sgWMdxM/ADnUUtgSW0gpMWaz344tsGo8eOnrTOfNTHnfxw3n043U/H2sBFLZDdYIpvJgHKRuoJkSQ8@4wGArGgQ/Sq6YPeWT1BZ16M5bsMgDTs5@qIy9DSEr9mXMiqQkkYzaqKJ1Z0KZxQnd7WTKKfG4zaSDrYcqC6t1UfrFtiQkVY/VUVEj7Gg0FL3MmYpJHRKcA2AJNyYC70ZtXUuAS408vxLwz8igxYdXFzNden7u4@xktqeu0Cx31cjVwO25JotlN1qkKTav@lnoxp5wxMYT3yG/FE/GsE8voP9ErPIlw9@22P7xeRlt78CaVIf@m7MFocElmA5IcId7PODwBQ "C++ (gcc) – Try It Online")
]