text:
(KevinC's) Triangular DeciDigits Sequence
Input:
A positive integer n which is 1 <= n <= 25000.
Output:

In this sequence we start with the decimal number 1/n.
Then we take the sum of digits up until the n'th digit after the comma (1-indexed); followed by the sum of digits up until the (n-1)'th, then (n-2)'th, etc. Continue until n is 1.
The output is the sum of all these combined.

For example:
n = 7
1/7 = 0.1428571428...
7th digit-sum = 1+4+2+8+5+7+1 = 28
6th digit-sum = 1+4+2+8+5+7 = 27
5th digit-sum = 1+4+2+8+5 = 20
4th digit-sum = 1+4+2+8 = 15
3rd digit-sum = 1+4+2 = 7
2nd digit-sum = 1+4 = 5
1st digit     = 1
Output = 28+27+20+15+7+5+1 = 103

Challenge rules:

If the decimal of 1/n doesn't have n digits after the comma, the missing ones will be counted as 0 (i.e. 1/2 = 0.50 => (5+0) + (5) = 10).
You take the digits without rounding (i.e. the digits of 1/6 are 166666 and not 166667)

General rules:

Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.

First 1 - 50 in the sequence:
0, 10, 18, 23, 10, 96, 103, 52, 45, 10, 270, 253, 402, 403, 630, 183, 660, 765, 819, 95, 975, 1034, 1221, 1500, 96, 1479, 1197, 1658, 1953, 1305, 1674, 321, 816, 2490, 2704, 4235, 2022, 3242, 2295, 268, 2944, 3787, 3874, 4097, 1980, 4380, 4968, 3424, 4854, 98

Last 24990 - 25000 in the sequence:
1405098782, 1417995426, 1364392256, 1404501980, 1408005544, 1377273489, 1395684561, 1405849947, 1406216741, 1142066735, 99984

Did somebody mention my name?

Jelly, 9 bytes
R⁵*:%⁵+\S

Rather slow, but short. Try it online! or verify the first 50 test cases.
How it works
R⁵*:%⁵+\S  Main link. Argument: n

R          Range; yield [1, ..., n].
 ⁵*        10 power; yield [10**1, ..., 10**n].
   :       Divide each power by n.
    %⁵     Take each quotient modulo 10.
           This yields all desired decimal digits.
      +\   Take the cumulative sum of the digits.
        S  Take the sum.

Mathematica, 42 bytes
#&@@RealDigits[1/#,10,#,-1].(#-Range@#+1)&

or
#&@@RealDigits[1/#,10,#,-1].Range[#,1,-1]&

or
Tr@Accumulate@#&@@RealDigits[1/#,10,#,-1]&

Explanation
Take the example from the challenge spec. We want to compute:
  1+4+2+8+5+7+1
+ 1+4+2+8+5+7
+ 1+4+2+8+5
+ 1+4+2+8
+ 1+4+2
+ 1+4
+ 1

Rearranging, this is:
  1*7 + 4*6 + 2*5 + 8*4 + 5*3 + 7*2 + 1*1
= (1, 4, 2, 8, 5, 7, 1) . (7, 6, 5, 4, 3, 2, 1)

where . is the scalar product of two vectors.
That's pretty much all the solution does.
#&@@RealDigits[1/#,10,#,-1]

This gets us the first N decimal digits of 1/N (the #&@@ extracts the first element of the RealDigits result because that also returns the offset of the first digit which we don't care about).
Then we get the list from N down to 1 either using (#-Range@#+1) or Range[#,1,-1], both of which are shorter than Reverse@Range@#, and take the scalar product.
The alternative solution instead uses Accumulate to compute a list of all prefix sums and then adds up those prefix sums with Tr.
Since this is really fast even for large inputs, here is a scatter plot of the sequence up to N = 100,000 (doing all of them and plotting them took a while though):

Click for larger version.
The blue line is the naive upper bound of 9 N (N+1) / 2 (if all the decimal digits were 9) and the orange line is exactly half of that. Unsurprisingly this is right inside the main branch of the plot since, statistically, we'd expect the average digit to be 4.5.
The thin line of plot points which you can see below the main branch are fractions which end in ...3333..., as they all lie very close to 3 N (N+1) / 2.

Very nice answer, and I love the graph-plot! It's almost unfortunate this isn't the shortest and I can't accept it as the answer. :) If I don't forget I might make a small bounty in two days for answering so much more than the simple assignment I gave.

@KevinCruijssen Thanks! :)

05AB1E, 12 11 bytes
Di<ë°¹÷.pSO

Try it online!
or a Test suite for the first 50 numbers.
Explanation
              # implicit input n
Di<           # if n == 1 then 0
   ë          # else
    °¹÷       # 10^n // n
       .p     # get prefixes
         SO   # sum digits

A more efficient version for trying big numbers on TIO
The difference to the shorter version is that here we sum the product of the digits and the reversal of their 1-based index instead of summing digits in prefixes.
Di<ë°¹÷SDgLR*O

Try it online!

9 bytes by removing the D and changing .p to η

Java 8, 181 169 166 153 142 bytes
import java.math.*;n->{int m=n+2,r=0,i;for(;m>2;)for(i=m--;i-->2;r+=(BigDecimal.ONE.divide(new BigDecimal(n),n,3)+"").charAt(i)-48);return r;}

Explanation:
Try it here.
import java.math.*;   // Required import for BigDecimal

n->{                  // Method with integer as both parameter and return-type
  int m=n+2,          //  Copy of the input-integer plus 2
      r=0,            //  Result-integer, starting at 0
      i;              //  Index-integer
  for(;m>2;)          //  Loop (1) as long as `m` is larger than 2
    for(i=m--;        //   Set index `i` to `m`, and decrease `m` by one afterwards
        i-->2;        //   Inner loop (2) from `m` down to 2 (inclusive)
      r+=             //    Add to the result-sum:
         (BigDecimal.ONE.divide(
                      //     1 divided by,
           new BigDecimal(n),
                      //     the input
           n,3)       //     With the minimal required precision
          +"")        //     Convert this to a String
          .charAt(i)  //     Take the character of this String at index `i`
          -48         //     And convert it to a number
     );               //   End of inner loop (2)
                      //  End of loop (1) (implicit / single-line body)
  return r;           //  Return result
}                     // End of method

PHP, 66 65 bytes
for($b=$c=$argv[$a=1];$c;)$o+=$c--*(($a=10*($a%$b))/$b^0);echo$o;

Adapted from this answer (also by me): Division of not so little numbers and Jörg Hülsermann's suggested edit to it.  Use like:
php -r "for($b=$c=$argv[$a=1];$c;)$o+=$c--*(($a=10*($a%$b))/$b^0);echo$o;" 7

edit: corrected a bug for +1 bytes and folded the assignment of $a into $argv[1] for -2 bytes for a net 1 byte less.

Scala, 84 bytes
val b=BigDecimal
def?(& :Int)=1 to&map(x=>(""+b(1)/b(&))slice(2,x+2)map(_-48)sum)sum

Ungolfed:
def f(n: Int)={
  val digits = ""+BigDecimal(1)/BigDecimal(n)
  (1 to n).map( x=>
    digits.slice(2, x+2).map(d => d - 48).sum
  ).sum

Explanation:
val b=BigDecimal   //define an alias for BigDecimal
def?(& :Int)=      //define a method called ? with an integer & as a parameter
  1 to &           //create a range from 1 to &
  map(x=>          //for each number x...
    (""+b(1)/b(&))   //calculate the fraction
    slice(2,x+2)     //and take the slice starting from the third element,
                     //(dropping the "1.") and containing x elements
    map(_-48)        //for each char, subtract 48 to get the integer value
    sum              //and sum them
  )sum             //and take the sum

I could save some bytes by exploiting the way the compiler tokenizes: By calling the argument &, you can write 1 to&map instead of 1 to n map. The same rule applies to def?.

PHP, 76 bytes
(Edit -1 byte - Thanks user59178 - your solution is even better)
for($c=substr(bcdiv(1,$a=$argv[1],$a),2);$i<$a;)$s+=($a-$i)*$c[$i++];echo$s;

you could save a byte (a semicolon) by moving the $c=blah into the first part of the for(;;)

Jelly, 11 bytes
’aµR⁵*:µDFS

TryItOnline
First 50
Too slow for the large test cases.
How?
’aµR⁵*:µDFS - Main link: n
’           - decrement
 a          - and (to handle special case where n=1, to return 0 rather than 10)
  µ         - monadic chain separation
   R        - range: [1,2,...n]
    ⁵       - literal 10
     *      - exponentiation: [10,100,...,10^n]
      :     - integer division: [10//n,100//n,...,10^n//n]
       µ    - monadic chain separation
        D   - cast to a decimal list [[digits of 10//n],[digits of 100//n],...]
         F  - flatten into one list
          S - sum

I don't think I've ever before seen a Jelly answer where the explanation is a straight line ;-)

I did nearly put the R⁵* as the left to right equivalent but then saw the nice straight line :)

MATL, 19 bytes
li/GEY$4LQ)!UYsG:)s

Try it Online!
Explanation
l       % Push a 1 literal to the stack
i/      % Grab the input (n) and compute 1/n
GE      % Grab the input again and multiply by 2 (2n)
Y$      % Compute the first 2n digits of 1/n after the decimal
4LQ)    % Get only the digits past the decimal point
!U      % Convert to numbers
Ys      % Compute the cumulative sum
G:)     % Get the first n terms
s       % Sum the result and implicitly display

Groovy, 87 Bytes
This was less painful than I anticipated, and is based on my answer here:
{n->(1..n).collect{x->(1.0g.divide(n, n, 1)+"")[2..x+1].getChars().sum()-48*(x)}.sum()}

Explanation
1.0g - Use BigDecimal notation for the one.
.divide(n, n, 1)+"" - Divide by n with n precision (BigDecimal function only) and convert to str.
(...)[2..x+1].getChars() - Get the substring of the current iteration as an array of char.
.sum()-48*(x) - Sum the ASCII values of the characters and reduce by 48 for each element. This turns the value from an ASCII digit to an Integer essentially saving bytes over *.toInteger().
(1..n).collect{...}.sum() - Iterate over each of the digits in the division, doing this function, get them all in a single array and sum.
Saved 2 Bytes and Sacrificed Efficiency...
This is a more efficient version that does not recalculate the BigDecimal each iteration.
{n->i=1.0g.divide(n, n, 1)+"";(1..n).collect{x->i[2..x+1].getChars().sum()-48*(x)}.sum()}

J, 27 bytes
1#.[:+/\-{.10#.inv%<.@*10^]

