[Question]
  [
## Introduction
Suppose you have a ruler with numbers from **0** to **r-1**.
You place an ant between any two of the numbers, and it starts to crawl erratically on the ruler.
The ruler is so narrow that the ant cannot walk from one position to another without walking on all the numbers in between.
As the ant walks on a number for the first time, you record it, and this gives you a permutation of the **r** numbers.
We say that a permutation is *antsy* if it can be generated by an ant in this way.
Alternatively, a permutation **p** is antsy if every entry **p[i]** except the first is within distance 1 from some previous entry.
## Examples
The length-6 permutation
```
4, 3, 5, 2, 1, 0
```
is antsy, because **3** is within distance 1 of **4**, **5** is within distance 1 of **4**, **2** is within distance 1 from **3**, **1** is within distance 1 from **2**, and **0** is within distance 1 from **1**.
The permutation
```
3, 2, 5, 4, 1, 0
```
is not antsy, because **5** is not within distance 1 of either **3** or **2**; the ant would have to pass through **4** to get to **5**.
## The task
Given a permutation of the numbers from **0** to **r-1** for some **1 ≤ r ≤ 100** in any reasonable format, output a truthy value if the permutation is antsy, and a falsy value if not.
## Test cases
```
[0] -> True
[0, 1] -> True
[1, 0] -> True
[0, 1, 2] -> True
[0, 2, 1] -> False
[2, 1, 3, 0] -> True
[3, 1, 0, 2] -> False
[1, 2, 0, 3] -> True
[2, 3, 1, 4, 0] -> True
[2, 3, 0, 4, 1] -> False
[0, 5, 1, 3, 2, 4] -> False
[6, 5, 4, 7, 3, 8, 9, 2, 1, 0] -> True
[4, 3, 5, 6, 7, 2, 9, 1, 0, 8] -> False
[5, 2, 7, 9, 6, 8, 0, 4, 1, 3] -> False
[20, 13, 7, 0, 14, 16, 10, 24, 21, 1, 8, 23, 17, 18, 11, 2, 6, 22, 4, 5, 9, 12, 3, 15, 19] -> False
[34, 36, 99, 94, 77, 93, 31, 90, 21, 88, 30, 66, 92, 83, 42, 5, 86, 11, 15, 78, 40, 48, 22, 29, 95, 64, 97, 43, 14, 33, 69, 49, 50, 35, 74, 46, 26, 51, 75, 87, 23, 85, 41, 98, 82, 79, 59, 56, 37, 96, 45, 17, 32, 91, 62, 20, 4, 9, 2, 18, 27, 60, 63, 25, 61, 76, 1, 55, 16, 8, 6, 38, 54, 47, 73, 67, 53, 57, 7, 72, 84, 39, 52, 58, 0, 89, 12, 68, 70, 24, 80, 3, 44, 13, 28, 10, 71, 65, 81, 19] -> False
[47, 48, 46, 45, 44, 49, 43, 42, 41, 50, 40, 39, 38, 51, 37, 36, 52, 35, 34, 33, 32, 53, 54, 31, 30, 55, 56, 29, 28, 57, 58, 59, 60, 27, 26, 61, 25, 62, 63, 64, 65, 66, 67, 24, 23, 22, 21, 68, 69, 20, 19, 18, 17, 70, 71, 16, 15, 72, 73, 74, 75, 76, 14, 13, 12, 77, 11, 10, 9, 8, 78, 7, 79, 80, 6, 81, 5, 4, 3, 82, 2, 83, 84, 1, 85, 86, 87, 0, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99] -> True
```
Fun fact: for **r ≥ 1**, there are exactly **2r-1** antsy permutations of length **r**.
  
[Answer]
## Pyth, 7 bytes
```
/y+_QQS
```
[Try it online.](http://pyth.herokuapp.com/?code=%2Fy%2B_QQS&input=%5B0%5D%0A%5B0%2C%201%5D%0A%5B1%2C%200%5D%0A%5B0%2C%201%2C%202%0A%5B0%2C%202%2C%201%5D%0A%5B2%2C%201%2C%203%2C%200%5D%0A%5B3%2C%201%2C%200%2C%202%5D%0A%5B1%2C%202%2C%200%2C%203%5D%0A%5B2%2C%203%2C%201%2C%204%2C%200%5D%0A%5B2%2C%203%2C%200%2C%204%2C%201%5D%0A%5B0%2C%205%2C%201%2C%203%2C%202%2C%204%5D%0A%5B6%2C%205%2C%204%2C%207%2C%203%2C%208%2C%209%2C%202%2C%201%2C%200%5D%0A%5B4%2C%203%2C%205%2C%206%2C%207%2C%202%2C%209%2C%201%2C%200%2C%208%5D%0A%5B5%2C%202%2C%207%2C%209%2C%206%2C%208%2C%200%2C%204%2C%201%2C%203%5D&test_suite=1&test_suite_input=%5B0%5D%0A%5B0%2C%201%5D%0A%5B1%2C%200%5D%0A%5B0%2C%201%2C%202%5D%0A%5B0%2C%202%2C%201%5D%0A%5B2%2C%201%2C%203%2C%200%5D%0A%5B3%2C%201%2C%200%2C%202%5D%0A%5B1%2C%202%2C%200%2C%203%5D%0A%5B2%2C%203%2C%201%2C%204%2C%200%5D%0A%5B2%2C%203%2C%200%2C%204%2C%201%5D%0A%5B0%2C%205%2C%201%2C%203%2C%202%2C%204%5D&debug=1) (Only small test cases are included due to exponential run-time.) Outputs 2 for Truthy, 0 for Falsey.
```
/          Count the number of occurences of
      S     the sorted input (implicit Q)
 y          in the order-preserved power set
  +_QQ       of the input prepended by its reverse
```
In other words,
```
lambda l: subseq(sorted(l), concat(reverse(l), l))
```
where `subseq` outputs whether the elements of the first list appear in order in the second list, not necessarily adjacent. The `subseq` is done in Pyth by taking all subsets of the second list, which keep the order of the elements, and counting the number of occurrences of the first list. This takes exponential time.
Why does this work? For a permutation to be antsy, stepping from 0 to n-1 must consist of going only left, then going only right. This is because the elements greater than the first element must increase left to right, and those less than it must decrease left to right.
```
[2, 3, 1, 4, 0]
             ^
       ^     0
 ^     1      
 2  ^        
    3     ^
          4
```
If we mirror the list by putting a reversed copy to its left, this walk now only goes right.
```
[0, 4, 1, 3, 2, 2, 3, 1, 4, 0]
 ^            |             
 0     ^      |             
       1      | ^           
              | 2  ^        
              |    3     ^  
              |          4                                  
```
Conversely, any rightward of this mirror list corresponds to a left-then-right walk of the original list. This rightward just is a sorted subsequence of 0 to n-1. In an antsy list, this sorted subsequence is unique, except for an arbitrary choice between the two adjacent copies of the original first element.
[Answer]
## Haskell, 46 bytes
```
(%)=scanl1
f l=zipWith(+)(min%l)[0..]==max%l
```
Checks whether the vector difference of the running maxima and the running minima is [0,1,2,3...].
```
l =             [2, 3, 1, 4, 0]
scanl1 max l =  [2, 3, 3, 4, 0]
scanl1 min l =  [2, 2, 1, 1, 0]  
difference =    [0, 1, 2, 3, 4]
```
Zgarb saved 2 bytes with `(%)=scanl1`.
[Answer]
# JavaScript (ES6), 45
```
a=>a.every((v,i)=>a[v]=!i|a[v-1]|a[v+1],a=[])
```
I thought it's too simple to need as explanation, but there is a trick, and just in case, here is my first version, pre-golf
```
a => {
  k = []; // I'll put a 1 in this array at position of each value 
          // that I find scanning the input list
  return a.every((v,i) => { // execute for each element v at position i
    // the index i is needed to manage the first iteration
    // return 1/true if ok, 0/false if not valid
    // .every will stop and return false if any iteration return falsy
    k[v] = 1; // mark the current position
    if ( i == 0 )
    {  // the first element is always valid
       return true;
    }
    else
    {
       return k[v-1] == 1 // valid if near a lesser value
              || k[v+1] == 1; // or valid if near a greater value
    }
  })
}
```
Note: in the golfed code `a` is used instead of `k`, as I need no reference to the original array inside the `every` call. So I avoid to pollute the global namespace reusing the parameter
**Test**
```
antsy=
a=>a.every((v,i)=>a[v]=!i|a[v-1]|a[v+1],a=[])
var OkAll=true
;`[0] -> True
[0, 1] -> True
[1, 0] -> True
[0, 1, 2] -> True
[0, 2, 1] -> False
[2, 1, 3, 0] -> True
[3, 1, 0, 2] -> False
[1, 2, 0, 3] -> True
[2, 3, 1, 4, 0] -> True
[2, 3, 0, 4, 1] -> False
[0, 5, 1, 3, 2, 4] -> False
[6, 5, 4, 7, 3, 8, 9, 2, 1, 0] -> True
[4, 3, 5, 6, 7, 2, 9, 1, 0, 8] -> False
[5, 2, 7, 9, 6, 8, 0, 4, 1, 3] -> False
[20, 13, 7, 0, 14, 16, 10, 24, 21, 1, 8, 23, 17, 18, 11, 2, 6, 22, 4, 5, 9, 12, 3, 15, 19] -> False
[34, 36, 99, 94, 77, 93, 31, 90, 21, 88, 30, 66, 92, 83, 42, 5, 86, 11, 15, 78, 40, 48, 22, 29, 95, 64, 97, 43, 14, 33, 69, 49, 50, 35, 74, 46, 26, 51, 75, 87, 23, 85, 41, 98, 82, 79, 59, 56, 37, 96, 45, 17, 32, 91, 62, 20, 4, 9, 2, 18, 27, 60, 63, 25, 61, 76, 1, 55, 16, 8, 6, 38, 54, 47, 73, 67, 53, 57, 7, 72, 84, 39, 52, 58, 0, 89, 12, 68, 70, 24, 80, 3, 44, 13, 28, 10, 71, 65, 81, 19] -> False
[47, 48, 46, 45, 44, 49, 43, 42, 41, 50, 40, 39, 38, 51, 37, 36, 52, 35, 34, 33, 32, 53, 54, 31, 30, 55, 56, 29, 28, 57, 58, 59, 60, 27, 26, 61, 25, 62, 63, 64, 65, 66, 67, 24, 23, 22, 21, 68, 69, 20, 19, 18, 17, 70, 71, 16, 15, 72, 73, 74, 75, 76, 14, 13, 12, 77, 11, 10, 9, 8, 78, 7, 79, 80, 6, 81, 5, 4, 3, 82, 2, 83, 84, 1, 85, 86, 87, 0, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99] -> True`
.split`\n`.forEach(row => {
  var rowElements = row.match(/\w+/g), 
      expected = rowElements.pop()=='True',
      input = rowElements.map(x => +x),
      result = antsy(input),
      ok = result == expected;
  OkAll = OkAll && ok;
  console.log(ok?'OK':'KO', input+' -> '+result)
})
console.log(OkAll ? 'All passed' : 'Failed')
```
[Answer]
## Python 2, 49 bytes
```
f=lambda l:l==[]or max(l)-min(l)<len(l)*f(l[:-1])
```
Checks whether each prefix of the list contains all numbers between its min and max inclusive. It does so by checking if the difference of the max and min is less than its length.
---
**54 bytes:**
```
f=lambda l:1/len(l)or-~l.pop()in[min(l),max(l)+2]*f(l)
```
Checks if the last element is either one less than the min of the other elements, or one more than their max. Then, removes the last element and recurses. On a single-element list, outputs True.
This can also be checked via an amusing but longer list comprehension.
```
lambda l:all(l.pop()in[min(l)-1,max(l)+1]for _ in l[1:])
```
I'd like to use the inequality `min(l)-2<l.pop()<max(l)+2`, but the `pop` needs to happen first. Using a program to output via error code would likely be shorter.
[Answer]
## Mathematica, 42 bytes
```
!MatchQ[#,{a__,b_,___}/;Min@Abs[{a}-b]>1]&
```
Uses pattern matching to try and find a prefix `a` whose maximum difference from the next element `b` is greater than `1` (and negating the result of `MatchQ`).
[Answer]
# Perl, ~~39~~ ~~38~~ 35 bytes
Includes +1 for `-p`
Give sequence on STDIN:
```
antsy.pl <<< "2 1 3 0"
```
`antsy.pl`:
```
#!/usr/bin/perl -p
s%\d+%--$a[$&]x"@a"=~/1  /%eg;$_++
```
[Answer]
# [MATL](http://github.com/lmendo/MATL), 11 bytes
```
&-|R1=a4L)A
```
[Try it online!](http://matl.tryitonline.net/#code=Ji18UjE9YTRMKUE&input=WzQsIDMsIDUsIDIsIDEsIDBd) Or [verify all test cases](http://matl.tryitonline.net/#code=YAomLXxSMT1hNEwpQQpEVA&input=WzBdClswLCAxXQpbMSwgMF0KWzAsIDEsIDJdClswLCAyLCAxXQpbMiwgMSwgMywgMF0KWzMsIDEsIDAsIDJdClsxLCAyLCAwLCAzXQpbMiwgMywgMSwgNCwgMF0KWzIsIDMsIDAsIDQsIDFdClswLCA1LCAxLCAzLCAyLCA0XQpbNiwgNSwgNCwgNywgMywgOCwgOSwgMiwgMSwgMF0KWzQsIDMsIDUsIDYsIDcsIDIsIDksIDEsIDAsIDhdCls1LCAyLCA3LCA5LCA2LCA4LCAwLCA0LCAxLCAzXQpbMjAsIDEzLCA3LCAwLCAxNCwgMTYsIDEwLCAyNCwgMjEsIDEsIDgsIDIzLCAxNywgMTgsIDExLCAyLCA2LCAyMiwgNCwgNSwgOSwgMTIsIDMsIDE1LCAxOV0KWzM0LCAzNiwgOTksIDk0LCA3NywgOTMsIDMxLCA5MCwgMjEsIDg4LCAzMCwgNjYsIDkyLCA4MywgNDIsIDUsIDg2LCAxMSwgMTUsIDc4LCA0MCwgNDgsIDIyLCAyOSwgOTUsIDY0LCA5NywgNDMsIDE0LCAzMywgNjksIDQ5LCA1MCwgMzUsIDc0LCA0NiwgMjYsIDUxLCA3NSwgODcsIDIzLCA4NSwgNDEsIDk4LCA4MiwgNzksIDU5LCA1NiwgMzcsIDk2LCA0NSwgMTcsIDMyLCA5MSwgNjIsIDIwLCA0LCA5LCAyLCAxOCwgMjcsIDYwLCA2MywgMjUsIDYxLCA3NiwgMSwgNTUsIDE2LCA4LCA2LCAzOCwgNTQsIDQ3LCA3MywgNjcsIDUzLCA1NywgNywgNzIsIDg0LCAzOSwgNTIsIDU4LCAwLCA4OSwgMTIsIDY4LCA3MCwgMjQsIDgwLCAzLCA0NCwgMTMsIDI4LCAxMCwgNzEsIDY1LCA4MSwgMTldCls0NywgNDgsIDQ2LCA0NSwgNDQsIDQ5LCA0MywgNDIsIDQxLCA1MCwgNDAsIDM5LCAzOCwgNTEsIDM3LCAzNiwgNTIsIDM1LCAzNCwgMzMsIDMyLCA1MywgNTQsIDMxLCAzMCwgNTUsIDU2LCAyOSwgMjgsIDU3LCA1OCwgNTksIDYwLCAyNywgMjYsIDYxLCAyNSwgNjIsIDYzLCA2NCwgNjUsIDY2LCA2NywgMjQsIDIzLCAyMiwgMjEsIDY4LCA2OSwgMjAsIDE5LCAxOCwgMTcsIDcwLCA3MSwgMTYsIDE1LCA3MiwgNzMsIDc0LCA3NSwgNzYsIDE0LCAxMywgMTIsIDc3LCAxMSwgMTAsIDksIDgsIDc4LCA3LCA3OSwgODAsIDYsIDgxLCA1LCA0LCAzLCA4MiwgMiwgODMsIDg0LCAxLCA4NSwgODYsIDg3LCAwLCA4OCwgODksIDkwLCA5MSwgOTIsIDkzLCA5NCwgOTUsIDk2LCA5NywgOTgsIDk5XQ).
### Explanation
This computes a matrix of all pairwise absolute differences and keeps the upper triangular part. The result is true iff there is at least a 1 value in all columns except the first.
```
&-     % All pairwise differences
|      % Absolute value
R      % Upper triangular part
1=     % Does each entry equal 1?
a      % Logical "or" along each column
4L)    % Remove first value
A      % Logical "and" of all results
```
[Answer]
# R, ~~72~~ ~~64~~ 60 bytes
```
v=scan();for(i in seq(v))T=c(T,diff(sort(v[1:i])));all(T==1)
```
A permutation is antsy if and only if all its left subpermutations are continuous (i.e. have difference one when sorted).
~~If input is guaranteed to have length more than one, then we can replace `1:sum(1|v)` with `seq(v)`, which saves four bytes.~~
The `seq(v)` in the if condition behaves differently when the input is of length one --- it generates the sequence `1:v` instead of `seq_along(v)`. However, fortunately, the output turns out to be `TRUE` in this case, which is the desired behaviour. The same also happens for zero-length input.
In R, `T` is a preset variable equal to `TRUE` (but R allows you to redefine it). `TRUE` is also deemed to be equal to `1`.
Thanks to @Billywob for some helpful improvements to the original solution.
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), 7 bytes
```
Âìæ¹{¢O
```
[Try it online!](http://05ab1e.tryitonline.net/#code=w4LDrMOmwrl7wqJP&input=WzIsIDMsIDEsIDQsIDBd)
or as a [modified test suite](http://05ab1e.tryitonline.net/#code=fHZ5I8Kpw4LDrMOmwq57wqJPLA&input=MCAxCjEgMAowIDEgMgowIDIgMQoyIDEgMyAwCjMgMSAwIDIKMSAyIDAgMwoyIDMgMSA0IDAKMiAzIDAgNCAx).
**Explanation**
Uses the process described by [xnor in his brilliant Pyth answer](https://codegolf.stackexchange.com/a/97230/47066).  
Returns 2 for truthy instances and 0 for falsy.
```
Âì        # prepend a reversed copy of input to input
  æ       # take powerset
   ¹{     # push a sorted copy of input
     ¢    # count occurances of sorted input in powerset
      O   # sum occurances (which for some reason is needed, feels like a bug)
```
[Answer]
## Perl, 63 bytes
Note that [@Gabriel Banamy](https://codegolf.stackexchange.com/users/60884/gabriel-benamy) came up with a shorter (55 bytes) [answer](https://codegolf.stackexchange.com/a/97259/55508). But I think this solution is still interesting, so I'm posting it.
The bytes count includes 62 bytes of code and `-n` flag.
```
s/\d+/1x($&+1)/ge;/ 1(1*)\b(?{$.&=$`=~m%\b(11)?$1\b%})^/;say$.
```
To run it : 
```
perl -nE 's/\d+/1x($&+1)/ge;/ 1(1*)\b(?{$.&=$`=~m%\b(11)?$1\b%})^/;say$.' <<< "3 2 5 4 1 0"
```
**Short explanations** : converts each number `k` to the unary representation of `k+1` (that `+1` is needed so the `0`s don't get ignored). Then for each number `k+1` (expressed in unary as `1(1*)`), we look if either `k` (`$1` holds `k`) or `k+2` (which is then `11$1`) are present in the preceding string (referenced by `$-backtick`). If no, then we set `$.` to zero. At then end we print `$.` which will be `1` if we never set it to zero, or zero otherwise.
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak) ~~302 264~~ 256 Bytes
Thanks to [Wheat Wizard](https://codegolf.stackexchange.com/users/56656/wheat-wizard) for saving 46 bytes
```
([]){{}({}<>)<>([])}{}<>(({}))([]){{}({}<>)<>([])}{}<>(({}<>))<>(()){{}(({})<(({})<>[({})]<>(())){((<{}{}>))}{}{{}({}<><{}>)(<>)}{}<>({}<<>(({})<>[({})<>(())]){((<{}{}>))}{}{{}({}<><{}>)(<>)}{}<>>)<>>[({})](<()>)){{}{}(<(())>)}{}}([][()(())]){((<{}{}>))}{}
```
The top of the stack will be a 1 for truthy and a 0 for falsy. 
Truthy: [Try it Online!](http://brain-flak.tryitonline.net/#code=KFtdKXt7fSh7fTw-KTw-KFtdKX17fTw-KCh7fSkpKFtdKXt7fSh7fTw-KTw-KFtdKX17fTw-KCh7fTw-KSk8PigoKSl7e30oKHt9KTwoKHt9KTw-Wyh7fSldPD4oKCkpKXsoKDx7fXt9PikpfXt9e3t9KHt9PD48e30-KSg8Pil9e308Pih7fTw8Pigoe30pPD5bKHt9KTw-KCgpKV0peygoPHt9e30-KSl9e317e30oe308Pjx7fT4pKDw-KX17fTw-Pik8Pj5bKHt9KV0oPCgpPikpe3t9e30oPCgoKSk-KX17fX0oW11bKCkoKCkpXSl7KCg8e317fT4pKX17fQ&input=NDcgNDggNDYgNDUgNDQgNDkgNDMgNDIgNDEgNTAgNDAgMzkgMzggNTEgMzcgMzYgNTIgMzUgMzQgMzMgMzIgNTMgNTQgMzEgMzAgNTUgNTYgMjkgMjggNTcgNTggNTkgNjAgMjcgMjYgNjEgMjUgNjIgNjMgNjQgNjUgNjYgNjcgMjQgMjMgMjIgMjEgNjggNjkgMjAgMTkgMTggMTcgNzAgNzEgMTYgMTUgNzIgNzMgNzQgNzUgNzYgMTQgMTMgMTIgNzcgMTEgMTAgOSA4IDc4IDcgNzkgODAgNiA4MSA1IDQgMyA4MiAyIDgzIDg0IDEgODUgODYgODcgMCA4OCA4OSA5MCA5MSA5MiA5MyA5NCA5NSA5NiA5NyA5OCA5OQ)  
Falsy: [Try it Online!](http://brain-flak.tryitonline.net/#code=KFtdKXt7fSh7fTw-KTw-KFtdKX17fTw-KCh7fSkpKFtdKXt7fSh7fTw-KTw-KFtdKX17fTw-KCh7fTw-KSk8PigoKSl7e30oKHt9KTwoKHt9KTw-Wyh7fSldPD4oKCkpKXsoKDx7fXt9PikpfXt9e3t9KHt9PD48e30-KSg8Pil9e308Pih7fTw8Pigoe30pPD5bKHt9KTw-KCgpKV0peygoPHt9e30-KSl9e317e30oe308Pjx7fT4pKDw-KX17fTw-Pik8Pj5bKHt9KV0oPCgpPikpe3t9e30oPCgoKSk-KX17fX0oW11bKCkoKCkpXSl7KCg8e317fT4pKX17fQ&input=MzQgMzYgOTkgOTQgNzcgOTMgMzEgOTAgMjEgODggMzAgNjYgOTIgODMgNDIgNSA4NiAxMSAxNSA3OCA0MCA0OCAyMiAyOSA5NSA2NCA5NyA0MyAxNCAzMyA2OSA0OSA1MCAzNSA3NCA0NiAyNiA1MSA3NSA4NyAyMyA4NSA0MSA5OCA4MiA3OSA1OSA1NiAzNyA5NiA0NSAxNyAzMiA5MSA2MiAyMCA0IDkgMiAxOCAyNyA2MCA2MyAyNSA2MSA3NiAxIDU1IDE2IDggNiAzOCA1NCA0NyA3MyA2NyA1MyA1NyA3IDcyIDg0IDM5IDUyIDU4IDAgODkgMTIgNjggNzAgMjQgODAgMyA0NCAxMyAyOCAxMCA3MSA2NSA4MSAxOQ) 
The idea is to hold the minimum and maximum number that the ant has visited in the off stack. Then compare each number to both of those and update the appropriate one. If the next number is not 1 less than the min or 1 more than the max, break out of the loop and return false.
---
**Brief Explanation:**
```
([])                             # duplicate the bottom element by
{{}({}<>)<>([])}{}<>             # reversing everything onto the other stack 
(({}))([])                       # duplicating the top element
{{}({}<>)<>([])}{}<>             # and reversing everything back
(({}<>))<>                       # copy the top element to the other stack (push twice)
(()){{}                          # push a 1 so the loop starts, and repeat until the top
                                 # two elements are equal
(({})<                           # hold onto the top element to compare later
(({})<>[({})]<>(()))             # push a 0 if diff with the top of the other stack is +1
{{}({}<><{}>)(<>)}{}             # logical not (the previous line pushed a 1 as the second
                                 # element already)
{{}({}<><{}>)<>(<()>)}{}         # replace the top of the other stack with this element if
                                 # the logical not gave us 1
<>({}<<>                         # take the minimum off the other stack temporarily 
(({})<>[({})<>(())])             # push a 0 if diff with the top of the other stack is -1
{((<{}{}>))}{}                   # logical not (the previous line pushed a 1 as the second
                                 # element already)
{{}({}<><{}>)(<>)}{}             # replace the top of the other stack with this element if
                                 # the logical not gave us 1
<>>)<>                           # put the minimum on back on
>)                               # put the element you were comparing back on
[({})](<()>)){{}{}(<(())>)}{}    # push 1 or 0 for not equal to the element we held earlier
                                 # (push the second number back on)
}                                # repeat the loop if the top 2 weren't equal
([][()(())]){((<{}{}>))}{}       # logical not of the height of the stack
```
[Answer]
# [Jelly](http://github.com/DennisMitchell/jelly), ~~9~~ ~~8~~ 7 bytes
```
;@UŒPċṢ
```
[Try It Online!](http://jelly.tryitonline.net/#code=O0BVxZJQxIvhuaI&input=&args=WzIsIDAsIDEsIDNd)
A Jelly translation of xnor's answer.
Old solutions:
```
;\Ṣ€IỊȦ
;\Ṣ€IE€P
```
[Try it online!](http://jelly.tryitonline.net/#code=O1zhuaLigqxJReKCrFA&input=&args=WzIsIDEsIDMsIDBd)
Works very similarly to my Pyth answer below:
```
;\          All prefixes (Accumulate (\) over concatenation (;))
  Ṣ€        (Ṣ)ort each (€) prefix
    I       (I)ncrements of each prefix (differences between consecutive elements).  Implicit vectorization.
     E€     Check if all elements are (E)qual (they will be iff the permutation is antsy,
               and all elements will be 1) for each (€) prefix
       P    Is this true for all prefixes?
     ỊȦ     For the other answer, are (Ȧ)ll elements 1 or less (Ị)?
```
[Answer]
## CJam (21 20 bytes)
```
{:A,{_)A<$2*)@-#},!}
```
[Online test suite](http://cjam.tryitonline.net/#code=MTpUOzA6RjtxIixydWVhbHNlL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IDcyLCA4NCwgMzksIDUyLCA1OCwgMCwgODksIDEyLCA2OCwgNzAsIDI0LCA4MCwgMywgNDQsIDEzLCAyOCwgMTAsIDcxLCA2NSwgODEsIDE5XSAtPiBGYWxzZQpbNDcsIDQ4LCA0NiwgNDUsIDQ0LCA0OSwgNDMsIDQyLCA0MSwgNTAsIDQwLCAzOSwgMzgsIDUxLCAzNywgMzYsIDUyLCAzNSwgMzQsIDMzLCAzMiwgNTMsIDU0LCAzMSwgMzAsIDU1LCA1NiwgMjksIDI4LCA1NywgNTgsIDU5LCA2MCwgMjcsIDI2LCA2MSwgMjUsIDYyLCA2MywgNjQsIDY1LCA2NiwgNjcsIDI0LCAyMywgMjIsIDIxLCA2OCwgNjksIDIwLCAxOSwgMTgsIDE3LCA3MCwgNzEsIDE2LCAxNSwgNzIsIDczLCA3NCwgNzUsIDc2LCAxNCwgMTMsIDEyLCA3NywgMTEsIDEwLCA5LCA4LCA3OCwgNywgNzksIDgwLCA2LCA4MSwgNSwgNCwgMywgODIsIDIsIDgzLCA4NCwgMSwgODUsIDg2LCA4NywgMCwgODgsIDg5LCA5MCwgOTEsIDkyLCA5MywgOTQsIDk1LCA5NiwgOTcsIDk4LCA5OV0gLT4gVHJ1ZQ)
### Dissection
This uses the observation by xnor in his Haskell answer that the difference between the maximum and minimum of the first `n` elements should be `n-1`.
```
{         e# Define a block. Stack: array
  :A,     e#   Store the array in A and get its length
  {       e#   Filter (with implicit , so over the array [0 ... len-1])
    _)A<  e#     Get the first i+1 elements of A (so we iterate over prefixes)
    $2*)  e#     Extract the last element without leaving an empty array if the
          e#     prefix is of length 1 by first duplicating the contents of the
          e#     prefix and then popping the last element
    @-#   e#     Search the prefix for max(prefix)-i, which should be min(prefix)
          e#     giving index 0
  },      e#   So the filter finds values of i for which the prefix of length i+1
          e#   doesn't have max(prefix) - min(prefix) = i
  !       e#   Negate, giving truthy iff there was no i matching the filter
}
```
---
### Alternative approach (also 20 bytes)
```
{_{a+_)f-:z1&,*}*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1LCAxNiwgOCwgNiwgMzgsIDU0LCA0NywgNzMsIDY3LCA1MywgNTcsIDcsIDcyLCA4NCwgMzksIDUyLCA1OCwgMCwgODksIDEyLCA2OCwgNzAsIDI0LCA4MCwgMywgNDQsIDEzLCAyOCwgMTAsIDcxLCA2NSwgODEsIDE5XSAtPiBGYWxzZQpbNDcsIDQ4LCA0NiwgNDUsIDQ0LCA0OSwgNDMsIDQyLCA0MSwgNTAsIDQwLCAzOSwgMzgsIDUxLCAzNywgMzYsIDUyLCAzNSwgMzQsIDMzLCAzMiwgNTMsIDU0LCAzMSwgMzAsIDU1LCA1NiwgMjksIDI4LCA1NywgNTgsIDU5LCA2MCwgMjcsIDI2LCA2MSwgMjUsIDYyLCA2MywgNjQsIDY1LCA2NiwgNjcsIDI0LCAyMywgMjIsIDIxLCA2OCwgNjksIDIwLCAxOSwgMTgsIDE3LCA3MCwgNzEsIDE2LCAxNSwgNzIsIDczLCA3NCwgNzUsIDc2LCAxNCwgMTMsIDEyLCA3NywgMTEsIDEwLCA5LCA4LCA3OCwgNywgNzksIDgwLCA2LCA4MSwgNSwgNCwgMywgODIsIDIsIDgzLCA4NCwgMSwgODUsIDg2LCA4NywgMCwgODgsIDg5LCA5MCwgOTEsIDkyLCA5MywgOTQsIDk1LCA5NiwgOTcsIDk4LCA5OV0gLT4gVHJ1ZQ)
This checks directly that each element after the first is at distance 1 from a previous element. Since the input is a permutation and hence doesn't repeat values, this is a sufficient test. Thanks to Martin for a 1-byte saving.
### Dissection
```
{_{a+_)f-:z1&,*}*^!}
{         e# Declare a block. Stack: array
  _       e#   Work with a copy of the array
  {       e#   Fold...
    a+    e#     Add to the accumulator.
    _)f-  e#     Dup, pop last, map subtraction to get distance of this element from
          e#     each of the previous ones
    :z1&, e#     Check whether the absolute values include 1
    *     e#     If not, replace the accumulator with an empty array
  }*
  ^!      e#   Test whether the accumulator is equal to the original array
          e#   Note that this can't just be = because if the array is of length 1
          e#   the accumulator will be 0 rather than [0]
}
```
[Answer]
# Java, ~~100~~ ~~98~~ ~~79~~ 75 bytes
```
a->{int n=a[0],m=n-1;for(int i:a)n-=i==m+1?m-m++:i==n-1?1:n+1;return n==0;}
```
Formerly:
```
a->{int m,n;m=n=a[0];--m;for(int i:a)if(i==m+1)m=i;else if(i==n-1)n=i;else return 0>1;return 1>0;}
```
Saved 3 bytes by replacing `true` and `false` with `1>0` and `0>1`.
Saved 23 bytes thanks to excellent suggestions from Peter Taylor!
Ungolfed:
```
a -> {
    int n = a[0], m = n - 1;
    for (int i : a)
        n -= i == m + 1? m - m++ : i == n - 1? 1 : n + 1;
    return n == 0;
}
```
Keep track of the highest and lowest values seen so far as `m` and `n`; only accept a new value if it is `m + 1` or `n - 1` i.e. the next higher or lower value; initialize the high value, `m`, to one less than the first element so that it will "match" the first time around the loop. Note: this is a linear-time, online algorithm. It requires only three words of memory, for the current, highest-so-far, and lowest-so-far values, unlike a lot of the other solutions.
If the next value misses both the high and low ends of the range, the lowest-so-far value is set to `-1` and then the low end can never proceed and reach zero. We then detect an antsy sequence by checking whether the low value, `n`, reached zero.
(Unfortunately this is less efficient because we always have to look at the entire sequence rather than bailing out after the first *wrong* number, but it's hard to argue with a 23-byte savings (!) when other solutions are using O(n^2) and exponential time approaches.)
Usage:
```
import java.util.function.Predicate;
public class Antsy {
    public static void main(String[] args) {
        int[] values = { 6, 5, 4, 7, 3, 8, 9, 2, 1, 0 };
        System.out.println(test(values,
            a -> {
                int n = a[0], m = n - 1;
                for (int i : a)
                    n -= i == m + 1? m - m++ : i == n - 1? 1 : n + 1;
                return n == 0;
            }
        ));
    }
    public static boolean test(int[] values, Predicate<int[]> pred) {
        return pred.test(values);
    }
}
```
Note: this can also be written without taking advantage of Java 8 lambdas:
# Java 7, 89 bytes
```
boolean c(int[]a){int n=a[0],m=n-1;for(int i:a)n-=i==m+1?m-m++:i==n-1?1:n+1;return n==0;}
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
Ụ<ƝṢƑ
```
[Try it online!](https://tio.run/##PZO7bRxBEER9RnEBrLHznwGUyeFMOsQlQFeObAUgh6CpBASZBC6PYyLLet19NBaz21PTU11V@/J8vb4ex/3/@4/bn/u/t9vv4@PX58@/x3E@75ft6bxvp8SattP393bK8ZpjN1u1BKbY1x6wZDB9lUD6dg2wF3YrpGjbHu20Wal1qwkxrDy30/LLo0m1siDdINn2ncNkv1ltWLnb@bjwwYqxiiF4Y0ewxAh6z8mQOpXhLlDSe/LBhMvZmjW/NSZkhmVqQE6opc3FCNAQouj82r37VL@i9w5ODab2a7aWs/tVNByCVZhPvzTTkqnVdqltLU6@aO3aq3oaynNW9QpZtFS/Qe/hI03EhY76ToTiHI@wBbpaa/PRC@IK27nfVQwvICVAZw68gxgXdVOvNRd1mmRFS4ORDgzYam1YOMyEgQYMAgl0cMdm6Nv1OcKcuZvetbqDebpvA4qMmB4@cBXC1RiGEwhUQ2sEQCwE5l6jmFwA/IMHQpYQGCGMcnUv8Y8hEQ1jYMI4cEdMdEEfDEAX0ye7VhgIW/xHCktdCZOTD4yhltMV@RsuApNaWpvrhpyYjcGmfSiDcGTPwrSba9MjNdxxlOyumP9sxdMQeZz@v8zI5PR/heRiC0kmFqSXdJN0okl0iCbRWuty@QI "Jelly – Try It Online")
In [Is it a tower permutation?](https://codegolf.stackexchange.com/questions/243173/is-it-a-tower-permutation), xnor comments
> 
> This is closely related to Antsy Permutations -- a tower permutation is one whose inverse permutation, read backwards as a list, is antsy.
> 
> 
> 
Combining [pxeger's answer](https://codegolf.stackexchange.com/a/243174/3852) to that question with `Ụ` (Grade, which inverts permutations) yields a short Jelly answer to this question.
Instead of reversing the list before inverting the permutation, which would cost another byte, I just check for "anti-towers" by changing `>` to `<`.
[Answer]
# Pyth ([fork](https://github.com/Steven-Hewitt/pyth)), 13 bytes
```
!sstMM.+MSM._
```
No Try It Online link for this fork of Pyth. The fork includes the deltas function `.+`, which is not part of the standard Pyth library.
Explanation:
```
           ._  For each of the prefixes:
         SM    Sort it
      .+M      Get deltas (differences between consecutive elements), which for antsy
                 permutations would all be 1s
   tMM         Decrement each of the elements (all 0s for antsy permutations)
 ss            Sum all the results from the above together, 0 for antsy and >0 for non-antsy
!              Logical negation.
```
[Answer]
# J, 14 bytes
```
/:~-:>./\-<./\
```
This is based on @xnor's [method.](https://codegolf.stackexchange.com/a/97240/6710)
## Explanation
```
/:~-:>./\-<./\  Input: array P
        \       For each prefix of P
     >./          Reduce using the maximum
          <./\  Get the minimum of each prefix of p
         -      Subtract between each
   -:           Test if it matches
/:~               P sorted
```
[Answer]
# Perl, ~~66~~ 54 +1 = 55 bytes
+1 byte for `-n`.
```
s/\d+/$.&=!@a||1~~[map{abs$_-$&}@a];push@a,$&/eg;say$.
```
Explanation:
```
s/\d+/$.&=!@a||1~~[map{abs$_-$&}@a];push@a,$&/eg;say$.
#input is automatically read into $_.
#regex automatically is performed on $_.
s/   /                                       /eg;
    #Substitution regex.
    #/g means to keep searching after the first match
    #/e evaluates the replacement as code instead of regex.
  \d+  #Match of at least 1 digit.  Match automatically gets stored in $&
      $.&=  #$. is initially 1.  This basically says $. = $. & (code)
           !@a  #Since @a is uninitialized, this returns !0, or 1
                #We don't want to check anything for the first match
              || #logical or
                1~~
                   #~~ is the smartmatch operator.  When RHS is scalar and LHS is array reference,
                   #it returns 1 iff RHS is equal to at least one value in de-referenced LHS.
                   [map{abs$_-$&}@a];
                       #Return an array reference to the array calculated by |$_ - $&|
                       #where $_ iterates over @a.  Remember $& is the stored digit capture.
                                     push@a,$& #pushes $& at the end of @a.
                                                 say$. #output the result
```
Prints 0 if false, 1 if true.
-11 bytes thanks to @Dada
[Answer]
## Brainfuck, 60 bytes
```
,+[>+>+<<-]
,+
[
  [>->->+<<<-]
  >-
  [
    +>+
    [
      <<<
    ]
  ]
  >[>]
  <[<+<+>>-]
  <<<,+
]
>.
```
The permutation is given as bytes with no separators and no terminating newline. Since `\x00` occurs in the input, this is designed for implementations with `EOF = -1`. The output is `\x00` for false and `\x01` for true.
If a permutation of `\x01` up to `chr(r)` is allowed, then we can replace all instances of `,+` with `,` for a score of 57 with an `EOF = 0` implementation. 
[Try it online](http://brainfuck.tryitonline.net/#code=LFs-Kz4rPDwtXQosClsKICBbPi0-LT4rPDw8LV0KICA-LQogIFsKICAgICs-KwogICAgWwogICAgICA8PDwKICAgIF0KICBdCiAgPls-XQogIDxbPCs8Kz4-LV0KICA8PDwsCl0KPi4&input=NjU0NzM4OTIxMA) (57-byte version): Input can be given as a permutation of any contiguous range of bytes excluding `\x00`, and the output will be `\x00` for false and the minimum of the range for true.
We keep track of the min and max seen so far, and for each character after the first, check whether it is min-1 or max+1 or neither. In the case of neither, move the pointer outside the normal working space so that the local cells become zero.
The memory layout of the normal working space at the beginning of the main loop is
`c a b 0 0`
where `c` is the current character, `a` is min, and `b` is max. (For the 60-byte version, everything is handled with an offset of 1 because of `,+`.)
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 8 bytes
```
⇧2lvƒ<ÞṠ
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJQIiwiQGY6MXwiLCLih6cybHbGkjzDnuG5oCIsIjtcbsabQGY7IiwiW1swXSwgWzAsIDFdLCBbMSwgMF0sIFswLCAxLCAyXSwgWzAsIDIsIDFdLCBbMiwgMSwgMywgMF0sIFszLCAxLCAwLCAyXSwgWzEsIDIsIDAsIDNdLCBbMiwgMywgMSwgNCwgMF0sIFsyLCAzLCAwLCA0LCAxXSwgWzAsIDUsIDEsIDMsIDIsIDRdLCBbNiwgNSwgNCwgNywgMywgOCwgOSwgMiwgMSwgMF0sIFs0LCAzLCA1LCA2LCA3LCAyLCA5LCAxLCAwLCA4XSwgWzUsIDIsIDcsIDksIDYsIDgsIDAsIDQsIDEsIDNdLCBbMjAsIDEzLCA3LCAwLCAxNCwgMTYsIDEwLCAyNCwgMjEsIDEsIDgsIDIzLCAxNywgMTgsIDExLCAyLCA2LCAyMiwgNCwgNSwgOSwgMTIsIDMsIDE1LCAxOV0sIFszNCwgMzYsI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jelly answer, takes my [Vyxal answer](https://codegolf.stackexchange.com/a/246382/92689) to [Is it a tower permutation?](https://codegolf.stackexchange.com/q/243173/92689), adds a grade up at the beginning, and changes `>` to `<`.
## How?
```
⇧2lvƒ<ÞṠ
⇧        # Grade up (i.e. sort indices by corresponding values)
 2l      # Get overlapping pairs
   vƒ<   # For each pair, check if the first item is less than the second
      ÞṠ # Is it sorted in ascending order?
```
[Answer]
# [Brachylog](http://github.com/JCumin/Brachylog), 22 bytes
```
:@[fb:{oLtT,Lh:T:efL}a
```
[Try it online!](http://brachylog.tryitonline.net/#code=OkBbZmI6e29MdFQsTGg6VDplZkx9YQ&input=WzQ6Mzo1OjI6MTowXQ)
### Explanation
I haven't found a concise way of checking whether a list contains consecutive integers or not. The shortest I found is to generate a range between the first and last element of that list and check that that range is the original list.
```
:@[fb                       Take all but the first prefixes of the Input
     :{             }a      This predicate is true for all those prefixes
       oLtT,                Sort the prefix, call it L, its last element is T
            Lh:T            The list [First element of L, T]
                :efL        Find all integers between the First element of L and T. It must
                              result in L
```
[Answer]
## Batch, 133 bytes
```
@set/au=%1,l=%1-1,a=0
@for %%n in (%*)do @call:l %%n
@exit/b%a%
:l
@if %1==%u% (set/au+=1)else if %1==%l% (set/al-=1)else set a=1
```
Takes input as command-line arguments. Exits with error level 0 for success, 1 for failure.
[Answer]
## Java, 170 bytes
```
boolean f(int[]a){int l=a.length,i=0,b=0,e=l-1;int[]x=new int[l];for(;i<l;i++)x[i]=i;for(i--;i>0;i--)if(a[i]==x[b])b++;else if(a[i]==x[e])e--;else return 0>1;return 1>0;}
```
Array `x` has values from 0 to maximum number in order (Python would be much better here...). The loop goes backwards trying to match the lowest (`x[b]`) or the highest (`x[e]`) number not yet encountered; if it does, that number could be reached in that step.
[Test code here](https://ideone.com/bV6LcM).
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 7 bytes
```
ηε{¥P}P
```
[Try it online!](https://tio.run/##NZM7bhZBEIRzTrFyvEg775kEJ4jYueUAJAIiBw4tH4cjIHIO4Cv91Nc1Dlbz6J7u6qra55fvP379vKXx7ev93fH5y3F3f3v/@/7n9d/vh7eH23l7vJ4@PV7nkbSk8/g4nUf2LjuU4644ocThck6KHB2K0xyszvT5inNywfZRSbGqqx5Xio@4neex3NUVatwqo0dGjrC7T4VbXI247fF6N9t4mKVEAjsCykpA1z6nSNSjDGolJe2TJ1JezlGrueeeDfwLEkCmpKXYAj4glFD0fF0uPlWuaN/J0/upeM1RcXZ3ot5QWgX3dM9MSUZW2aWytRh70doVq/oajPNW9xWs8Kh6g9rDE02IBY7qTmjiHZ9yC3C11ubJC8wqt9PfHG4dAKWEzhzIBjAa9SCvNXM6g7GipYFIDwZotTb0G6HBgAMGAQQ8WK@56e06jq3NvILuWi1gnpZtAJER05aBTvBW9yw8gJ@6qWZ@uIJf2gbC5PmRDxjwWDa/8BCIq6VEPmaEM3QBCNMAHS6hBXrgH1qCnmyq0A@wyA8T4bmyNU6eFz3DpWu7b5gDBg2vNtMGm2iNvkH9JgbesF546QrRph01LDhEdhPm/6zYDNuO0z/L3Jac/lMwLqpgZFyBeTE3RseZOAdn4qy1nv4D "05AB1E – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 57 bytes
```
function(x,y=x[-1],`!`=cummin){y[]=y+1-!x&y-1+!-x;any(y)}
```
[Try it online!](https://tio.run/##dZTbattAFEXf8xUyhWITGTQXzYwI7mO/oG8hNMa0EGgUSGywCP1296xzprVTrAejsedc197y62l82X/fjvu3aXP6eRh3@6eXcXlsp83xfu0e2sfF42Z3eH5@Glfv0/3DZrp168Xx87R2t4v18W47Tstp9ftkBc75q8W/svLl5sZOu2W3WjWfmvWX5tvr4cf517ZxVy9c28xntI2fu/MXBb9uf72dL70mhrm6Qa@7i9If053WlvtwNd1raQmKcw0sotOImRHlsv87pYTH61FJo6RK1sDSNoPtPdc5apzkJM3xmmDLlusteo3KGpi0RZ37Yv3/6KJL0BxOxEqig6ecvdNcqeOhJEFOzs6YSpz3Wr63ySpLUAzXuwVWkrxBwgdIMKrkBKk4dNavSIcg50SclCxyH702Kcma0yJLWGS7YmN4SsJKyg5SNgZbJ8gzyV2UT48NyJXfI@MjidTL1M62ZEEjxpG6BZjk8ZHYwLjyjL3BCEgisYn@RrpKylASkNgDUzAYjZLy7HvDXBRikEfPRJKQmVaePcJnlSXDgEUYAg6maqnEk3zNVa7SqQIxmqa@mJKZEVnRzStDc1DGuh41QBYrfZCAD@RMokM7Q4KiTAbaUJGDRpeIpi6KsjYYkYrZWJBtwAspiCEJpJSYN3pIyvw4AjjqzFBld4YAidXLQ/VoNizsro7ujSSAkR/JVY3KCpS4Ue3VqY7FTJbNA7BNxtDe4mD@qA4t9paV6tJi7xNeRii8jVHwM37H@5gVM2FWzDYMH/4ETn8A "R – Try It Online")
Completely different and somewhat shorter approach to [JDL's previous R answer](https://codegolf.stackexchange.com/a/97231/95126).
Returns `FALSE` for antsy sequences, `TRUE` for not-antsy sequences.  
Add two bytes to reverse the output to truthy for antsy sequences: [59 bytes](https://tio.run/##dZTbattAFEXf8xUyhWITCTQXzYwo7mO/oG8hNCa0EGgUSGywKP1296xzprVTrAejsedc197y62l62X/bTfu3eXv6cZge908v0/rYztvjXefu24fVw/bx8Pz8NG1@zXf32/nWdavjx7lzt6vu@Ml1u2lez5vfJytxrrBZ/SssX25u7PS47jeb5kPTfW6@vh6@n39tG3f1wrXNckbb@KU7f1Hwy@7n2/nSa2JYqhv0ur8o/T7daW25D1fTvZaWoLjUwCJ6jVgYUS6Hv1NKeLwelTRKqmQNLG0z2t5LnaPGSU7SHK8Jtmy53mLQqKyBSVvUuS/W/48uugTN4USsJDp4ytk7zZU6HkoS5OTsjKnEea/lB5ussgTFeL1bYCXJGyV8hASjSk6QimNv/Yp0CHJOxEnJIvfRa5OSrDktsoRFtis2hqckrKTsKGVjsHWCPJPcRfkM2IBc@T0yPpJIvUztbEsWNGIcqVuASR4fiQ2MK884GIyAJBKb6G@kq6QMJQGJPTAFg9EoKc9hMMxFIQZ5DEwkCZlp5TkgfFZZMgxYhCHgYKqWSjzJ11zlKr0qEKNp6ospmRmRFd2yMjQHZazrUQNksdIHCfhAziQ6tDMkKMpkoA0VOWh0iWjqoihrgxGpmI0F2Qa8kIIYkkBKiXmjh6TMjyOAo84MVXZnCJBYvTxWj2bDwu7q6MFIAhj5kVzVqKxAiRvVXr3qWMxk2TwA22QM7S0O5o/q0GJvWakuLfY@4WWEwtsYBT/jd7yPWTETZsVs4/juT@D0Bw), but save 4 bytes by taking input using `scan`: [55 bytes](https://tio.run/##BcFLCoAwDAXAq7xuRJGA8S8lJxHR4sqFEfxAc/o6cye93jXo@5ikKM8eNC@8SZyJF7@5TfbvPA/1Ni9iJZOLmRGXjqJnCmq5FalHhxYDGoyYUINRpR8)
[Answer]
# Mathematica, 47 bytes
A little longer than Martin Ender's solution (surprise surprise!). But it's one of my more unreadable efforts, so that's good :D
```
#=={}||{Max@#,Min@#}~MemberQ~Last@#&&#0@Most@#&
```
Explanation:
```
#=={}                         empty lists are antsy (function halts with True)
 ||                            or
{Max@#,Min@#}~MemberQ~Last@#  lists where the last number is largest or smallest
                              are possibly antsy (else function halts with False)
 &&                            and
#0@Most@#&                    recursively call this function after dropping the
                              last element of the list
```
[Answer]
# Java 7, ~~170~~ 169 bytes
```
import java.util.*;Object c(int[]a){List l=new ArrayList();l.add(a[0]);for(int i:a){if(l.indexOf(i)<0&l.indexOf(i-1)<0&l.indexOf(i+1)<0)return 0>1;l.add(i);}return 1>0;}
```
**Ungolfed & test code:**
[Try it here.](https://ideone.com/OZZi4O)
```
import java.util.*;
class M{
  static Object c(int[] a){
    List l = new ArrayList();
    l.add(a[0]);
    for(int i : a){
      if(l.indexOf(i) < 0 & l.indexOf(i-1) < 0 & l.indexOf(i+1) < 0){
        return 0>1; //false
      }
      l.add(i);
    }
    return 1>0; //true
  }
  public static void main(String[] a){
    System.out.println(c(new int[]{ 0 }));
    System.out.println(c(new int[]{ 0, 1 }));
    System.out.println(c(new int[]{ 1, 0 }));
    System.out.println(c(new int[]{ 0, 1, 2 }));
    System.out.println(c(new int[]{ 0, 2, 1 }));
    System.out.println(c(new int[]{ 2, 1, 3, 0 }));
    System.out.println(c(new int[]{ 3, 1, 0, 2 }));
    System.out.println(c(new int[]{ 1, 2, 0, 3 }));
    System.out.println(c(new int[]{ 2, 3, 1, 4, 0 }));
    System.out.println(c(new int[]{ 0, 5, 1, 3, 2, 4 }));
    System.out.println(c(new int[]{ 6, 5, 4, 7, 3, 8, 9, 2, 1, 0 }));
    System.out.println(c(new int[]{ 4, 3, 5, 6, 7, 2, 9, 1, 0, 8 }));
    System.out.println(c(new int[]{ 5, 2, 7, 9, 6, 8, 0, 4, 1, 3 }));
    System.out.println(c(new int[]{ 20, 13, 7, 0, 14, 16, 10, 24, 21, 1, 8, 23, 17, 18, 11, 2, 6, 22, 4, 5, 9, 12, 3, 15, 19 }));
    System.out.println(c(new int[]{ 34, 36, 99, 94, 77, 93, 31, 90, 21, 88, 30, 66, 92, 83, 42, 5, 86, 11, 15, 78, 40, 48, 22, 29, 95, 64, 97, 43, 14, 33, 69, 49, 50, 35, 74, 46, 26, 51, 75, 87, 23, 85, 41, 98, 82, 79, 59, 56, 37, 96, 45, 17, 32, 91, 62, 20, 4, 9, 2, 18, 27, 60, 63, 25, 61, 76, 1, 55, 16, 8, 6, 38, 54, 47, 73, 67, 53, 57, 7, 72, 84, 39, 52, 58, 0, 89, 12, 68, 70, 24, 80, 3, 44, 13, 28, 10, 71, 65, 81, 19 }));
    System.out.println(c(new int[]{ 47, 48, 46, 45, 44, 49, 43, 42, 41, 50, 40, 39, 38, 51, 37, 36, 52, 35, 34, 33, 32, 53, 54, 31, 30, 55, 56, 29, 28, 57, 58, 59, 60, 27, 26, 61, 25, 62, 63, 64, 65, 66, 67, 24, 23, 22, 21, 68, 69, 20, 19, 18, 17, 70, 71, 16, 15, 72, 73, 74, 75, 76, 14, 13, 12, 77, 11, 10, 9, 8, 78, 7, 79, 80, 6, 81, 5, 4, 3, 82, 2, 83, 84, 1, 85, 86, 87, 0, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }));
  }
}
```
**Output:**
```
true
true
true
true
false
true
false
true
true
false
true
false
false
false
false
true
```
[Answer]
# [JavaScript], 54 bytes
```
e=>e.every((f,m)=>!m||e.some((e,o)=>o<m&&(e-f)**2==1))
```
[Try it online!](https://tio.run/##jVTRbtswDHzPV2h5KOzCjSPJtuRh7o8MezBcue2WxJntdC3WfnvGI1UgRRNgD65dkTySd6f8bJ/aqRsf9/PNbrgLx745huY2rMJTGF@SpM@2aXP7Zfv6GlbTsA1JErKBToZv26urJNz06fW1aRqdpsc8f5jn/fQ1zzsCuh82/Wqa2@5XeO4e2t19WHXDNv99CNP8OOymvHZGu7zdzdPLzT6M28PccmDR0Z9ZtdMUxlk1KnlqN4eQqfC8D90c7lLV3Kq/C6Ue@xhTTdOchBFTCijDJqw2w32y3BPaMuXzMcyHcUefb/TMD@PwRy3DOA7jcvG2WEjXpE@@r3@kmZrHQ0hPDzOlz53rTF3Mz5S5EDIRrW8304eY4TJ7AdRydB1xPxVrBqawPVdsGJdyigvokrDmhPPTUax8H5Cyi7NJFScRhuM8n6laFr7QtuA0Kqm4xHC@rOnPNig5yXFexQ3izHHxjwWkNdWwAQxEsVyKL5RQvQaf9G00QxCcAU@UpOlbC6mUZwx3KdGX4XRkFJTwETVHN7RfnOtvsSoh1TR4DYKwAyFY6lGvZQJPPS19V8ijBp7iheG2vpJxqCHDOUotsLqX4QxgwSNB1wRdWFnS0ruiWEFPCXdQjqPzAktBLR3x0MPJ@h4SYizC9mAbtXgo32Jsehel0GQhGeVWmIGlYLioOoajpAo7wTYYkJJdxWyXpYjgmWJLrxKTUYHD1PQurcCVjoVz4ARLYRjwIvJ7eAY60b8uCurXrE9RiOrGi9YurlthXf2/2mEkEF3ExYEKQouoD8gCuRAEs/EqWsiC5pgVxNvIDkQBcaWVleEB6A5CQDLExMRYGzuCfHAILiEaOGQuTdzGivDYCt4BdexqG82hhRwYge9BHf3thDCn4214N5cRCWAUGIP1ikyCaHiXzbjmewjavQhUC/OVsBvh5JLDSdHTXi6sj772cifhfkiJ2wBL4QbghuC2wNpkO/GWE2vWJ9rhd4WkO/4D "JavaScript (Node.js) – Try It Online")
]