Usage
The input is an extended integer.
   f =: 1#.[:+/\-{.10#.inv%<.@*10^]
   (,.f"0) (>: i. 50x) , 24990x + i. 11
    1          0
    2         10
    3         18
    4         23
    5         10
    6         96
    7        103
    8         52
    9         45
   10         10
   11        270
   12        253
   13        402
   14        403
   15        630
   16        183
   17        660
   18        765
   19        819
   20         95
   21        975
   22       1034
   23       1221
   24       1500
   25         96
   26       1479
   27       1197
   28       1658
   29       1953
   30       1305
   31       1674
   32        321
   33        816
   34       2490
   35       2704
   36       4235
   37       2022
   38       3242
   39       2295
   40        268
   41       2944
   42       3787
   43       3874
   44       4097
   45       1980
   46       4380
   47       4968
   48       3424
   49       4854
   50         98
24990 1405098782
24991 1417995426
24992 1364392256
24993 1404501980
24994 1408005544
24995 1377273489
24996 1395684561
24997 1405849947
24998 1406216741
24999 1142066735
25000      99984

The performance is good and only requires about 3 seconds to compute for the large test cases.
   timex 'f 7x'
0.000119
   timex 'f 24999x'
3.8823
   timex 'f 25000x'
3.14903

Explanation
1#.[:+/\-{.10#.inv%<.@*10^]  Input: n
                          ]  Get n
                       10^   Raise 10 to the nth power
                  %          Get the reciprocal of n
                      *      Multiply (1/n) with (10^n)
                   <.@       Floor it
           10#.inv           Convert it to a list of base 10 digits
        -                    Negate n
         {.                  Take the last n values from the list of digits
                             (This is to handle the case for n = 1)
   [:  \                     For each prefix of the list of digits
     +/                        Reduce it using addition to get the sum
1#.                          Convert those sums as base 1 digits and return
                             (This is equivalent to taking the sum)

Jelly, 10 bytes
⁵*:⁸D+\_ỊS

Not the shortest approach, but fairly efficient. Try it online! or verify all test cases.
How it works
⁵*:⁸D+\_ỊS  Main link. Argument: n (integer)

⁵*          Yield 10**n.
  :⁸        Divide 10**n by n (integer division).
    D       Convert the quotient to base 10.
     +\     Take the cumulative sum of the digits.
        Ị   Insignificant; yield (abs(n) <= 1).
       _    Subtract the resulting Boolean from each decimal digit.
            This takes care of edge case n = 1, which would return 2 otherwise.
         S  Take the sum.

Python 2, 90 bytes
lambda o:sum([sum([int(i)for i in s])for s in map(lambda x:str(1.0/o)[2:x],range(3,3+o))])

Not pretty, but done through float dividing then converting to a string and then iterative string index selection to get the triangle of numbers, then perform list comprehension and convert each char to an int and finally summing them all.

JavaScript (ES6), 47 bytes
f=(b,a=1%b,c=b+1)=>c&&(a/b|0)*c+f(b,a%b*10,c-1)

How it works
This answer demonstrates a technique for calculating c decimal digits of a/b:
f=(a,b,c,d=".")=>~c?(a/b|0)+d+f(a%b*10,b,c-1,""):d

This will make an excellent starting point for this challenge. First we can change it slightly so that it calculates b decimal digits of 1/b, by reordering the parameters and setting defaults:
f=(b,a=1,c=b,d=".")=>~c?(a/b|0)+d+f(b,a%b*10,c-1,""):d

Next we can change this so that it calculates the sum of of the first b decimal digits, instead of concatenating them (this does away with the d parameter):
f=(b,a=1,c=b)=>~c?(a/b|0)+f(b,a%b*10,c-1):0

We're almost to a solution; now we just need to make it multiply each digit by c+1:
f=(b,a=1,c=b)=>~c?(a/b|0)*-~c+f(b,a%b*10,c-1):0

Hmm, this seems a little long. What if we incremented c by 1 to begin with?
f=(b,a=1,c=b+1)=>c?(a/b|0)*c+f(b,a%b*10,c-1):0

That saves one byte. And here's a way to save one more:
f=(b,a=1,c=b+1)=>c&&(a/b|0)*c+f(b,a%b*10,c-1)

And now we have our answer. f(7) is 103, f(11) is 270, f(1) is... 2? Oh, we forgot to account for the case where a/b is 1 on the first iteration (i.e. b is 1). Let's do something about this:
f=(b,a=1%b,c=b+1)=>c&&(a/b|0)*c+f(b,a%b*10,c-1)

1 mod b is always 1, unless b is 1, in which case it will be 0. Our program is now correct for all inputs, at 47 bytes.

Python 2, 49 bytes
lambda n:sum(10**-~k/n%10*(n-k)for k in range(n))

Test it on Ideone.

Husk, 11 bytes
ṁΣḣdi*^¹10\

Try it online!
Explanation
ṁΣḣdi*^¹10\
          \ reciprocal of input
     *^¹10  multiply with 10^input
    i       convert to int
   d        digits
  ḣ         prefixes
ṁΣ          map-sum with sum

05AB1E, 9 bytes
L°¹÷T%ηOO

Try it online!
L°¹÷T%ηOO  # full program
        O  # sum of...
       O   # sums of...
           # (implicit) each element of...
      η    # prefixes of...
 °         # 10 to the power of...
           # (implicit) each element of...
L          # [1, 2, 3, ...,
           # ..., implicit input]...
   ÷       # integer divided by...
  ¹        # input...
     %     # modulo...
    T      # 10
           # implicit output

C, 53 bytes
f(n,i,x,s){while(i)x=10*(x%n),s+=i--*(x/n);return s;}

Below the main for to do some test...
//44,79
#define R return
#define F for
#define U unsigned
#define N int
#define B break
#define I if
#define L(i) for(;i-->0;)
#define J(a,b)  if(a)goto b
#define G goto
#define P printf
#define D double
#define C unsigned char
#define A getchar()
#define O putchar
#define M main
#define Y malloc
#define Z free
#define S sizeof
#define T struct
#define E else
#define Q static
#define X continue
main()
{N  k, a=0, b=0, i;

 F(i=1;i<50;++i)
       P("f(%u)=%u |", i, f(i,i,1,0));
 P("\n");
 F(i=24990;i<=25000;++i)
       P("f(%u)=%u |", i, f(i,i,1,0));
 P("\n");
 R 0;
}

/*
f(1)=0 |f(2)=10 |f(3)=18 |f(4)=23 |f(5)=10 |f(6)=96 |f(7)=103 |f(8)=52 |f(9)=45
f(10)=10 |f(11)=270 |f(12)=253 |f(13)=402 |f(14)=403 |f(15)=630 |f(16)=183 |f(17)=660
f(18)=765 |f(19)=819 |f(20)=95 |f(21)=975 |f(22)=1034 |f(23)=1221 |f(24)=1500
f(25)=96 |f(26)=1479 |f(27)=1197 |f(28)=1658 |f(29)=1953 |f(30)=1305 |f(31)=1674
f(32)=321 |f(33)=816 |f(34)=2490 |f(35)=2704 |f(36)=4235 |f(37)=2022 |f(38)=3242
f(39)=2295 |f(40)=268 |f(41)=2944 |f(42)=3787 |f(43)=3874 |f(44)=4097 |f(45)=1980
f(46)=4380 |f(47)=4968 |f(48)=3424 |f(49)=4854 |
f(24990)=1405098782 |f(24991)=1417995426 |f(24992)=1364392256 |f(24993)=1404501980
f(24994)=1408005544 |f(24995)=1377273489 |f(24996)=1395684561 |f(24997)=1405849947
f(24998)=1406216741 |f(24999)=1142066735 |f(25000)=99984
*/

Why someone down vote this? is it because some bug? is it because I not find the right min for him or her? For me that number of char are enough and ok feel free for cacel this answer too as the other where I can not speak

As others have commented on other answers of yours, the point of code golf is to make the code as short as possible, yet you continue to include a bunch of macros for no good reason. f(n,i,x,s){while(i)x=10*(x%n),s+=i--*(x/n);return s;} is only 53 bytes long.

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


text:
Sum of neighbours
This should be a fairly simple challenge.
For an array of numbers, generate an array where for every element all neighbouring elements are added to itself, and return the sum of that array.
Here is the transformation which occurs on the input array [1,2,3,4,5]
[1,2,3,4,5] => [1+2, 2+1+3, 3+2+4, 4+3+5, 5+4] => [3,6,9,12,9] => 39
 0          => neighbours of item 0, including item 0
[1,2]       => 1 + 2      => 3
   1
[1,2,3]     => 1 + 2 + 3  => 6
     2
  [2,3,4]   => 2 + 3 + 4  => 9
       3
    [3,4,5] => 3 + 4 + 5  => 12
         4
      [4,5] => 4 + 5      => 9

               3+6+9+12+9 => 39

Test cases
[]            => 0 (or falsy)
[1]           => 1
[1,4]         => 10 (1+4 + 4+1)
[1,4,7]       => 28
[1,4,7,10]    => 55
[-1,-2,-3]    => -14
[0.1,0.2,0.3] => 1.4
[1,-20,300,-4000,50000,-600000,7000000] => 12338842

Leaderboard

var QUESTION_ID=96188,OVERRIDE_USER=41257;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Related. Related. Related.

Do we need to support floating point numbers or only integers?

@corvus_192 The test cases include non-integers.

@Geobits I didn't notice that, I'll edit my answer.

You should do this with 2 dimensional arrays next.

MATL, 5 bytes
7BZ+s

Try it online!
Explanation
7B  % Push array [1, 1, 1], obtained as 7 in binary
Z+  % Take input implicitly. Convolve with [1, 1, 1], keeping size
s   % Sum of resulting array. Display implicitly

Very clever use of 7B there to get [1 1 1]

I don't know MATL, but I wonder: for a list [a,b,c,...], how do you get a+b but avoid getting a?

@Christian The addition is done by means of a convolution operation. It would produce the partial results you refer to, but there's a version of convolution that avoids them, because it produces an output array with only as many entries as the input. This is also used in Suever's answer

Python, 25 bytes
lambda a:sum((a*3)[1:-1])

To see why this works, rotate the expansion in the OP by 45 degrees:
             1 + 2
           + 1 + 2 + 3                            2 + 3 + 4 + 5
               + 2 + 3 + 4          =       + 1 + 2 + 3 + 4 + 5
                   + 3 + 4 + 5              + 1 + 2 + 3 + 4.
                       + 4 + 5

Python 2, 28 bytes
lambda a:sum(a)*3-a[0]-a[-1]

Just 3 times the sum and minus one of each end element

I also found a neat 25-byte solution.

Actually, what if a is the empty list (first test case)? a[0] will throw an IndexError, no?

05AB1E, 11 5 bytes
Saved 6 bytes thanks to Adnan.
€Ð¦¨O

Try it online!
Explanation
€Ð     # triplicate each item in the list
  ¦¨   # remove first and last element
    O  # sum

Does €Ð¦¨O work :)?

@Adnan: Brilliant! I tried to think of a way to do it with 3*, but I never even considered €Ð even though I've used €D before :P

R, 75 70 52 34 33 31 bytes
Sum times three and subtract first and last element
sum(x<-scan())*3-x[1]-tail(x,1)

Edit: Saved 3 extra bytes thanks to @rturnbull

JavaScript (ES6), 40 33 bytes
l=>eval(l.join`+`)*3-l[0]-l.pop()

Returns NaN when given an empty list.

You can chop off 2 more characters if you move the multiplication into the join like so v=>eval(v.join\*3+`+"*2")-v[0]`

@Grax - Nice! However, it would not be falsy anymore for the empty array.

There's always something isn't there?

@Grax - No. The first test case is an empty array.

Scala, 47 bytes
def&(a:Float*)=(0+:a:+0)sliding 3 map(_.sum)sum

Prepends and appends a 0, then uses a sliding window of size 3 to sum the neighbors, and calculates the total sum

Java 7, 72 Bytes
float c(float[]a){float s=0,l=0;for(float i:a)s+=l=i;return 3*s-l-a[0];}

I don't think adding extra inputs denoting the first and last elements of the array is in the spirit of the challenge.

@Geobits I change it.....

Cool. You can golf it some more by using float instead of double :)

Can i use it instead.... Double has 2x the precision of float.

I usually do, and it's never come up as an issue.

Hate to break it to you, but this fails for an empty input (c(new float[] { }))

Also for the last test input, your function returns 1.2338843E7 which is equal to 12338843

why not ints?

Mathematica, 34 32 29 bytes
Taking some inspiration Lynn's neat Python answer...
Check[3Tr@#-Last@#-#[[1]],0]&

or
Check[3(+##)-#&@@#-Last@#,0]&

or
Check[##-#/3&@@#*3-Last@#,0]&

Unfortunately, this approach isn't quite as convenient in Mathematica as it is in Python, because there's no short and safe way to discard the first and last element of a list that might be empty.

+1 for teaching me Check

MATLAB, 31 28 26 bytes
3 bytes saved thanks to @Luis
@(x)sum(conv(x,1:3>0,'s'))

This creates an anonymous function named ans that can be called like: ans([1, 2, 3, 4, 5])
In order to provide an online demo (which uses Octave), I had to use 'same' instead of 's' as the last input to conv
Online Demo
Explanation
We perform convolution (conv) with a 1 x 3 kernel of all 1's (created by making an array 1:3 and then comparing to zero >0) and keep the size of the original by specifying the third input as 'same' or in MATLAB we can simply shorten this to 's'. We then apply the sum to the result.

You can probably shorten to 's'

@LuisMendo Oh good call! MATLAB allows it but Octave doesn't (of course)

Jelly, 5 bytes
ẋ3ṖḊS

Try it online!
Translation of my Python answer.
ẋ3      Concatenate three copies of the input list
  Ṗ     Remove the last element
   Ḋ    Remove the first element
    S   Sum

So many 5 byters, where's the 4? ḊṖ+ḤS, Ṗ++ḊS, +Ḋ+ṖS, +Ṗ+ḊS, ...

J, 9 bytes
+/@,}.,}:

For [1, 2, 3, 4, 5], the neighbors are
1 2 3 4 5
1+2
1+2+3
  2+3+4
    3+4+5
      4+5

Then look along the diagonals of the sums
(2+3+4+5)+(1+2+3+4+5)+(1+2+3+4)

So we need only the find the sum of the input with its head removed and with its tail removed.
Usage
   f =: +/@,}.,}:
   f 1 2 3 4 5
39
   f '' NB. Empty array
0
   f 1
1
   f 1 4
10
   f 1 4 7
28
   f 1 4 7 10
55
   f _1 _2 _3
_14
   f 0.1 0.2 0.3
1.4
   f 1 _20 300 _4000 50000 _600000 7000000
12338842

Explanation
+/@,}.,}:  Input: array A
       }:  Return a list with the last value in A removed
    }.     Return a list with the first value in A removed
      ,    Join them
   ,       Join that with A
+/@        Reduce that using addition to find the sum and return

Nice. And happy 6k+!

Ruby, 35 33 31 bytes
Inspired by Lynn's solution:
->a{[*(a*3)[1..-2]].reduce:+}

The to_a segment is there to handle the empty array.
EDIT: Thanks to m-chrzan and histocrat.

You don't need parentheses around :+.

[*(a*3)[1..-2]] does .to_a in two fewer bytes.

You might want to give Ruby 2.4.0 a go. It comes with Array#sum.

Brain-Flak, 68 bytes
(<><>)([]){{}({}({})<>{})<>({}<(({})<>{})><>)([][()()])}{}({}{}<>{})

Try it online!
Explanation:
#Push a 0
(<><>)

#Push the stack height
([])

#While true:
{

    #Pop the stack height
    {}

    #Add the sum of the top 3 elements to the other stack, and pop the top of the stack
    ({}({})<>{})<>({}<(({})<>{})><>)

    #Push the new stack height minus two
    ([][()()])

#End
}

#Pop the exhausted counter
{}

#Add the top two numbers to the other stack
({}{}<>)

PowerShell v2+, 40 bytes
param($a)($a-join'+'|iex)*3-$a[0]-$a[-1]

Similar to the other answers, sums the list, multiplies by 3, subtracts the end elements. Barfs out a spectacular error for empty input, and then spits out 0, but since STDERR is ignored by default, this is OK.
PS C:\Tools\Scripts\golfing> .\sum-of-neighbors.ps1 @()
Invoke-Expression : Cannot bind argument to parameter 'Command' because it is an empty string.
At C:\Tools\Scripts\golfing\sum-of-neighbors.ps1:1 char:22
+ param($a)($a-join'+'|iex)*3-$a[0]-$a[-1]
+                      ~~~
    + CategoryInfo          : InvalidData: (:String) [Invoke-Expression], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.InvokeExpressionCommand

0

PS C:\Tools\Scripts\golfing> .\sum-of-neighbors.ps1 @(1)
1

PS C:\Tools\Scripts\golfing> .\sum-of-neighbors.ps1 @(1,4)
10

PS C:\Tools\Scripts\golfing> .\sum-of-neighbors.ps1 @(1,4,7)
28

PS C:\Tools\Scripts\golfing> .\sum-of-neighbors.ps1 @(1,4,7,10)
55

PS C:\Tools\Scripts\golfing> .\sum-of-neighbors.ps1 @(-1,-2,-3)
-14

PS C:\Tools\Scripts\golfing> .\sum-of-neighbors.ps1 @(0.1,0.2,0.3)
1.4

PS C:\Tools\Scripts\golfing> .\sum-of-neighbors.ps1 @(1,-20,300,-4000,50000,-600000,7000000)
12338842

ParameterArgumentValidationErrorEmptyStringNotAllowed ಠ_ಠ What an exception!

Perl 6, 25 bytes
{.sum*3-.[0]-(.[*-1]//0)}    # generates warning
{+$_&&.sum*3-.[0]-.[*-1]}

Expanded:
# bare block lambda with implicit parameter ｢$_｣
{
  +$_        # the number of elements

  &&         # if that is 0 return 0, otherwise return the following

  .sum * 3   # sum them up and multiply by 3
  - .[ 0 ]   # subtract the first value
  - .[*-1]   # subtract the last value
}

Test:
use v6.c;
use Test;

my &code = {+$_&&.sum*3-.[0]-.[*-1]}

my @tests = (
  []            => 0,
  [1]           => 1,
  [1,4]         => 10,
  [1,4,7]       => 28,
  [1,4,7,10]    => 55,
  [-1,-2,-3]    => -14,
  [0.1,0.2,0.3] => 1.4,
  [1,-20,300,-4000,50000,-600000,7000000] => 12338842,
);

plan +@tests;

for @tests -> $_ ( :key(@input), :value($expected) ) {
  is code(@input), $expected, .gist;
}

C# with LINQ, 42 bytes
a=>3*a.Sum()-(a.Length>0?a[0]+a.Last():0);

Requires the System.Linq namespace.

C#, 84 bytes
a=>{int i=0,l=a.Length;var r=0d;for(;i<l;)r+=3*a[i++];return(l>0?r-a[0]-a[l-1]:0);};

Full program with test cases:
using System;

namespace SumOfNeighbours
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<double[],double>f= a=>{int i=0,l=a.Length;var r=0d;for(;i<l;)r+=3*a[i++];return(l>0?r-a[0]-a[l-1]:0);};

            // test cases:
            double[] x = new double[]{1,2,3,4,5};
            Console.WriteLine(f(x));    // 39

            x = new double[] {};
            Console.WriteLine(f(x));    // 0

            x = new double[] {1};
            Console.WriteLine(f(x));    // 1

            x = new double[] {1,4};
            Console.WriteLine(f(x));    // 10 (1+4 + 4+1)

            x = new double[] {1,4,7};
            Console.WriteLine(f(x));    // 28

            x = new double[] {1,4,7,10};
            Console.WriteLine(f(x));    // 55

            x = new double[] {-1,-2,-3};
            Console.WriteLine(f(x));    // -14

            x = new double[] {0.1,0.2,0.3};
            Console.WriteLine(f(x));    // 1.4

            x = new double[] {1,-20,300,-4000,50000,-600000,7000000};
            Console.WriteLine(f(x));    // 12338842
        }
    }
}

PHP, 39 bytes
<?=3*array_sum($a=$argv)-$a[1]-end($a);

Run like this:
echo '<?=3*array_sum($a=$argv)-$a[1]-end($a);' | php -- 1 -20 300 -4000 50000 -600000 7000000 2>/dev/null;echo

Explanation
Challenge can be reduced to adding every number 3 times, except the first and last number (added twice). Therefore I return 3 times the sum, minus the first and last number.

Batch, 67 bytes
@set/as=l=0
@for %%n in (%*)do @set/as+=l=%%n
@cmd/cset/as*3-%1-l

If there are no parameters, the last command turns into 0 * 3 - -0.

><>, 25 (+3 for  -v) = 28 bytes
Takes input from the stack with  -v and assumes stdin is empty, relying on it to provide a -1 value.
:{:}+i*v
:$v?=1l<+++:
;n<

Racket 48 bytes
(if(null? l)0(-(* 3(apply + l))(car l)(last l)))

Ungolfed:
(define (f lst)
  (if (null? lst)
      0
      (- (* 3 (apply + lst))
         (first lst)
         (last lst))))

Testing:
(f '())
(f '(1))
(f '(1 4))
(f '(1 4 7))
(f '(1 4 7 10))
(f '(-1 -2 -3))
(f '(0.1 0.2 0.3))
(f '(1 -20 300 -4000 50000 -600000 7000000))

Output:
0
1
10
28
55
-14
1.4000000000000001
12338842

Gloo, 12 Bytes
Turns out a feature of Gloo isn't working as intended so I had to do this a painful way.
__]:]:]:,,[+

Explanation:
__                   // duplicate the input list twice
  ]:]:]:             // flatten each list, and rotate stack left
        ,,           // pop the last 2 numbers
                     // (which are the first and last element of the list)
          [+         // wrap all items in a list and sum.

Pyke, 9 5 bytes
3*tOs

Try it here!

Elixir, 93 bytes
&if (length(&1)>0),do: Enum.reduce(&1,fn(n,r)->n+r end)*3-Enum.at(&1,0)-List.last(&1),else: 0

Anonymous function using the capture operator.
Full program with test cases:
s=&if (length(&1)>0),do: Enum.reduce(&1,fn(n,r)->n+r end)*3-Enum.at(&1,0)-List.last(&1),else: 0
# test cases:
IO.puts s.([])            # 0
IO.puts s.([1])           # 1
IO.puts s.([1,4])         # 10 (1+4 + 4+1)
IO.puts s.([1,4,7])       # 28
IO.puts s.([1,4,7,10])    # 55
IO.puts s.([-1,-2,-3])    # -14
IO.puts s.([0.1,0.2,0.3]) # 1.4
IO.puts s.([1,-20,300,-4000,50000,-600000,7000000]) # 12338842

Try it online on ElixirPlayground !

TI-Basic, 17 bytes
Simply three times the sum of the list, minus the first and last element.
3sum(Ans)-Ans(1)-Ans(dim(Ans)-1

I believe consensus on meta says that Ans is an invalid form of input.

You can use it with a list, don't worry. Pass it like {1,3,5,7,2,6}:prgmNEIGHBOR

That's still Ans as input.

Does it look like I care? That's the standard way of passing input in TI-Basic.

as much as I agree with you, that doesn't make the answer any more valid.

It is most definitely valid. Try it yourself. Anyone else doesn't know what they're talking about.

GameMaker Language, 69 bytes
a=argument_count;for(i=0;ia{a.reduce(0,:+)*3-(a[0]?a[0]+a[-1]:0)}

Full program with test cases:
f=->a{a.reduce(0,:+)*3-(a[0]?a[0]+a[-1]:0)}

#test cases
a=[]
puts f.call(a)  # 0

a=[1]
puts f.call(a)  # 1

a=[1,4]
puts f.call(a)  # 10

a=[1,4,7]
puts f.call(a)  # 28

a=[1,4,7,10]
puts f.call(a)  # 55

a=[-1,-2,-3]
puts f.call(a)  # -14

a=[0.1,0.2,0.3]
puts f.call(a)  # 1.4

a=[1,-20,300,-4000,50000,-600000,7000000]
puts f.call(a)  # 12338842

My first attempt in Ruby.

As of Ruby 2.4.0 there's Array#sum. I haven't yet installed the preview release though to test whether this can simply be dropped into this solution.

Javascript, 46 bytes
a.reduce((t,c,i)=>t+(a[i-1]|0)+c+(a[i+1]|0),0)

const a = [1,2,3,4,5];
console.log(a.reduce((t,c,i)=>t+(a[i-1]|0)+c+(a[i+1]|0),0));

Thanks @rlemon for the extra 2 bytes

Java 8, 60
d->d.length>0?Arrays.stream(d).sum()*3-d[0]-d[d.length-1]:0;

C++, 67 bytes
#import<valarray>
int f(std::valarray<int>v){return 3*v.sum()-v[0]-v[v.size()-1];}

Usage:
#include <iostream>
int main() {
    std::cout << f({1,2,1});
    return 0;
}

Haskell, 25 bytes
From fastest
sum.sequence[(0-).head,(3*).sum,(0-).last]$[1..5]

via prettiest
sum.sequence[sum.init,sum,sum.tail]$[1..5]

down to ugliest but shortest
let y x=sum$init x++x++tail x in y[1..5]
--  1234567890123456789012345

Pyth, 10 7 5 bytes
sPt*3

Saved 1 byte thanks to implicit input, and 1 byte thanks to the P function (replaces t_ in the previous solution)

Previous versions:
st_t*3Q

Concatenates the array 3 times, removes first and last elements, and sums it up
-*3sQ+eQhQ

The final sum is 3 times the sum of the elements - first element - last element.
That's exactly what this code does :)
Try it here!

Actually, 9 bytes
Golfing suggestions welcome. Try it online!
3@VdXpXΣΣ

Ungolfing
       Implicit input a.
3@V    Push all slices of a of length 1 <= n <= 3.
dXpX   Get rid of the first and last slices since they're length 1 lists.
Σ      Summing a 2D array essentially flattens into a 1D array.
Σ      Push sum(a).
       Implicit return.

Vim, 21 bytes
yGPP<C-V>GI+<Esc>DgvJD^C<C-R>=<C-R>"<CR>
Input is one number per line. Same algorithm as other entries (triplicate array, remove first and last items, sum).

C++14, 64 59 bytes
As unnamed lambda
[](auto c,int&r){r=-c[0];for(auto x:c)r+=3*x;r-=c.back();}

Initializes counter with -c[0], then sums all elements times 3 and subtracts the last element. This gives 3*sum(c)-c.first-c.last which is the direct formula for this problem.
Takes any container that supports .back(). If you insinst on using plain old arrays (örglöärks) then substitute c.back() with std::end(c)[-1] for +7 bytes.
Usage:
auto n=[](auto c,int&r){r=-c[0];for(auto x:c)r+=3*x;r-=c.back();};

std::vector<int> v{1,2,3,4,5};
//or// std::array<int,5> v{1,2,3,4,5};
//or// int v[]={1,2,3,4,5}; //with std::end(c)[-1]
int r;
n(v,r);
std::cout << r << std::endl;

APL (Dyalog Unicode), 10 bytes
+/¯1↓1↓3/⊢

Try it online!
Explanation
Use the same observation as a previous answer that the result is the sum of 3x the elements minus the first and last.
+/¯1↓1↓3/⊢ ⍝ Function train. Below explanation uses a sample input of 1 2 3
       3/⊢ ⍝ Repeats (/) each element of the right hand side (⊢) three times - 1 1 1 2 2 2 3 3 3
     1↓    ⍝ Drops (↓) the first item of the array -> 1 1 2 2 2 3 3 3
  ¯1↓      ⍝ Drops (↓) the last item (¯1) of the array -> 1 1 2 2 2 3 3
+/         ⍝ Sum over the array -> 14

Thunno 2 S, 4 bytes
€Ðḣṫ

Try it online!
Port of Emigna's 05AB1E answer.
Explanation
€Ðḣṫ  # Implicit input
€     # To each item in the input:
 Ð    #  Triplicate in-place
  ḣ   # Remove the first item
   ṫ  # Remove the last item
      # Sum the resulting list
      # Implicit output

C#, 49 45 bytes
(27 if you don't count the using statement)
using System.Linq;v=>v.Sum()*3-v[0]-v.Last();

Sum()*3 saves 4 bytes

source: Stack Exchange

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

sort: votes


text:
How old is that map?
Referencing xkcd 1688:

Your task is to deduct the age of a map by asking the user questions. These question must be exactly the same as in the xkcd guide, except from the capitalisation and additional newline(s). Additionally, you should give the user some options to choose from, which don't have to be in the order as in the xkcd image. If the input doesn't match any of the expected answers, your program/function may behave in any undefined way. At the end, you should output the year/timespan the map was created.
Examples (> denotes input, but you may choose something else):
Example 1:
ISTANBUL OR CONSTANTINOPLE?
(CONSTANTINOPLE, NEITHER, ISTANBUL)

>ISTANBUL

DOES THE SOVIET UNION EXISTS?
(YES, NO)

>NO

ZAIRE?
OR: 'HONG KONG (UK)'
(YES, NO)

>NO

SERBIA / MONTENEGRO ARE?
(ONE COUNTRY, TWO COUNTRIES)

>TWO COUNTRIES

HOW MANY SUDANS ARE THERE?
(ONE, TWO)

>ONE

2007-11

Example 2:
ISTANBUL OR CONSTANTINOPLE?
(CONSTANTINOPLE, NEITHER, ISTANBUL)

>how are you

error

I see you already golffed Germanies

Does the choice of question to ask need to depend on previous answers, like a flow chart, or can the code simply ask all of the questions?

You have to follow the flowchart exactly as in the xkcd.

Can you ask for the answers in code (e.g. Istanbul (1) or Constantinople (2) or Neither (3)?)

You may give the answers with an associated number and expect a number as input.

explanations + transcript

Yeah, a transcript of all the questions would incline me to try this but at the mo far too exhaustive an exercise. But, having said that, what a fascinating flow chart. +1 for such an interesting base material.

Game Maker Language (GM 8.0), 10262 10228 10152 10115 8746 1 + 8699 = 8700 bytes
We define a script named X (1 byte). Each question is labelled with an integer. X takes such an integer, prompts the user with the corresponding question, and either returns the appropriate message or calls the next question. At each question, the user is prompted for an integer corresponding to the possible options. If the user does not match any of the options, then the prompt is exited.
A=argument1 Y="##YES (1), NO (2)"I="IS THERE A BIG LAKE IN THE MIDDLE OF "H="HOW MANY "switch argument0{case H:return show_message(A)break
case I:return get_integer(A,1)break
case 1:switch X(I,"ISTANBUL OR CONSTANTINOPLE##CONSTANTINOPLE (1), NEITHER (2), ISTANBUL(3)"){case 1:X(2)break case 2:X(19)break case 3:X(74)}break
case 2:switch X(I,"DO ANY OF THESE EXIST?#- INDEPENDENT CANADA#- US TERRITORY OF ALASKA#- TOKYO"+Y){case 2:X(3)break case 1:X(11)}break
case 3:switch X(I,"THE HOLY ROMAN EMPIRE?"+Y){case 1:X(H,"1805 OR EARLIER (BEFORE THIS POINT, THE MODERN IDEA OF A COMPLETE POLITICAL MAP OF THE WORLD GETS HARD TO APPLY.)")break case 2:X(4)}break
case 4:switch X(I,"THE UNITED STATES?"+Y){case 2:X(H,"HOW SURE ARE YOU THAT THIS MAP IS IN ENGLISH")break case 1:X(5)}break
case 5:switch X(I,"TEXAS IS...##PART OF MEXICO (1), INDEPENDENT (2), PART OF THE US (3)"){case 1:X(6)break case 2:X(H,"1834-45")break case 3:X(9)}break
case 6:switch X(I,"FLORIDA IS PART OF...##SPAIN (1), THE US (2)"){case 1:X(7)break case 2:X(8)}break
case 7:switch X(I,"PARAGUAY?"+Y){case 2:X(H,"1806H0")break case 1:X(H,"1811H7")}break
case 8:switch X(I,"VENEZUELA AND/OR ECUADOR?"+Y){case 2:X(H,"1818-29")break case 1:X(H,"1830-33")}break
case 9:switch X(I,"DOES RUSSIA BORDER THE SEA OF JAPAN?"+Y){case 2:X(10)break case 1:X(H,"1858-67")}break
case 10:switch X(I,"THE US'S SOUTHERN BORDER LOOKS...##WEIRD (1), NORMAL (2)"){case 1:X(H,"1846-53")break case 2:X(H,"1854-56")}break
case 11:switch X(I,"SOUTH AFRICA?"+Y){case 2:X(12)break case 1:X(16)}break
case 12:switch X(I,"RHODESIA?"+Y){case 2:X(13)break case 1:X(15)}break
case 13:switch X(I,"IS BOLIVIA LANDLOCKED?"+Y){case 2:X(14)break case 1:X(H,"1884-95")}break
case 14:switch X(I,'"BUDA" AND "PEST" OR "BUDAPEST"?##BUDA AND PEST (1), BUDAPEST (2)'){case 1:X(H,"1868-72")break case 2:X(H,"1873-83")}break
case 15:switch X(I,"IS NORWAY PART OF SWEDEN?"+Y){case 1:X(H,"1896H905")break case 2:X(H,"1906-09")}break
case 16:switch X(I,"AUSTRIA-HUNGARY?"+Y){case 1:X(17)break case 2:X(18)}break
case 17:switch X(I,"ALBANIA?"+Y){case 2:X(H,"1910H2")break case 1:X(H,"1913H8")}break
case 18:switch X(I,"LENINGRAD?"+Y){case 2:X(H,"1919-23")break case 1:X(H,"1924-29")}break
case 19:switch X(I,"DOES THE OTTOMAN EMPIRE EXIST?"+Y){case 1:X(2)break case 2:X(20)}break
case 20:switch X(I,"THE SOVIET UNION?"+Y){case 2:X(21)break case 1:X(63)}break
case 21:switch X(I,"NORTH KOREA?"+Y){case 2:X(22)break case 1:X(56)}break
case 22:switch X(I,"SAINT TRIMBLE'S ISLAND?"+Y){case 2:X(23)break case 1:X(H,"NO, I MADE THAT ONE UP.")}break
case 23:switch X(I,"IS JAN MAYEN PART OF THE KINGDOM OF NORWAY?##NOT YET (1), WHAT? (2), YES (3)"){case 1:X(2)break case 2:X(24)break case 3:X(49)}break
case 24:switch X(I,"CAN YOU SEE THE FAMILIAR CONTINENTS?"+Y){case 1:X(25)break case 2:X(31)}break
case 25:switch X(I,"THIS SOUNDS LIKE A PHYSICAL MAP OR SATELLITE PHOTO.##YES, THAT'S IT (1)"){case 1:X(26)}break
case 26:switch X(I,"IS LAKE CHAD MISSING?"+Y){case 2:X(27)break case 1:X(30)}break
case 27:switch X(I,"HOW FAR EAST DO THE AMERICAN PRAIRIES REACH?##INDIANA (1), THE MISSISSIPPI (2), NEBRASKA (3), WHAT PRAIRIES? (4)"){case 1:X(H,"BEFORE 1830")break case 2:X(H,"1830s-80s")break case 3:X(28)break case 4:X(29)}break
case 28:switch X(I,I+"SOUTHERN CALIFORNIA? (CREATED BY MISTAKE)"+Y){case 2:X(H,"1860sH900s")break case 1:X(H,"1910s")}break
case 29:switch X(I,I+"GHANA? (CREATED ON PURPOSE)"+Y){case 2:X(H,"1920s-50s")break case 1:X(H,"1960s-70s")}break
case 30:switch X(I,"IS THE ARAL SEA MISSING?"+Y){case 2:X(H,"1970s-90s")break case 1:X(H,"2000s+")}break
case 31:switch X(I,'RIVERS "SIRION" OR "ANDUIN"?'+Y){case 1:X(32)break case 2:X(36)}break
case 32:switch X(I,"MORDOR?"+Y){case 2:X(33)break case 1:X(34)}break
case 33:switch X(I,"BELERIAND?"+Y){case 1:X(H,"FIRST AGE")break case 2:X(H,"EARLY SECOND AGE")}break
case 34:switch X(I,"NÚMENOR?"+Y){case 1:X(H,"LATE SECOND AGE")break case 2:X(35)}break
case 35:switch X(I,"THE FOREST EAST OF THE MISTY MOUNTAINS IS...##GREENWOOD THE GREAT (1), MIRKWOOD (2), THE WOOD OF GREENLEAVES (3)"){case 1:X(H,"EARLY THIRD AGE")break case 2:X(H,"LATE THIRD AGE")break case 3:X(H,"FOURTH AGE")}break
case 36:switch X(I,"CAIR PARAVEL?"+Y){case 1:X(37)break case 2:X(41)}break
case 37:switch X(I,"CALORMEN?"+Y){case 2:X(38)break case 1:X(40)}break
case 38:switch X(I,"LOTTA ISLANDS?"+Y){case 2:X(39)break case 1:X(H,"DAWN TREADER")}break
case 39:switch X(I,"BERUNA##FORD (1), BRIDGE (2)"){case 1:X(H,"THE LION, THE WITCH, AND THE WARDROBE")break case 2:X(H,"PRINCE CASPIAN")}break
case 40:switch X(I,"WEIRD RECURSIVE HEAVEN?"+Y){case 2:X(H,"ONE OF THE RANDOM LATER BOOKS")break case 1:X(H,"THE LAST BATTLE")}break
case 41:switch X(I,"MOSSFLOWER?"+Y){case 1:X(H,"REDWALL")break case 2:X(42)}break
case 42:switch X(I,"IS THE WORLD ON THE BACK OF A TURTLE?"+Y){case 1:X(H,"DISCWORLD")break case 2:X(43)}break
case 43:switch X(I,"ARE YOU SURE THIS IS A MAP?"+Y){case 1:X(44)break case 2:X(46)}break
case 44:switch X(I,"DID YOU MAKE IT YOURSELF?##YES (1)"){case 1:X(45)}break
case 45:X(I,"IT'S VERY NICE.##THANK YOU! (1)")break
case 46:switch X(I,"IS IT TRYING TO BITE YOU?"+Y){case 2:X(47)break case 1:X(48)}break
case 47:switch X(I,"IS IT LARGER THAN A BREADBOX?"+Y+", ABOUT THE SAME (3)"){case 1:X(H,"TUBA")break case 2:X(H,"STAPLER")break case 3:X(H,"BREADBOX")}break
case 48:switch X(I,"IF YOU LET IT GO, WHAT DOES IT DO?##HISSES AND RUNS AWAY (1), SCREECHES AND FLAPS AROUND THE ROOM BREAKING THINGS (2)"){case 1:X(H,"CAT")break case 2:X(H,"SEAGULL")}break
case 49:switch X(I,"PAKISTAN?"+Y){case 2:X(50)break case 1:X(52)}break
case 50:switch X(I,H+"GERMANYS ARE THERE?##ONE (1), ONE, BUT IT'S HUGE (2), TWO (3)"){case 1:X(51)break case 2:X(H,"1941-45")break case 3:X(H,"1946-47")}break
case 51:switch X(I,"PERSIA OR IRAN?##PERSIA (1), IRAN (2)"){case 1:X(H,"1930-34")break case 2:X(H,"1935-40")}break
case 52:switch X(I,"CAMBODIA?"+Y){case 2:X(53)break case 1:X(55)}break
case 53:switch X(I,"ERITREA IS A PART OF...##ITALY (1), ETHIOPIA (2)"){case 1:X(54)break case 2:X(H,"1952-53")}break
case 54:switch X(I,"CANADA IS...##MISSING A PIECE (1), FINE (2)"){case 1:X(H,"1948")break case 2:X(H,"1949-52")}break
case 55:switch X(I,"THE UNITED ARAB REPUBLIC?"+Y){case 2:X(H,"1954-57")break case 1:X(H,"1958-60")}break
case 56:switch X(I,'ZAIRE? OR: "HONG KONG (UK)"'+Y){case 1:X(H,"1992-96")break case 2:X(57)}break
case 57:switch X(I,"SERBIA AND MONTENEGRO ARE...##ONE COUNTRY (1), TWO COUNTRIES (2)"){case 1:X(58)break case 2:X(59)}break
case 58:switch X(I,"EAST TIMOR?"+Y){case 2:X(H,"1997-2001")break case 1:X(H,"2002-06")}break
case 59:switch X(I,H+"SUDANS ARE THERE?##ONE (1), TWO (2)"){case 1:X(H,"2007H1")break case 2:X(60)}break
case 60:switch X(I,"IS CRIMEA DISPUTED?"+Y){case 1:X(61)break case 2:X(H,"2012H3")}break
case 61:switch X(I,'"COLORADO" OR "DANGER-RADIOACTIVE EXCLUSION ZONE-AVOID"?##COLORADO (1), DANGER (2)'){case 1:X(H,"2014-21")break case 2:X(62)}break
case 62:switch X(I,"DOES THE WARNING MENTION THE SPIDERS?"+Y){case 2:X(H,"2022")break case 1:X(H,"2023 OR LATER")}break
case 63:switch X(I,"SAUDI ARABIA?"+Y){case 2:X(H,"1922-32")break case 1:X(64)}break
case 64:switch X(I,"IS MOST OF WEST AFRICA A GIANT FRENCH BLOB?"+Y){case 1:X(49)break case 2:X(65)}break
case 65:switch X(I,H+"VIETNAMS ARE THERE?##TWO (1), ONE (2)"){case 1:X(66)break case 2:X(69)}break
case 66:switch X(I,"BANGLADESH?"+Y){case 2:X(67)break case 1:X(H,"1972-75")}break
case 67:switch X(I,"IS THE AREA SOUTH OF LAKE VICTORIA...##BRITISH (1), TANGANYIKA (2), TANZANIA (3)"){case 1:X(68)break case 2:X(H,"1961-64")break case 3:X(H,"1965-71")}break
case 68:switch X(I,"THE TOWN ON I-25 BETWEEN ALBUQUERQUE AND EL PASO IS...##HOT SPRINGS (1), TRUTH OR CONSEQUENCES (2)"){case 1:X(H,"1948-49")break case 2:X(H,"1950-52")}break
case 69:switch X(I,"JIMMY CARTER IS...##BEING ATTACKED BY A GIANT SWIMMING RABBIT (1), FINE (2)"){case 1:X(H,"APRIL 20, 1979")break case 2:X(70)}break
case 70:switch X(I,"THE SINAI IS PART OF WHAT COUNTRY?## ISRAEL (1), MOSTLY ISRAEL (2), MOSTLY EGYPT (3), EGYPT (4)"){case 1:X(H,"1976-79")break case 2:X(H,"1980")break case 3:X(H,"1981")break case 4:X(71)}break
case 71:switch X(I,"WHAT'S THE CAPITAL OF MICRONESIA?## KOLONIA (1), PALIKIR (2)"){case 1:X(72)break case 2:X(73)}break
case 72:switch X(I,"REPUBLIC OF THE UPPER VOLTA OR BURKINA FASO?## UPPER VOLTA (1), BURKINA FASO (2)"){case 1:X(H,"1982-84")break case 2:X(H,"1985-88")}break
case 73:switch X(I,"(NUMBER OF YEMENS)+(NUMBER OF GERMANYS)=?## FOUR (1), THREE (2), TWO (3)"){case 1:X(H,"1989-EARLY 1990")break case 2:X(H,"MIDH990")break case 3:X(H,"LATE 1990H991")}break
case 74:switch X(I,"DOES THE SOVIET UNION EXIST?"+Y){case 1:X(64)break case 2:X(56)}break}

# is the newline character.
How to run

New .gmk file
Create a script X with contents as above
Create an object O with Create Event: execute code: X(1)
Create a room R and put one instance of O in it
Run the game

Golfing

The option YES now always precedes NO, and we define the string Y="##YES (1), NO (2)" for reuse.
"IS THERE A BIG LAKE IN THE MIDDLE OF " and "HOW MANY " are long enough and occur sufficiently many times for abbreviation to pay off. They are assigned to I and H.
In Game Maker, any user-defined function usually must be done in a separate script. The consensus on the policy for counting bytes for multi-file programs, was that "If files are reused ... count the contents of that file as many times as you use it". As such, we use X itself, rather than a separate script, to abbreviate get_integer and show_message. Explicitly,

If X is called with zeroth argument H, then it returns show_message of the first argument.
If X is called with zeroth argument I, then it returns get_integer of the first argument, showing default input 1.

Ungolfed, with options in the original order and no abbreviations at all:
// script X, takes node number, prompts question and returns message or calls X with next node number

switch argument0
{
case 1: switch get_integer("ISTANBUL OR CONSTANTINOPLE##CONSTANTINOPLE (1), NEITHER (2), ISTANBUL(3)",1)
  {
    case 1: X(2); break;
    case 2: X(19); break;
    case 3: X(74); break;
  }; break;
case 2: switch get_integer("DO ANY OF THESE EXIST?#- INDEPENDENT CANADA#- US TERRITORY OF ALASKA#- TOKYO##NO (1), YES (2)",1)
  {
    case 1: X(3); break;
    case 2: X(11); break;
  }; break;
case 3: switch get_integer("THE HOLY ROMAN EMPIRE?##YES (1), NO (2)",1)
  {
    case 1: show_message("1805 OR EARLIER (BEFORE THIS POINT, THE MODERN IDEA OF A COMPLETE POLITICAL MAP OF THE WORLD GETS HARD TO APPLY.)"); break;
    case 2: X(4); break;
  }; break;
case 4: switch get_integer("THE UNITED STATES?##NO (1), YES (2)",1)
  {
    case 1: show_message("HOW SURE ARE YOU THAT THIS MAP IS IN ENGLISH"); break;
    case 2: X(5); break;
  }; break;
case 5: switch get_integer("TEXAS IS...##PART OF MEXICO (1), INDEPENDENT (2), PART OF THE US (3)",1)
  {
    case 1: X(6); break;
    case 2: show_message("1834-45"); break;
    case 3: X(9); break;
  }; break;
case 6: switch get_integer("FLORIDA IS PART OF...##SPAIN (1), THE US (2)",1)
  {
    case 1: X(7); break;
    case 2: X(8); break;
  }; break;
case 7: switch get_integer("PARAGUAY?##NO (1), YES (2)",1)
  {
    case 1: show_message("1806-10"); break;
    case 2: show_message("1811-17"); break;
  }; break;
case 8: switch get_integer("VENEZUELA AND/OR ECUADOR?##NO (1), YES (2)",1)
  {
    case 1: show_message("1818-29"); break;
    case 2: show_message("1830-33"); break;
  }; break;
case 9: switch get_integer("DOES RUSSIA BORDER THE SEA OF JAPAN?##NO (1), YES (2)",1)
  {
    case 1: X(10); break;
    case 2: show_message("1858-67"); break;
  }; break;
case 10: switch get_integer("THE US'S SOUTHERN BORDER LOOKS...##WEIRD (1), NORMAL (2)",1)
  {
    case 1: show_message("1846-53"); break;
    case 2: show_message("1854-56"); break;
  }; break;
case 11: switch get_integer("SOUTH AFRICA?##NO (1), YES (2)",1)
  {
    case 1: X(12); break;
    case 2: X(16); break;
  }; break;
case 12: switch get_integer("RHODESIA?##NO (1), YES (2)",1)
  {
    case 1: X(13); break;
    case 2: X(15); break;
  }; break;
case 13: switch get_integer("IS BOLIVIA LANDLOCKED?##NO (1), YES (2)",1)
  {
    case 1: X(14); break;
    case 2: show_message("1884-95"); break;
  }; break;
case 14: switch get_integer('"BUDA" AND "PEST" OR "BUDAPEST"?##BUDA AND PEST (1), BUDAPEST (2)',1)
  {
    case 1: show_message("1868-72"); break;
    case 2: show_message("1873-83"); break;
  }; break;
case 15: switch get_integer("IS NORWAY PART OF SWEDEN?##YES (1), NO (2)",1)
  {
    case 1: show_message("1896-1905"); break;
    case 2: show_message("1906-09"); break;
  }; break;
case 16: switch get_integer("AUSTRIA-HUNGARY?##YES (1), NO (2)",1)
  {
    case 1: X(17); break;
    case 2: X(18); break;
  }; break;
case 17: switch get_integer("ALBANIA?##NO (1), YES (2)",1)
  {
    case 1: show_message("1910-12"); break;
    case 2: show_message("1913-18"); break;
  }; break;
case 18: switch get_integer("LENINGRAD?##NO (1), YES (2)",1)
  {
    case 1: show_message("1919-23"); break;
    case 2: show_message("1924-29"); break;
  }; break;
case 19: switch get_integer("DOES THE OTTOMAN EMPIRE EXIST?##YES (1), NO (2)",1)
  {
    case 1: X(2); break;
    case 2: X(20); break;
  }; break;
case 20: switch get_integer("THE SOVIET UNION?##NO (1), YES (2)",1)
  {
    case 1: X(21); break;
    case 2: X(63); break;
  }; break;
case 21: switch get_integer("NORTH KOREA?##NO (1), YES (2)",1)
  {
    case 1: X(22); break;
    case 2: X(56); break;
  }; break;
case 22: switch get_integer("SAINT TRIMBLE'S ISLAND?##NO (1), YES (2)",1)
  {
    case 1: X(23); break;
    case 2: show_message("NO, I MADE THAT ONE UP."); break;
  }; break;
case 23: switch get_integer("IS JAN MAYEN PART OF THE KINGDOM OF NORWAY?##NOT YET (1), WHAT? (2), YES (3)",1)
  {
    case 1: X(2); break;
    case 2: X(24); break;
    case 3: X(49); break;
  }; break;
case 24: switch get_integer("CAN YOU SEE THE FAMILIAR CONTINENTS?##YES (1), NO (2)",1)
  {
    case 1: X(25); break;
    case 2: X(31); break;
  }; break;
case 25: switch get_integer("THIS SOUNDS LIKE A PHYSICAL MAP OR SATELLITE PHOTO.##YES, THAT'S IT (1)",1)
  {
    case 1: X(26); break;
  }; break;
case 26: switch get_integer("IS LAKE CHAD MISSING?##NO (1), YES (2)",1)
  {
    case 1: X(27); break;
    case 2: X(30); break;
  }; break;
case 27: switch get_integer("HOW FAR EAST DO THE AMERICAN PRAIRIES REACH?##INDIANA (1), THE MISSISSIPPI (2), NEBRASKA (3), WHAT PRAIRIES? (4)",1)
  {
    case 1: show_message("BEFORE 1830"); break;
    case 2: show_message("1830s-80s"); break;
    case 3: X(28); break;
    case 4: X(29); break;
  }; break;
case 28: switch get_integer("IS THERE A BIG LAKE IN THE MIDDLE OF SOUTHERN CALIFORNIA? (CREATED BY MISTAKE)##NO (1), YES (2)",1)
  {
    case 1: show_message("1860s-1900s"); break;
    case 2: show_message("1910s"); break;
  }; break;
case 29: switch get_integer("IS THERE A BIG LAKE IN THE MIDDLE OF GHANA? (CREATED ON PURPOSE)##NO (1), YES (2)",1)
  {
    case 1: show_message("1920s-50s"); break;
    case 2: show_message("1960s-70s"); break;
  }; break;
case 30: switch get_integer("IS THE ARAL SEA MISSING?##NO (1), YES (2)",1)
  {
    case 1: show_message("1970s-90s"); break;
    case 2: show_message("2000s+"); break;
  }; break;
case 31: switch get_integer('RIVERS "SIRION" OR "ANDUIN"?##YES (1), NO (2)',1)
  {
    case 1: X(32); break;
    case 2: X(36); break;
  }; break;
case 32: switch get_integer("MORDOR?##NO (1), YES (2)",1)
  {
    case 1: X(33); break;
    case 2: X(34); break;
  }; break;
case 33: switch get_integer("BELERIAND?##YES (1), NO (2)",1)
  {
    case 1: show_message("FIRST AGE"); break;
    case 2: show_message("EARLY SECOND AGE"); break;
  }; break;
case 34: switch get_integer("NÚMENOR?##YES (1), NO (2)",1)
  {
    case 1: show_message("LATE SECOND AGE"); break;
    case 2: X(35); break;
  }; break;
case 35: switch get_integer("THE FOREST EAST OF THE MISTY MOUNTAINS IS...##GREENWOOD THE GREAT (1), MIRKWOOD (2), THE WOOD OF GREENLEAVES (3)",1)
  {
    case 1: show_message("EARLY THIRD AGE"); break;
    case 2: show_message("LATE THIRD AGE"); break;
    case 3: show_message("FOURTH AGE"); break;
  }; break;
case 36: switch get_integer("CAIR PARAVEL?##YES (1), NO (2)",1)
  {
    case 1: X(37); break;
    case 2: X(41); break;
  }; break;
case 37: switch get_integer("CALORMEN?##NO (1), YES (2)",1)
  {
    case 1: X(38); break;
    case 2: X(40); break;
  }; break;
case 38: switch get_integer("LOTTA ISLANDS?##NO (1), YES (2)",1)
  {
    case 1: X(39); break;
    case 2: show_message("DAWN TREADER"); break;
  }; break;
case 39: switch get_integer("BERUNA##FORD (1), BRIDGE (2)",1)
  {
    case 1: show_message("THE LION, THE WITCH, AND THE WARDROBE"); break;
    case 2: show_message("PRINCE CASPIAN"); break;
  }; break;
case 40: switch get_integer("WEIRD RECURSIVE HEAVEN?##NO (1), YES (2)",1)
  {
    case 1: show_message("ONE OF THE RANDOM LATER BOOKS"); break;
    case 2: show_message("THE LAST BATTLE"); break;
  }; break;
case 41: switch get_integer("MOSSFLOWER?##YES (1), NO (2)",1)
  {
    case 1: show_message("REDWALL"); break;
    case 2: X(42); break;
  }; break;
case 42: switch get_integer("IS THE WORLD ON THE BACK OF A TURTLE?##YES (1), NO (2)",1)
  {
    case 1: show_message("DISCWORLD"); break;
    case 2: X(43); break;
  }; break;
case 43: switch get_integer("ARE YOU SURE THIS IS A MAP?##YES (1), NO (2)",1)
  {
    case 1: X(44); break;
    case 2: X(46); break;
  }; break;
case 44: switch get_integer("DID YOU MAKE IT YOURSELF?##YES (1)",1)
  {
    case 1: X(45); break;
  }; break;
case 45: switch get_integer("IT'S VERY NICE.##THANK YOU! (1)",1)
  {
    case 1: break;
  }; break;
case 46: switch get_integer("IS IT TRYING TO BITE YOU?##NO (1), YES (2)",1)
  {
    case 1: X(47); break;
    case 2: X(48); break;
  }; break;
case 47: switch get_integer("IS IT LARGER THAN A BREADBOX?##YES (1), NO (2), ABOUT THE SAME (3)",1)
  {
    case 1: show_message("TUBA") break;
    case 2: show_message("STAPLER") break;
    case 3: show_message("BREADBOX") break;
  }; break;
case 48: switch get_integer("IF YOU LET IT GO, WHAT DOES IT DO?##HISSES AND RUNS AWAY (1), SCREECHES AND FLAPS AROUND THE ROOM BREAKING THINGS (2)",1)
  {
    case 1: show_message("CAT") break;
    case 2: show_message("SEAGULL") break;
  }; break;
case 49: switch get_integer("PAKISTAN?##NO (1), YES (2)",1)
  {
    case 1: X(50); break;
    case 2: X(52); break;
  }; break;
case 50: switch get_integer("HOW MANY GERMANYS ARE THERE?##ONE (1), ONE, BUT IT'S HUGE (2), TWO (3)",1)
  {
    case 1: X(51); break;
    case 2: show_message("1941-45") break;
    case 3: show_message("1946-47") break;
  }; break;
case 51: switch get_integer("PERSIA OR IRAN?##PERSIA (1), IRAN (2)",1)
  {
    case 1: show_message("1930-34") break;
    case 2: show_message("1935-40") break;
  }; break;
case 52: switch get_integer("CAMBODIA?##NO (1), YES (2)",1)
  {
    case 1: X(53); break;
    case 2: X(55); break;
  }; break;
case 53: switch get_integer("ERITREA IS A PART OF...##ITALY (1), ETHIOPIA (2)",1)
  {
    case 1: X(54); break;
    case 2: show_message("1952-53"); break;
  }; break;
case 54: switch get_integer("CANADA IS...##MISSING A PIECE (1), FINE (2)",1)
  {
    case 1: show_message("1948"); break;
    case 2: show_message("1949-52"); break;
  }; break;
case 55: switch get_integer("THE UNITED ARAB REPUBLIC?##NO (1), YES (2)",1)
  {
    case 1: show_message("1954-57"); break;
    case 2: show_message("1958-60"); break;
  }; break;
case 56: switch get_integer('ZAIRE? OR: "HONG KONG (UK)"##YES (1), NO (2)',1)
  {
    case 1: show_message("1992-96"); break;
    case 2: X(57); break;
  }; break;
case 57: switch get_integer("SERBIA AND MONTENEGRO ARE...##ONE COUNTRY (1), TWO COUNTRIES (2)",1)
  {
    case 1: X(58); break;
    case 2: X(59); break;
  }; break;
case 58: switch get_integer("EAST TIMOR?##NO (1), YES (2)",1)
  {
    case 1: show_message("1997-2001"); break;
    case 2: show_message("2002-06"); break;
  }; break;
case 59: switch get_integer("HOW MANY SUDANS ARE THERE?##ONE (1), TWO (2)",1)
  {
    case 1: show_message("2007-11"); break;
    case 2: X(60); break;
  }; break;
case 60: switch get_integer("IS CRIMEA DISPUTED?##YES (1), NO (2)",1)
  {
    case 1: X(61); break;
    case 2: show_message("2012-13"); break;
  }; break;
case 61: switch get_integer('"COLORADO" OR "DANGER-RADIOACTIVE EXCLUSION ZONE-AVOID"?##COLORADO (1), DANGER (2)',1)
  {
    case 1: show_message("2014-21"); break;
    case 2: X(62); break;
  }; break;
case 62: switch get_integer("DOES THE WARNING MENTION THE SPIDERS?##NO (1), YES (2)",1)
  {
    case 1: show_message("2022"); break;
    case 2: show_message("2023 OR LATER"); break;
  }; break;
case 63: switch get_integer("SAUDI ARABIA?##NO (1), YES (2)",1)
  {
    case 1: show_message("1922-32"); break;
    case 2: X(64); break;
  }; break;
case 64: switch get_integer("IS MOST OF WEST AFRICA A GIANT FRENCH BLOB?##YES (1), NO (2)",1)
  {
    case 1: X(49); break;
    case 2: X(65); break;
  }; break;
case 65: switch get_integer("HOW MANY VIETNAMS ARE THERE?##TWO (1), ONE (2)",1)
  {
    case 1: X(66); break;
    case 2: X(69); break;
  }; break;
case 66: switch get_integer("BANGLADESH?##NO (1), YES (2)",1)
  {
    case 1: X(67); break;
    case 2: show_message("1972-75"); break;
  }; break;
case 67: switch get_integer("IS THE AREA SOUTH OF LAKE VICTORIA...##BRITISH (1), TANGANYIKA (2), TANZANIA (3)",1)
  {
    case 1: X(68); break;
    case 2: show_message("1961-64"); break;
    case 3: show_message("1965-71"); break;
  }; break;
case 68: switch get_integer("THE TOWN ON I-25 BETWEEN ALBUQUERQUE AND EL PASO IS...##HOT SPRINGS (1), TRUTH OR CONSEQUENCES (2)",1)
  {
    case 1: show_message("1948-49"); break;
    case 2: show_message("1950-52"); break;
  }; break;
case 69: switch get_integer("JIMMY CARTER IS...##BEING ATTACKED BY A GIANT SWIMMING RABBIT (1), FINE (2)",1)
  {
    case 1: show_message("APRIL 20, 1979"); break;
    case 2: X(70); break;
  }; break;
case 70: switch get_integer("THE SINAI IS PART OF WHAT COUNTRY?## ISRAEL (1), MOSTLY ISRAEL (2), MOSTLY EGYPT (3), EGYPT (4)",1)
  {
    case 1: show_message("1976-79"); break;
    case 2: show_message("1980"); break;
    case 3: show_message("1981"); break;
    case 4: X(71); break;
  }; break;
case 71: switch get_integer("WHAT'S THE CAPITAL OF MICRONESIA?## KOLONIA (1), PALIKIR (2)",1)
  {
    case 1: X(72); break;
    case 2: X(73); break;
  }; break;
case 72: switch get_integer("REPUBLIC OF THE UPPER VOLTA OR BURKINA FASO?## UPPER VOLTA (1), BURKINA FASO (2)",1)
  {
    case 1: show_message("1982-84"); break;
    case 2: show_message("1985-88"); break;
  }; break;
case 73: switch get_integer("(NUMBER OF YEMENS)+(NUMBER OF GERMANYS)=?## FOUR (1), THREE (2), TWO (3)",1)
  {
    case 1: show_message("1989-EARLY 1990"); break;
    case 2: show_message("MID-1990"); break;
    case 3: show_message("LATE 1990-1991"); break;
  }; break;
case 74: switch get_integer("DOES THE SOVIET UNION EXIST?## YES (1), NO (2)",1)
  {
    case 1: X(64); break;
    case 2: X(56); break;
  }; break;
}

Numbering system

Version 1: before reordering of YES, NO options to save bytes
Version 2 (current): (reordered option numbers in black)

The options don't have to be in the order as in the image.

@corvus_192 Ah right, so I can always put YES first to avoid defining N="##NO (1), YES (2)". Thanks.

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


text:
Digital Diversity
A positive integer may be represented in an integer base \$1 \le b < \infty\$.
When converted to that base it has some number of distinct digits.
Any positive integer in base \$1\$ has \$1\$ distinct digit.
Most positive integers in base \$2\$ have \$2\$ distinct digits, the exceptions being those of the form \$2^n - 1\$, which only have \$1\$.
So the first positive integer that may be represented in an integer base with \$1\$ unique digit is \$1\$ and the first that may be represented with \$2\$ distinct digits is \$2\$.
We can say that \$1\$ is the first integer with digital diversity \$1\$ and \$2\$ is the first integer with digital diversity \$2\$.
Challenge:
Given a positive integer \$n\$ return the first positive integer (in base ten*) that has a digital diversity of \$n\$.
* if your language only supports a specific base (e.g. unary or binary) then you may output in that base.
Your algorithm must work in theory for any positive integer input: it may fail because the precision of your language's integer is too small for the output; but may not fail because base conversion is only defined up to some limit.
Test cases
input  output
   1     1
   2     2
   3     11
   4     75
   5     694
   6     8345
   7     123717
  17     49030176097150555672
  20     5271200265927977839335179
  35     31553934355853606735562426636407089783813301667210139
  63     3625251781415299613726919161860178255907794200133329465833974783321623703779312895623049180230543882191649073441
 257     87678437238928144977867204156371666030574491195943247606217411725999221158137320290311206746021269051905957869964398955543865645836750532964676103309118517901711628268617642190891105089936701834562621017362909185346834491214407969530898724148629372941508591337423558645926764610261822387781382563338079572769909101879401794746607730261119588219922573912353523976018472514396317057486257150092160745928604277707892487794747938484196105308022626085969393774316283689089561353458798878282422725100360693093282006215082783023264045094700028196975508236300153490495688610733745982183150355962887110565055971546946484175232

This is code-golf, the shortest solution in bytes wins.
OEIS: A049363 - also smallest pandigital number in base n.

Jelly, 4 bytes
ṖaWḅ

Try it online! or verify all test cases
How it works
ṖaWḅ  Main link. Argument: n

Ṗ     Pop; yield [1, 2, 3, ..., n-1].
  W   Wrap; yield [n].
 a    Logical AND; yield [n, 2, 3, ..., n-1].
   ḅ  Convert the result from base n to integer.

I forgot place values could overflow, beats my lousy 7 :)

I wish there was a rep vs bytes used chart per user on codegolf. Maybe a plot of total bytes used vs current rep.

Took me a bit to figure out why this works ... slickly done!

Python, 40 bytes
f=lambda n,k=1:n*(n<k+2)or-~f(n,k+1)*n-k

Test it on Ideone.
How it works
A number with n distinct digits must clearly be expressed in base b ≥ n. Since our goal is to minimize the number, b should also be as small as possible, so b = n is the logical choice.
That leaves us with arranging the digits 0, …, n-1 to create a number as small as possible, which means the most significant digits must be kept as small as possible. Since the first digit cannot be a 0 in the canonical representation, the smallest number is
(1)(0)(2)...(n-2)(n-1)n = nn-1 + 2nn-3 + … + (n-2)n + (n-1), which f computes recursively.

Python 2, 54 46 bytes
This is a very very very! fast, iterative solution.
n=r=input();k=2
while k<n:r=r*n+k;k+=1
print r

Try it online
There's no recursion, so it works for large input. Here's the result of n = 17000 (takes 1-2 seconds):
http://pastebin.com/UZjgvUSW

How long did input 17000 take? It takes 26 seconds on my machine, which seems slow compared to Jelly's 0.9 seconds...

Similar but other way around for three bytes less: lambda n:n**~-n+sum(i*n**(n+~i)for i in range(2,n))

46 bytes and a lot faster: n=r=input();k=2\nwhile k<n:r=r*n+k;k+=1\nprint r

Yes, it's amazing how much faster while loops are than comprehensions in Python.

@JonathanAllan That's not the reason. Computing the powers is very slow, while the loop only uses multiplication and addition.

@Dennis Ah, I didn't spot that, but while is much faster (especially if one uses a variable in place of an enumerate())

@Dennis It took about 30-32 seconds.

You can simplify a bit by shifting the index: lambda n:n**~-n+sum(n**i*(n+~i)for i in range(n-2))

@xnor That's basically what Jonathan Allan said above (kind of).

FYI - takes just over 1/2 second on my laptop (i7-3610QM@2.3GHZ)

With PyPy, I get 150 ms on my laptop.

JavaScript (ES6), 29 bytes
f=(b,n=b)=>n>2?f(b,--n)*b+n:b

J, 9 bytes
#.],2}.i.

Based on @Dennis' method.
Usage
   f =: #.],2}.i.
   (,.f"0) >: i. 7
1      1
2      2
3     11
4     75
5    694
6   8345
7 123717
   f 17x
49030176097150555672

Explanation
#.],2}.i.  Input: n
       i.  Get range, [0, 1, ..., n-1]
    2}.    Drop the first 2 values, [2, 3, ...., n-1]
  ]        Get n
   ,       Prepend it, [n, 2, 3, ..., n-1]
#.         Convert that to decimal from a list of base-n digits and return

There is an alternative solution based on using the permutation index. Given input n, create the list of digits [0, 1, ..., n], and find the permutation using an index of n!, and convert that as a list of base-n digits. The corresponding solution in J for 12 bytes
#.]{.!A.i.,]  Input: n
        i.    Make range [0, 1, ..., n-1]
           ]  Get n
          ,   Join, makes [0, 1, ..., n-1, n]
     !        Factorial of n
      A.      Permutation index using n! into [0, 1, ..., n]
  ]           Get n
   {.         Take the first n values of that permutation
              (This is to handle the case when n = 1)
#.            Convert that to decimal from a list of base-n digits and return

Could it be shorter to construct [1,0,2,3,...,n-1]?

@JonathanAllan I can't find a way, but I did notice that the permutation indices of those would be (n-1)!

Ruby, 37 35 34 bytes
->n{s=n;(2...n).map{|d|s=s*n+d};s}

The answer for a given n takes the form 10234...(n-1) in base n. Using n=10 as an example:
Start with n: 10
Multiply by n and add 2: 102
Mutliply by n and add 3: 1023
And so on.
EDIT: Shorter to use map, it seems.
EDIT 2: Thanks for the tip, m-chrzan!

(2...n) will be a byte shorter.

Haskell, 31 bytes
f n=foldl((+).(*n))n[2..n-1]

Converts the list [n,2,3,...,n-1] to base n using Horner's method via folding. A less golfed version of this is given on the OEIS page.
Thanks to nimi for 3 bytes!

I don't know Haskell too well, does the fold require the function to be named (f?) to be a valid a golf solution? (it's just f is not referenced later in the code)

@JonathanAllan The lambda function form in Haskell is \n->fold1..., which is just as long as naming it. You can write a point-free function where the input variable isn't named by combining sub-functions, but that would be awful here with three references to n.

Cool, thanks for the explanation. Haskell syntax confuses me somewhat.

You can use foldl and start with n: f n=foldl((+).(*n))n[2..n-1]

CJam, 9 bytes
ri__,2>+b

Try it online!
Explanation
ri   e# Read input N.
__   e# Make two copies.
,    e# Turn last copy into range [0 1 2 ... N-1].
2>   e# Discard up to two leading values.
+    e# Prepend a copy of N.
b    e# Treat as base-N digits.

CJam (9 bytes)
qi_,X2$tb

Online demo
Dissection
Obviously the smallest number with digital diversity n is found by base-converting  [1 0 2 3 ... n-1] in base n. However, note that the base conversion built-in doesn't require the digits to be in the range 0 .. n-1.
qi    e# Read integer from stdin
_,    e# Duplicate and built array [0 1 ... n-1]
X2$t  e# Set value at index 1 to n
b     e# Base conversion

Note that in the special case n = 1 we get 1 [0] 1 1 tb giving 1 [0 1] b which is 1.

05AB1E, 9 bytes
DL¦¨v¹*y+

Try it online!
Explanation
n = 4 used for example.
D           # duplicate input
            # STACK: 4, 4
 L          # range(1, a)
            # STACK: 4, [1,2,3,4]
  ¦¨        # remove first and last element of list
            # STACK: 4, [2,3]
    v       # for each y in list
     ¹*     # multiply current stack with input
       y+   # and add y
            # STACK, first pass: 4*4+2 = 18
            # STACK, second pass: 18*4+3 = 75

C++ -  181  55
Was about to post that real cool solution using <numeric>:
#import <vector>
#import <numeric>
using namespace std;int f(int n){vector<int> v(n+1);iota(v.begin(),v.end(),0);swap(v[0],v[1]);return accumulate(v.begin(),v.end()-1,0,[n](int r,int a){return r*n+a;});}

and then i realized it is way easier:
int g(int n){int r=n,j=2;for(;j<n;)r=r*n+j++;return r;}

Perl 6,  34 31  30 bytes
Translated from the Haskell example on the OEIS page.
{(1,0,|(2..^$^n)).reduce: $n×*+*}        # 34
{(1,0,|(2..^$^n)).reduce: $n* *+*}       # 34

{reduce $^n×*+*,1,0,|(2..^$n)}           # 31
{[[&($^n×*+*)]] 1,0,|(2..^$n)}           # 31

{reduce $_×*+*,1,0,|(2..^$_)}            # 30

[&(…)] turns … into an in-place infix operator
The […] shown above turns an infix op into a fold (left or right depending on the operator associativity)

Expanded:
{
  reduce

    # declare the blocks only parameter ｢$n｣ ( the ｢^｣ twigil )
    # declare a WhateverCode lambda that takes two args ｢*｣
    $^n × * + *

    # a list that always contains at least (1,0)
    1, 0,
    # with a range slipped in
    |(
      2 ..^ $n # range from 2 up-to and excluding ｢$n｣
               # it is empty if $n <= 2
    )
}

Usage:
my &code = {reduce $_×*+*,1,0,|(2..^$_)}

say code 1; # 1
say code 2; # 2
say code 3; # 11
say code 4; # 75
say code 7; # 123717

# let's see how long it takes to calculate a largish value:

my $start-time = now;
$_ = code 17000;
my $calc-time = now;
$_ = ~$_; # 25189207981120412047...86380901260421982999
my $display-time = now;

say "It takes only { $calc-time - $start-time } seconds to calculate 17000";
say "but { $display-time - $calc-time } seconds to stringify"

# It takes only 1.06527824 seconds to calculate 17000
# but 5.3929017 seconds to stringify

Brain-Flak, 84 76 bytes
Thanks to Wheat Wizard for golfing 8 bytes
(({})<>){(({}[()]))}{}(<{}{}>)((())){{}({<({}[()])><>({})<>}{}{})([][()])}{}

Try it online!
Explanation
The program pushes the values from 0 to n-1 to the stack replaces the top 0 and 1 with 1 and 0. Then it multiplies the top of the stack by n and adds the value below it until there is only one value remaining on the stack.
Essentially it finds the digits for the smallest number in base n that contains n different digits (for n > 1 it's always of the form 1023...(n-1)). It then calculates the number given the digits and the base.
Annotated Code
(({})<>)       # Pushes a copy of n to the right stack and switches to right stack
{(({}[()]))}{} # While the top of the stack != 0 copy the top of the stack-1
               #   and push it
(<{}{}>)       # Discard the top two values (0 and 1 for n > 1) and push 0
((()))         # Push 1 twice (second time so that the loop is works properly)
{{}            # Loop while stack height > 1
  (            #   Push...
    {<({}[()])><>({})<>}{} # The top value of the stack * n
    {}         #     Plus the value below the top of the stack
  )            #   End push
([][()])}{}    # End loop

You can replace {}{}(()(<()>))([][()]) with (<{}{}>)([(())][]) to save four bytes

You could then replace that with (<{}{}>)((())) to save four more bytes

Japt, 8 bytes
o1 hU ìU

Try it

Rockstar, 79 bytes
listen to N
cast N
X's1
let T be N
while N-X-1
let X be+1
let T be T*N+X

say T

Try it here (Code will need to be pasted in)

Mystery Link

Julia, 26 bytes
\(n,k=n)=k<3?n:n\~-k*n+~-k

Try it online!

ShapeScript, 25 bytes
_0?1'1+@2?*1?+@'2?2-*!#@#

Input is in unary, output is in decimal. Try it online!

k, 12 bytes
Based off of Dennis' answer.
{x/x,2+!x-2}

PHP, 78 Bytes
for(;$i<$a=$argn;)$s=bcadd($s,bcmul($i<2?1-$i:$i,bcpow($a,$a-1-$i++)));echo$s;

Online Version
60 Bytes works only till n=16 with the precision in the testcases
For n=144 INF
n=145 NAN
for(;$j<$a=$argn;)$t+=($j<2?1-$j:$j)*$a**($a-1-$j++);echo$t;

JavaScript (ES6), 39 bytes
Does not use =>
function f(b,n){throw f(b,n>2?--n:1)*b}

Welcome to PPCG!

Husk, 7 bytes
B¹ṙ_1tḣ

Try it online!

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


text:
Bootstrap JSF**k
In Javascript you can recover the complete language using only the symbols ()[]!+. Here's the basics:
false       =>  ![]
true        =>  !![]
undefined   =>  [][[]]
NaN         =>  +[![]]
0           =>  +[]
1           =>  +!+[]
2           =>  !+[]+!+[]
10          =>  [+!+[]]+[+[]]
Array       =>  []
Number      =>  +[]
String      =>  []+[]
Boolean     =>  ![]
Function    =>  []["filter"]
eval        =>  []["filter"]["constructor"]( CODE )()
window      =>  []["filter"]["constructor"]("return this")()

That's great and all, but where did they get those first 6 characters from? I think it's best we help them out.

Simply write a program or function that outputs (at least) the 6 characters []()!+ in any order you want, as many times as you want, with as many other characters in between as you want. Shortest code wins. Gold star if you use less than 6 unique characters to do so.

outputs (at least) Does that mean cat /dev/urandom is valid since it would eventually print []()!+?

@TùxCräftîñg well, it's not guaranteed to print all characters, but I'd say the probability is high enough :)

This challenge is extremely trivial and boring in nearly every language.

@Dennis what is unclear? Simply write a program or function that outputs (at least) the 6 characters []()!+. Shortest code wins.

Should the introduction be removed? Is it confusing?

The at least part was confusing me, since I didn't think we could actually print whatever we want as long as it includes those characters. Apparently, I was wrong.

Ah, okey. I thought it was clear enough with the at least.

@FilipHaglund I think that the introduction is fine.  You should make it clear that answers can print more than the characters in the post.  This post really shouldn't be closevoted, though.  (I do understand the downvotes, as it's a pretty boring challenge)

Downvotes explained: http://chat.stackexchange.com/transcript/message/32926385#32926385

Yeah, the plain "print this string" challenge would've been extremely boring. This is intentionally abusable. I expected people looping over ascii.

narratively, wouldn't it make more sense if we weren't allowed to use those characters in the source code? lol

Bash + iw, 6 4 bytes
iw w

Prints those six characters (and a lot more).
Output
Usage:  iw [options] command
Options:
        --debug         enable netlink debugging
        --version       show version (3.11)
Commands:
        help [command]
                Print usage for all or a specific command, e.g.
                "help wowlan" or "help wowlan enable".
        event [-t] [-r] [-f]
                Monitor events from the kernel.
                -t - print timestamp
                -r - print relative timstamp
                -f - print full frame for auth/assoc etc.
        features

        commands
                list all known commands and their decimal & hex value
        phy
        list
                List all wireless devices and their capabilities.
        phy <phyname> info
                Show capabilities for the specified wireless device.
        dev
                List all network interfaces for wireless hardware.
        dev <devname> info
                Show information for this interface.
        dev <devname> del
                Remove this virtual interface
        dev <devname> interface add <name> type <type> [mesh_id <meshid>] [4addr on|off] [flags <flag>*]
        phy <phyname> interface add <name> type <type> [mesh_id <meshid>] [4addr on|off] [flags <flag>*]
                Add a new virtual interface with the given configuration.
                Valid interface types are: managed, ibss, monitor, mesh, wds.

                The flags are only used for monitor interfaces, valid flags are:
                none:     no special flags
                fcsfail:  show frames with FCS errors
                control:  show control frames
                otherbss: show frames from other BSSes
                cook:     use cooked mode
                active:   use active mode (ACK incoming unicast packets)

                The mesh_id is used only for mesh mode.
        dev <devname> ibss join <SSID> <freq in MHz> [HT20|HT40+|HT40-|NOHT] [fixed-freq] [<fixed bssid>] [beacon-interval <TU>] [basic-rates <rate in Mbps,rate2,...>] [mcast-rate <rate in Mbps>] [key d:0:abcde]
                Join the IBSS cell with the given SSID, if it doesn't exist create
                it on the given frequency. When fixed frequency is requested, don't
                join/create a cell on a different frequency. When a fixed BSSID is
                requested use that BSSID and do not adopt another cell's BSSID even
                if it has higher TSF and the same SSID. If an IBSS is created, create
                it with the specified basic-rates, multicast-rate and beacon-interval.
        dev <devname> ibss leave
                Leave the current IBSS cell.
        dev <devname> station dump
                List all stations known, e.g. the AP on managed interfaces
        dev <devname> station set <MAC address> mesh_power_mode <active|light|deep>
                Set link-specific mesh power mode for this station
        dev <devname> station set <MAC address> vlan <ifindex>
                Set an AP VLAN for this station.
        dev <devname> station set <MAC address> plink_action <open|block>
                Set mesh peer link action for this station (peer).
        dev <devname> station del <MAC address>
                Remove the given station entry (use with caution!)
        dev <devname> station get <MAC address>
                Get information for a specific station.
        dev <devname> survey dump
                List all gathered channel survey data
        dev <devname> mesh leave
                Leave a mesh.
        dev <devname> mesh join <mesh ID> [mcast-rate <rate in Mbps>] [beacon-interval <time in TUs>] [dtim-period <value>] [vendor_sync on|off] [<param>=<value>]*
                Join a mesh with the given mesh ID with mcast-rate and mesh parameters.
        dev <devname> mpath dump
                List known mesh paths.
        dev <devname> mpath set <destination MAC address> next_hop <next hop MAC address>
                Set an existing mesh path's next hop.
        dev <devname> mpath new <destination MAC address> next_hop <next hop MAC address>
                Create a new mesh path (instead of relying on automatic discovery).
        dev <devname> mpath del <MAC address>
                Remove the mesh path to the given node.
        dev <devname> mpath get <MAC address>
                Get information on mesh path to the given node.
        dev <devname> scan [-u] [freq <freq>*] [ies <hex as 00:11:..>] [meshid <meshid>] [lowpri,flush,ap-force] [ssid <ssid>*|passive]
                Scan on the given frequencies and probe for the given SSIDs
                (or wildcard if not given) unless passive scanning is requested.
                If -u is specified print unknown data in the scan results.
                Specified (vendor) IEs must be well-formed.
        dev <devname> scan trigger [freq <freq>*] [ies <hex as 00:11:..>] [meshid <meshid>] [lowpri,flush,ap-force] [ssid <ssid>*|passive]
                Trigger a scan on the given frequencies with probing for the given
                SSIDs (or wildcard if not given) unless passive scanning is requested.
        dev <devname> scan dump [-u]
                Dump the current scan results. If -u is specified, print unknown
                data in scan results.
        reg get
                Print out the kernel's current regulatory domain information.
        reg set <ISO/IEC 3166-1 alpha2>
                Notify the kernel about the current regulatory domain.
        dev <devname> auth <SSID> <bssid> <type:open|shared> <freq in MHz> [key 0:abcde d:1:6162636465]
                Authenticate with the given network.

        dev <devname> connect [-w] <SSID> [<freq in MHz>] [<bssid>] [key 0:abcde d:1:6162636465]
                Join the network with the given SSID (and frequency, BSSID).
                With -w, wait for the connect to finish or fail.
        dev <devname> disconnect
                Disconnect from the current network.
        dev <devname> link
                Print information about the current link, if any.
        dev <devname> offchannel <freq> <duration>
                Leave operating channel and go to the given channel for a while.
        dev <devname> cqm rssi <threshold|off> [<hysteresis>]
                Set connection quality monitor RSSI threshold.

        phy <phyname> wowlan show
                Show WoWLAN status.
        phy <phyname> wowlan disable
                Disable WoWLAN.
        phy <phyname> wowlan enable [any] [disconnect] [magic-packet] [gtk-rekey-failure] [eap-identity-request] [4way-handshake] [rfkill-release] [tcp <config-file>] [patterns [offset1+]<pattern1> ...]
                Enable WoWLAN with the given triggers.
                Each pattern is given as a bytestring with '-' in places where any byte
                may be present, e.g. 00:11:22:-:44 will match 00:11:22:33:44 and
                00:11:22:33:ff:44 etc.
                Offset and pattern should be separated by '+', e.g. 18+43:34:00:12 will match '43:34:00:12' after 18 bytes of offset in Rx packet.

                The TCP configuration file contains:
                  source=ip[:port]
                  dest=ip:port@mac
                  data=<hex data packet>
                  data.interval=seconds
                  [wake=<hex packet with masked out bytes indicated by '-'>]
                  [data.seq=len,offset[,start]]
                  [data.tok=len,offset,<token stream>]
        phy <phyname> coalesce show
                Show coalesce status.
        phy <phyname> coalesce disable
                Disable coalesce.
        phy <phyname> coalesce enable <config-file>
                Enable coalesce with given configuration.
                The configuration file contains coalesce rules:
                  delay=<delay>
                  condition=<condition>
                  patterns=<[offset1+]<pattern1>,<[offset2+]<pattern2>,...>
                  delay=<delay>
                  condition=<condition>
                  patterns=<[offset1+]<pattern1>,<[offset2+]<pattern2>,...>
                  ...
                delay: maximum coalescing delay in msec.
                condition: 1/0 i.e. 'not match'/'match' the patterns
                patterns: each pattern is given as a bytestring with '-' in
                places where any byte may be present, e.g. 00:11:22:-:44 will
                match 00:11:22:33:44 and 00:11:22:33:ff:44 etc. Offset and
                pattern should be separated by '+', e.g. 18+43:34:00:12 will
                match '43:34:00:12' after 18 bytes of offset in Rx packet.

        dev <devname> roc start <freq> <time in ms>

        wdev <idx> p2p stop

        wdev <idx> p2p start

        phy <phyname> set antenna <bitmap> | all | <tx bitmap> <rx bitmap>
                Set a bitmap of allowed antennas to use for TX and RX.
                The driver may reject antenna configurations it cannot support.
        dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>]
                Specify transmit power level and setting type.
        phy <phyname> set txpower <auto|fixed|limit> [<tx power in mBm>]
                Specify transmit power level and setting type.
        phy <phyname> set distance <distance>
                Set appropriate coverage class for given link distance in meters.
                Valid values: 0 - 114750
        phy <phyname> set coverage <coverage class>
                Set coverage class (1 for every 3 usec of air propagation time).
                Valid values: 0 - 255.
        phy <phyname> set netns <pid>
                Put this wireless device into a different network namespace
        phy <phyname> set rts <rts threshold|off>
                Set rts threshold.
        phy <phyname> set frag <fragmentation threshold|off>
                Set fragmentation threshold.
        dev <devname> set channel <channel> [HT20|HT40+|HT40-]
        phy <phyname> set channel <channel> [HT20|HT40+|HT40-]
        dev <devname> set freq <freq> [HT20|HT40+|HT40-]
        dev <devname> set freq <control freq> [20|40|80|80+80|160] [<center freq 1>] [<center freq 2>]
        phy <phyname> set freq <freq> [HT20|HT40+|HT40-]
                Set frequency/channel the hardware is using, including HT
                configuration.
        phy <phyname> set name <new name>
                Rename this wireless device.
        dev <devname> set mcast_rate <rate in Mbps>
                Set the multicast bitrate.
        dev <devname> set peer <MAC address>
                Set interface WDS peer.
        dev <devname> set noack_map <map>
                Set the NoAck map for the TIDs. (0x0009 = BE, 0x0006 = BK, 0x0030 = VI, 0x00C0 = VO)
        dev <devname> set 4addr <on|off>
                Set interface 4addr (WDS) mode.
        dev <devname> set type <type>
                Set interface type/mode.
                Valid interface types are: managed, ibss, monitor, mesh, wds.
        dev <devname> set meshid <meshid>
        dev <devname> set monitor <flag>*
                Set monitor flags. Valid flags are:
                none:     no special flags
                fcsfail:  show frames with FCS errors
                control:  show control frames
                otherbss: show frames from other BSSes
                cook:     use cooked mode
                active:   use active mode (ACK incoming unicast packets)
        dev <devname> set mesh_param <param>=<value> [<param>=<value>]*
                Set mesh parameter (run command without any to see available ones).
        dev <devname> set power_save <on|off>
                Set power save state to on or off.
        dev <devname> set bitrates [legacy-<2.4|5> <legacy rate in Mbps>*] [mcs-<2.4|5> <MCS index>*]
                Sets up the specified rate masks.
                Not passing any arguments would clear the existing mask (if any).
        dev <devname> get mesh_param [<param>]
                Retrieve mesh parameter (run command without any to see available ones).
        dev <devname> get power_save <param>
                Retrieve power save state.
Commands that use the netdev ('dev') can also be given the
'wdev' instead to identify the device.
You can omit the 'phy' or 'dev' if the identification is unique,
e.g. "iw wlan0 info" or "iw phy0 info". (Don't when scripting.)
Do NOT screenscrape this tool, we don't consider its output stable.

GS2, 1 byte
Code:
ç

Try it online!

Brain-Flak, 42 40 + 3 = 43 bytes
Try it online
((((((()()()){}){}){}){}){}){(({})[()])}

It pushes 96 and loops through pushing every number smaller than 96.  This requires the -A flag to run.
I suppose I get the "gold star" for what it's worth

42 + 3 = 47? :P

40 + 3 == 45? :P

Brainfuck, 5 bytes
+[+.]

Try it online!
Explanation
Increments the byte under the data pointer, then loops while the byte under the data pointer is not zero (until the value overflows and gets back to zero), incrementing and printing the value.

Gold star! Only 3 kinds of characters!

Jelly, 3 bytes
³RỌ

Try it online!

Sh, 16 12 bytes
cat /dev/mem

Since you visited this page, /dev/mem must contain []()!+, and anyway statistics says your RAM must contains the characters []()!+

On x86 /dev/mem can only access memory mapped PCI regions, not RAM.

@DmitryKudriavtsev Oh :/

@DmitryKudriavtsev But this don't change the fact the probability that the characters are in /dev/mem are very very high

CJam, 3 bytes
'^,

Try it online!
Prints all ASCII up to and including ].

Pyke, 2 bytes
~a

Try it here!
Prints every char in range(0, 255)

Perl 6, 12 bytes
put '!'..']'

put '[]()!+'

'[]()!+'.say

say ['()!+']

I think it is fairly conclusive that the minimum is 12 bytes.

Y, 12 bytes
∅O("[]()!+")

Outputs []()!+

Python 2, 13 bytes
print'[]()!+'

Prints []()!+

Powershell, 10 different chars, 15 bytes
[char[]](1..99)

Explanation:
[char[]](1..1000)
        (x .. y)  #Range x y
[      ]          #Cast to
 char[]           #char array
                  #implict output(arrays are seperated by \n

Don't put this in a file. Because then the implict output doesn't work!

It's significantly shorter to just output the characters as-is -- '()[]!+'. However, if output via STDERR is allowed (it's usually not), you can do something like !i, which will output an error message containing the required characters.

05AB1E, 2 bytes
žQ

Try it online!
Pushes the printable ASCII stack and implicitly prints it. The printable ASCII character set includes the JSFk characters.

Text, 6 bytes
[]()!+

The challenge is quite uninteresting, so I made a quite uninteresting answer.
Also works in (Try It Online)
PHP, ///, ReRegex, Canvas, Chain, ink, Charcoal, Corea, M4, and a lot more...