text:
{Curly Numbers};
In the esoteric programming language Curly, programs consist solely of curly braces {} and semicolons ;. Despite this humble toolset, Curly has literals that can represent any nonnegative integer. The format is a little hard for the uninitiated to read, though, so let's write some code to do the conversion for us.
Format of numbers
Curly numbers are structured according to the following rules:

Adding a semicolon adds one to the number.
A number enclosed in curly braces is multiplied by four.
Curly-brace groups may be nested but not concatenated. Braces must match properly.
Semicolons outside a set of curly braces must come afterward, not before.
To avoid ambiguity in parsing, a number must always start with a curly brace.

Some examples:
{;;}     2*4 = 8
{{;};};  (1*4+1)*4+1 = 21
{};;;    0*4+3 = 3

(Note that rule 5 means the numbers 0 to 3 must start with an empty pair of curly braces.)
And some invalid examples:
{{;}{;;}}  Curly brace groups side-by-side, not nested
{;}}       Unmatched brace
{;{;}}     Semicolon before curly-brace group
;;;        Number does not start with curly brace

Here's a BNF grammar for Curly numbers:
<number> ::= "{" <inner> "}" <semis>
<inner>  ::= <semis>
           | <number>
<semis>  ::= ";" <semis>
           | ""

Numbers like {;;;;} (more than 3 semicolons in a row) or {{};} (unnecessary empty brace groups) are called improper Curly numbers. They obey the above grammar and can be evaluated in the usual way, but they are also capable of shorter representations (for the above examples, {{;}} and {;} respectively).
The challenge
Write a program or function that inputs/receives a string. If the string is a nonnegative decimal integer, output/return the proper (i.e. shortest possible) Curly representation for that integer. If the string is a Curly number, output/return its decimal representation.
Input can be received via STDIN, command-line argument, or function parameter. It must be a string; that is, you may not write a function that accepts strings for Curly numbers but integers for decimal numbers.
Output can be printed to STDOUT or returned from the function. A function may return an integer when appropriate, or it may return strings in all situations.
Your program does not have to handle bad input (Curly numbers that break the formatting rules, floating point numbers, negative integers, random text), and it is not required to handle improper Curly numbers (but see below). Input will consist only of printable ASCII characters.
Scoring
The shortest code in bytes wins. If your program can do both of the following:

correctly handle improper Curly numbers, and
when given a Curly number, ignore any extra characters that aren't {};

then subtract 10% from your score. (Integer input will never have extraneous characters, even for the bonus.)
Test cases
Input       Output
{;;}        8
{{;};};     21
{};;;       3
{{{{;}}};}  260
{}          0
4           {;}
17          {{;}};
1           {};
0           {}
96          {{{;};;}}

For the bonus:
{};;;;;     5
{{;;;;};;}  72
c{u;r;l}y;! 9
42{;} ;;;;  8

Note: Curly is not yet implemented. But if this question does well, I may develop it further.

how it should handle case if you have not matching number of parenthesis ? or shall i assume it will never happened?

@user902383 You can assume that non-matching curly braces will never happen.

I was going to make a Retina solution, but after making it handle a Curly string (only 20 bytes), I realized it also needs to handle positive integers -> Curly, so I gave up.

@DLosc Yeah, it wouldn't win, so I'm not going to spend the time.

@mbomb007 I meant on this question specifically, where the Pyth solution is already 22% shorter than the shortest CJam solution and qualifies for the bonus. Anyway, it was a rhetorical question attempting to say, "No, but it could still be fun and garner some upvotes." If you disagree with the "fun" part, though, that's fine.

How should the answers with the bonus handle improper curly numbers, i.e. ;;;?

@EasterlyIrk ;;; is an invalid Curly number (i.e. incorrect syntax, not just suboptimal length), and thus doesn't need to be handled.

Pyth, 35 32 bytes - 10% = 28.8
.x.U+jb`HZ*R\;.[Z2jsz4i/R\;cz\}4

Try it online: Demonstration or Test Suite
edit: As it turned out, I accidentally can also handle improper Curly Numbers. Wasn't planned at all. ;-)
Explanation:
There are two expressions in the code. The first one converts a number into a Curly Number, and the second one converts a Curly Number into a regular number. .x handles, which expression gets printed. It will try to print the first expression. If there are any non-digits in the input, the first expression fails (via Exception). .x catches the Exception and prints the second one.
.U+jb`HZ*R\;.[Z2jsz4   # number to Curly Number
                 sz    read the input and converts it to an int
                j  4   convert to base 4
            .[Z2       pad zeros on the left, until length is >= 2
        *R\;           convert each digit to ";"s
                       lets call this list of ";"s Y
.U                     reduce this list, start with b=Y[0],
                       Z iterates over Y[1], Y[2], ...,
                       update b in each step with:
   jb`H                   put b into curly brackets
  +    Z                  and append Z

i/R\;cz\}4             # Curly Number to regular number
     cz\}              split the input by "}"
 /R\;                  count the ";"s in each string
i        4             convert this list from base 4 to base 10

Fastest gun in the west :( I had this exact solution except I had forgotten that the .[Z2 was necessary.

CJam, 51 47 44 41 bytes
r_'{-_@={i4bYUe[';f*{{}s@*\+}*}{'}/:,4b}?

Try it online: sample run | test suite
How it works
r        e# Read a token from STDIN.
_'{-     e# Remove all left curly brackets from a copy of the token.
_@       e# Copy the modified token and rotate the original on top of it.
=        e# Check for equality.
{        e# If the strings were equal:
  i4b    e#   Convert to integer, then to base 4.
  YUe[   e#   Left-pad the resulting array with zeroes to a length of 2.
  ';f*   e#   Replace each digit with that many semicolons.
  {      e#   For each string of semicolons but the first:
    {}s  e#     Push the string "{}".
    @    e#     Rotate the first string or the result of the previous
         e#     iteration on top of the stack.
    *    e#     Join, i.e., surround the string with curly brackets.
    \+   e#     Append the current string of semicolons to the result.
  }*     e#
}{       e# Else:
  '}/    e#   Split the modified input at right curly brackets.
  :,     e#   Replace each run of 0 to 3 semicolons by its length.
  4b     e#   Convert from base 4 to integer.
}?       e#

Python 2, 167 bytes - 10% = 150.3
d=lambda x:("{"+d(x//4)+"}"if x>3 else"")+";"*(x%4)
c=lambda n:"{}"*(int(n)<4)+d(int(n))if n.isdigit()else reduce(lambda x,y:x*4+y,[x.count(";")for x in n.split("}")])

In this implementation, c is the function that satisfies the requirements. It returns a string if given an nonnegative integer as input, or an integer if given a curly number as input.

Python 266 bytes - 10% = 1268.1 326.7 239.4 bytes
Boy am I not a code golfer yet =/, but that 10% helped me out a lot when my score was still over 1000!
I have a fully fleshed out (and verbose) version of this code here. It will recognize the validity of curly numbers, and provide a looped interface to enter numbers for testing.
(Comments just for clarification)
See this code in action
def c(t):                           # curly to int function
 v=0                                #  int value of input
 for a in t:                        #  for each character of input
  if a==';':v+=1                    #   if you find a ';', add one to total
  if a=='}':v*=4                    #   if you find a '}', multiply total by 4
 print v                            #  print value
def i(t):                           # int to curly function
 v=int(t);f,b="{}"if v<4 else"",""  #  get integer value. initialize front (f) and back (b) strings
 while 1:                           #  loop until stopped
  r,v=v%4,int(v/4)                  #   get remainder of v/4 and int value of v/4
  if r>0:b=';'*r+b                  #   if remainder exists, prepend that many ';' to back string
  if v>0:f=f+'{';b='}'+b            #   if remaining value > 4, append '{' to front and prepend '}' to back
  if v<4:b=';'*v+b;break            #   if remaining value < 4, prepend that many ';' to back string and break
 print f+b                          #  print result
t=raw_input()                       # get raw input
try:int(t);i(t)                     # use try block to determine which function to call
except:c(t)                         #

Thanks to Erik Konstantopoulos for a major byte reduction! You could say... he really took a... byte... out of my code... *self five*

Welcome to PPCG! Your code contains a lot of unrequired print statements and a comment, your variable names are too long and some whitespace can be eliminated. I also recommend reading Tips for golfing in Pyrhon.

Great resource, thanks! I'll make the appropriate changes to this code and see how far it gets me. Looks like if I want to be anybody on this site, I either need to learn CJam or Pyth, or write my own language lol.

@iAmMortos Not necessarily. Do if you find it enjoyable, or stick with Python if not. :)

Usually, golfing is done in three steps: 1) make your program like you would do normally, as minimal as possible (i.e., no debug statements, no need to handle invalid input, minimal output) 2) remove as much as possible: whitespace, rename variables (value to v etc), 3) do clever golfing stuff: this is the point where you need to look at Dennis' link. I'm curious to see how much you can cut this down!

Never have I received such a warm welcome on a community. lol, I think I like it here.

@ErikKonstantopoulos Your version doesn't work, actually. At least not exactly how it is. In your line: v,f,b=int(t),"{}"if v<4 else"","", v is referenced before it is used. Pretty much all the other changes can be kept though.

@iAmMortos I updated it! Also, it's 1 byte less!

CJam, 87 bytes 80.1 score (89 bytes - 10% bonus)
Update version that qualifies for the bonus while growing by 2 bytes:
l_'{#){VX@{";{}"#)" _@+\ 4* 4/"S/=~}/;}{i_4<{"{}"\';*}{{4md\_{F'{\+'}+}{;L}?\';*+}:F~}?}?

Try it online
First time I used recursion in CJam! The whole thing may look kind of lengthy, but the two completely separate conversions add up.
I used a completely separate case for converting numbers smaller than 4 to Curly. It's probably possible to avoid that, but folding the special case handling into the recursive function wouldn't be entirely trivial. And adding the extra {} as a post-processing step didn't really look any better, even though I should try again if it might be slightly shorter.

Wouldn't your score be 80.1?

@Pietu1998 Thanks. Not only are my solutions too long, apparently I also fail at basic arithmetic...

C#, 173 - 10% = 155.7 171.0, 177.3
This does no validation and only looks for ; and } characters.  It assumes all { characters come before any ; characters.  The hardest thing I found was to not insert a {} in the middle of a Curly number.
Line breaks and indents for clarity:
string C(string a,int b=0){
    int n;
    if(int.TryParse(a,out n))
        a=(n>=b?"{"+C(""+n/4,4)+"}":"")+";;;".Remove(n%4);
    else
        foreach(int c in a)
            a=""+(c==59?++n:c==125?n*=4:n);
    return a;
}

You can save one Byte by using var instead of char in the foreach loops.

@DLosc, sorry, I was confused by bonus #1.  I though that applied to output rather than input.

Java 326 bytes - 10% = 294 bytes
It is complete program written in java,
public class a{static String c(long a,int v){if(a==0)return v==0?"{}":"";String x="";for(int i=0;ib==';'?a+1:b=='}'?a*4:a));}}}

I'm sure it can be much shorter but i cant have much time now to optimize it

@DLosc damn, right, and thought i can have a nice result with java:(

also: common optimisation on java is to avoid the public  before class

replace the public static void main(String[]c){ with static{

GNU sed, 330 326 - 10% = 293.4
(I added one for the use of -r before claiming the bonus 10%; I hope that's correct)
/;/{
s/[^};]//g
:c
s/(;*)\}/\1\1\1\1/
tc
:d
/;/{
s/;;;;;/v/g
s/vv/x/g
/[;v]/!s/\b/0/2
s/;;/b/g
s/bb/4/
s/b;/3/
s/v;/6/
s/vb/7/
s/v3/8/
s/v4/9/
y/;bvx/125;/
td
}
n
}
:u
s/\b9/;8/
s/\b8/;7/
s/\b7/;6/
s/\b6/;5/
s/\b5/;4/
s/\b4/;3/
s/\b3/;2/
s/\b2/;1/
s/\b1/;0/
s/\b0//
/[^;]/s/;/&&&&&&&&&&/g
tu
:v
s/;;;;/v/g
s/v+/{&}/
y/v/;/
tv

The full version shows that most of the above is conversion between decimal and unary:
#!/bin/sed -rf

/;/{

# Delete non-Curly characters
s/[^};]//g

# Curly to unary
:c
s/(;*)\}/\1\1\1\1/
tc

# unary to decimal
:d
/;/{
s/;;;;;/v/g
s/vv/x/g
/[;v]/!s/\b/0/2
s/;;/b/g
s/bb/4/
s/b;/3/
s/v;/6/
s/vb/7/
s/v3/8/
s/v4/9/
y/;bvx/125;/
td
}

# done
n

}

# Decimal to unary
:u
s/\b9/;8/
s/\b8/;7/
s/\b7/;6/
s/\b6/;5/
s/\b5/;4/
s/\b4/;3/
s/\b3/;2/
s/\b2/;1/
s/\b1/;0/
s/\b0//
/[^;]/s/;/&&&&&&&&&&/g
tu

# Unary to Curly
:v
s/;;;;/v/g
s/v+/{&}/
y/v/;/
tv

Unfortunately, this question explicitly says decimal is required, which is why I bothered converting.

You're right, which is a bit astonishing to me since excluding unary wasn't my intention. Oh well, guess it's too late to change the question now. I reaffirm my +1, sir.

Perl, 183 177
This might not be the shortest Perl answer, but I think it's interesting enough to post (input in $_, output as return value):
sub f{if(/}/){s/[{}]/00/g;oct'0b'.s/00(;+)/sprintf'%02b',length$1/ger}else{$_=sprintf'%064b',$_;s/../oct"0b$&"/ge;s/^0+(?!$)//;$_='{'x length.$_;s/\d/'}'.';'x$&/ge;s/\Q{{}/{/r}}
We observe that Curly is simply quaternary (base-4) notation.  We're slightly hampered by Perl's lack of native support for quaternary, but luckily, each quaternit is two bits in binary, and we can read and write binary.  So we have the following:

Curly to decimal: convert each Curly digit to 2 binary digits, concatenate and convert to decimal
Decimal to Curly: print the number in binary (forcing an even number of digits), then convert each bit-pair to Curly.

Expanded version
sub f
{
    if (/}/) {
        s/[{}]/00/g;     # digits are now 00 00; 00;; 00;;;
                         # and opening braces become harmless leading zeros
        s/00(;+)/sprintf'%02b',length $1/ge;
                         # convert semicolons to binary, leaving zeros alone
        oct "0b$_"       # now to decimal
    } else {
        $_=sprintf'%064b',$_;   # decimal to binary
        s/../oct"0b$&"/ge;      # bit-pair to quaternit
        s/^0+(?!$)//;           #/remove leading zeros
        $_='{'x length.$_;      # prefix enough opening braces
        s/\d/'}'.';'x$&/ge;     #/digit to semicolons
        s/{{}/{/r               # first empty brace, unless $_ <= {};;;
    }
}

Perl 5, 154 (185 170 Bytes - 10% + 1 Penalty)
$e=$/;if($_=~/{/){s/[^{};]//g;s/;/+1/g;s/{/+4*(/g;s/}/+0)/g;$b=eval}else{$r=$_;$b=$r<4?"{}":"";while($r>0){if($r%4>0){$r--;$e=";$e"}else{$b.="{";$e="}$e";$r/=4}}}$_=$b.$e

Regex & eval resolve the curlies.
The generation of the curlies is done differently.
Test
Test file contains also the bonus cases
$ cat curlytestcases.txt
{}
{};
{};;
{};;;
{;;}
{{;};};
{{{{;}}};}
0
1
2
3
4
17
96
{};;;;;
42{;} ;;;;
c{u;r;l}y;!
{{;;;;};;}

$ cat curlytestcases.txt |perl -p curlies.pl
0
1
2
3
8
21
260
{}
{};
{};;
{};;;
{;}
{{;}};
{{{;};;}}
5
8
9
72

Added the -1 penalty for -p.  The $b=$r<2?"{}":""; was added for the exception of 0 & 1. {};;; is the input in the test.

Needed some time to test it. It's fixed now. :)

I think the +1 penalty comes after -10% bonus.

Interesting observation. Not sure if that's now it should be, but it makes sense so I changed it anyway. Not that it changes the end score.

JavaScript (ES6), 95 (105-10%)
f=(n,r='{}')=>-1-n?(n>3?'{'+f(n>>2,'')+'}':r)+';'.repeat(n&3):n.replace(/[;}]/g,c=>c>';'?n*=4:++n,n=0)&&n

Test running the snippet below

f=(n,r='{}')=>-1-n?(n>3?'{'+f(n>>2,'')+'}':r)+';'.repeat(n&3)
:n.replace(/[;}]/g,c=>c>';'?n*=4:++n,n=0)&&n

// Test
function out(x) { O.innerHTML=x+'\n'+O.innerHTML; }

function go() { out(I.value + ' --> ' + f(I.value)) }

;[
  ['{;;}', 8]
, ['{{;};};', 21 ]
, ['{};;;', 3 ]
, ['{{{{;}}};}', 260 ]
, ['{}', 0 ]
, [ 4, '{;}' ]
, [ 17, '{{;}};' ]
, [ 1,'{};' ]
, [ 0, '{}' ]
, [ 96, '{{{;};;}}' ]
, ['{};;;;;', 5 ]
, ['{{;;;;};;}' , 72 ]
, ['c{u;r;l}y;!', 9 ]
, ['42{;} ;;;;', 8 ]
].forEach(t => {
  r=f(t[0])
  k=t[1]
  out('Test ' +(r==k?'OK':'Fail')+'\nInput:  '+t[0]+'\nResult: '+r+'\nCheck:  '+k+'\n')
})
Custom test <input id=I><button onclick='go()'>-></button>

Could you please post your actual code? Also, your score is 94.5.

@ErikKonstantopoulos my actual code was posted at top of the test snippet. Now it is at top of the answer too. About the score (that should be in bytes), I always feel funny measuring half (or less) byte and prefer rouniding up

edc65: Yeah, but rounding up is bad for you! 94.5<95 thus smaller score, which means that it probably beats more submissions. Also, the "top of the snippet" is not the place to show your code.

Ruby, 126.9 129.6 (144 - 10%)
Uses recursion to convert decimal into curly form. Removing the check for ignoring characters outside of /[;{}]/ increases the score by 0.4 at the moment.
f=->s{s=~/^\d+$/?(n=s.to_i
"{#{n<1?'':f[(n/4).to_s].gsub('{}','')}}#{?;*(n%4)}"):eval(s.tr("^{;}","").gsub(/./){|c|c<?A?"+1":c>?|?")*4":"+(0"})}

It's fixed now. Thanks for reporting the bug; score has been updated.

Retina, 69 64 bytes
+`{(;*)}
$1$1$1$1
^\d+|^(;*)
$*;$.1
+`(;+)\1\1\1
{$1}
^;|^$
{}$&

Try Test Suite

Explanation
+`{(;*)}
$1$1$1$1

Decompose the innermost braces to just ;s. Loop until no more braces.
^\d+|^(;*)
$*;$.1

Convert between decimal and unary ;
+`(;+)\1\1\1
{$1}

Find the longest run of ; that is a multiple of 4 and nest into braces, loop until no more runs of 4+ exist.
^;|^$
{}$&

If the resulting curly number begins with ; or is empty string, add {} in front.

Python 2, 157 bytes -10% = 141.3
lambda n:'{}'*(int(n)<4)+g(int(n))if n.isdigit()else sum((v==';')*4**n.count('}',i)for i,v in enumerate(n))
g=lambda n:'{%s}'%g(n/4)+';'*(n%4)if n>3else';'*n

Try it online!
A more golfed Python 2 answer that handles the bonus cases.  Didn't want to necro dead posts with this as a comment, so here it is.
It works from the inside in on curly numbers, adding 4^(the number of end curly brackets left in the string) to the sum for each semicolon found.  If the string is a number, then it recursively creates the curly number in the same way as the grammar provided.

That's awkward.  I even had test cases in there for numbers less than 2.  Fixed for +5 bytes total.

@DLosc I swear I'm normally not this bad.  Fixed, and golfed a bit to make it a bit more competitive.


text:
Where did you COME FROM?
INTERCAL is a wonderful language, but it is not always easy to understand other people's code. This is particularly the case if they use the COME FROM statement.

Challenge definition

Write a program or function which take the source code of an INTERCAL program as a text/data stream. If you write a function it is recommended that you also provide a program to call the function, but it will not count towards your score.
The function output will be a text/data stream of the jumps that program makes, according to the following instructions. The output does not need to be printed, but it does need to be a single text, not an array of strings (for example).
Each line of output will consist of the statement which will be COME FROM and the line number of its COME FROM statement, separated by a ->. An example:
(310)   DO .4 <- .3 -> 55

You can trim these lines of source code, but it is not necessary to.
The test cases will only consist of noncomputed labels (i.e., integer labels).
The output must be sorted by the source code order of the statements which will be COME FROM, not their label, nor the order of the COME FROM statements or their labels.
It is possible for multiple statements to COME FROM the same label. In such cases the COME FROM line numbers must be sorted, and separated by commas.
It is possible for a statement to COME FROM itself.
A COME FROM statement may be prefixed with a NOT statement. In such cases the line number must be wrapped in square brackets.
The words COME FROM can appear in a comment and must be ignored. You do not need to fully parse the file: if they are followed by a label (a number in parentheses) then you can assume it is a real statement.

Scoring
Entrants will be scored by the character length of their program or function.
Test cases
These test cases all come from the calvinmetcalf/intercal Github repo. Although any useful application will safely accept any input, for the purposes of this challenge you need only account for these five test cases.
rot13.i
(10) PLEASE DON'T GIVE UP -> 87
(33) DON'T GIVE UP -> 92

primes.i
(15)    DO (13) NEXT -> 26
(16)    DO .12 <- .1 -> 6
(23)    DO (21) NEXT -> 3

unlambda.i
(7202)  DO RETRIEVE .203+,202 -> 75
(4202)  DO ,202SUB.201.202#7 <- ,201SUB.201.202#7 -> 108
(6202)  DO ,201SUB.201.202#7 <- ,202SUB.201.202#7 -> 117
(4203)  DO READ OUT ,201SUB.201.202#7 -> 133
(4302)  DO .302 <- .2 -> 181
(5410)  DO ,400SUB#124 <- #4 $ #17 -> 293
(3410)  PLEASE (4410) NEXT -> 288
(5402)  DO (412) NEXT -> 328
(4412)  PLEASE (3412) NEXT -> 334
(3423)  DO FORGET #2 -> 375
(4404)  DO RETRIEVE .311+.312 -> 411
(5404)  PLEASE DO (414) NEXT -> 430
(4434)  DO FORGET #1 -> 441
(3454)  DO (103) NEXT -> 451
(5502)  DO .512 <- .312 -> 520
(8503)  PLEASE RETRIEVE .311+.312 -> 621
(7503)  DO (302) NEXT -> 515
(3622)  DO (302) NEXT -> 514
(603)   PLEASE FORGET #2 -> 622

pass.i
(10)    DO  NOTHING -> 5, 11
(20)    PLEASE  (100) NEXT -> 6
(30)    PLEASE  (200) NEXT -> 12
(103)   DO  (104) NEXT -> 27
(104)   DO  (105) NEXT -> 19
(1) DO  (2) NEXT -> 36
(2) DO  (105) NEXT -> 194
(202)   DO NOT  .2 <- #2 AGAIN -> [196]
(203)   DO  (204) NEXT -> 167
(204)   DO  (205) NEXT -> 159

continuation.i
(8201)  DO NOTHING -> 165, 271
(8202)  PLEASE NOTE Fork threads, one dormant, one alive -> 53, 58
(8211)  DO COME FROM (8211) -> 60
(8216)  DO NOTHING -> 71
(8215)  DO NOTHING -> 68
(8217)  DO COME FROM (8217) AGAIN -> 118
(8299)  DO COME FROM (8299) AGAIN -> 141
(8274)  DO (8273) NEXT ONCE -> 158
(8259)  PLEASE DO NOTHING -> 166
(8276)  DO COME FROM (8276) AGAIN -> 199
(8278)  PLEASE DO COME FROM (8278) AGAIN -> 237

It baffles me that no one made a Cotton Eyed Joe reference yet :-).

INTERCAL is a wonderful language downvoted for offensive language.

Are you sure yout want to score by characters length? Challenges are usually scored by bytes length here.

@Fatalize I thought about it both ways. The common advantages of character scoring like encoding large numbers as unicode characters probably won't be useful, but I thought that if someone can take advantage of the scoring I'd be interested to see what they can do.

Can we assume that the label is at the start of a line? Such that ^(\d+) grabs the label?

@orlp Make sure you can pass all the test cases, but kudos if you can make it safer in general.

@curiousdannii Also, do we have to protect against a comment that says COME FROM (NaN) or COME FROM (HELLOWORLD) or COME FROM (10 LETS NOT MATCH BRACKETS?

@orlp No the test cases are all safe. I'll edit it to clarify that for the purposes of this challenge, passing these five test cases is sufficient.

JavaScript, 232 bytes
function c(d){for(var l,o,f,c,p=/^.(\d+).+?$/gm,a=/(T\s+)?C.{7}M .(\d+)/g,r='';l=p.exec(d);)for(f=0;o=a.exec(d);)o[2]==l[1]&&(c=d.slice(0,o.index).split('\n').length,r+=f++?', ':'\n'+l[0]+' -> ',r+=o[1]?'['+c+']':c);return r.trim()}

To be called with
var data = require( 'fs' ).readFileSync( process.argv[2] ).toString();
console.log( c( data ) );

Explanation
function c(d){
    for(
        // Initialise variables
        var l,o,f,c,p=/^.(\d+).+?$/gm,a=/(T\s+)?C.{7}M .(\d+)/g,r='';
        // Find lines beginning with a label
        l=p.exec(d);)
            for(
                // Reset a have-we-output-this-line flag
                f=0;
                // Find CALL FROM statements
                o=a.exec(d);)
                    // Filter to CALL FROM statements which have the current line
                    o[2]==l[1]&&(
                        // Calculate the line number of this CALL FROM statement
                        c=d.slice(0,o.index).split('\n').length,
                        // Concat the output for this line
                        r+=f++?', ':'\n'+l[0]+' -> ',r+=o[1]?'['+c+']':c);
    // Trim an initial new line
    return r.trim()}

The biggest bloat here is calculating the line number, but as the challenge author I thought I'd leave it in as an easy attempt to try to beat.

source: Stack Exchange

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

sort: votes


text:
Big big numbers
Whilst trying to golf several of my answers, I've needed to write large integers in as few characters as possible.
Now I know the best way to do that: I'll be getting you to be writing this program.
The challenge

Write a program that when given a positive integer, outputs a program that prints it to stdout or equivalent.
The output programs don't have to be in the same language as the creator.
The output must be at most 128 bytes.
You may accept input from stdin or equivalent (not function input)
You may output the resulting program to stdout or equivalent.
The number output must be in decimal (base 10)

Scoring
Your score is equal to the smallest positive integer your program can not encode.
The entry with the largest score wins.

I added the tag metagolf, since we're golfing the output program.

@orlp I actually omitted it on purpose, because [tag:metagolf] is a scoring criterion tag which says "the score is the length of your output". I'm considering adding a meta post about that though to allow sort of inverse scoring as well (which is the case for [tag:fastest-code] for instance).

@MartinBüttner I guess we need [tag:meta-restricted-source] :)

How is the challenge different from "which language has the biggest integer range"?

@nwp I think you misunderstand the question.  The question is about compression.  It would be useful, but not necessary to use a language with a big integer range.

Python 3 → CJam, (163122 − 1)·255/162 + 1 ≈ 1.213·10270
import sys
n = int(input())
for b in range(163, 1, -1):
    s = []
    m = n
    while m:
        m, r = divmod(m - 93, b)
        if m < 0:
            break
        s.append(r + 93)
    else:
        sys.stdout.buffer.write(b'"%s"%db' % (bytes(s[::-1]), b))
        break
else:
    sys.stdout.buffer.write(b'%d' % n)

It turns out that every integer from 1023 through (163122 − 1)·255/162 can be represented in at least one way by a base b ≤ 163 conversion from a string of at most 122 characters with codes 93 through b + 92, rather than the usual 0 through b − 1.  This avoids the troublesome characters 34 (double quote) and 92 (backslash) without any extra output code.

Pyth, 252111 ≈ 3.593 × 10266
Js[
"ixL-rC1`H``N"
N
s@L-rC1`H``NjQ252
N
"252")$import sys$$sys.stdout.buffer.write(J.encode('iso-8859-1'))$

Had to use a little bit of Python syntax, because Pyth's print can't print in iso-8859-1.
The number gets encoded in base 252 and represent each digit in that base as an iso-8859-1 char. The chars \ and " would need escaping, and therefore are not used. The char ` isn't used because golfing... And additionally the null-byte is also not used, the Pyth compiler forbids it.
The output is a program with an overhead of 17 bytes:
ixL-rC1`H``N""252

Here's an example usage with the biggest number possible:

Explanation
of the output program.
ixL-rC1`H``N""252
    rC1`H          create the range of chars: ['\x01', '\x02', ..., '{}']
         ``N       creates a string containing the 3 chars " ' \
   -               remove strings which consists of these 3 chars
 xL         ""     determine the index of each char in "" (encoded number)
i             252  convert from base 253 to base 10

This program fails to encode 12, because Pyth unfortunately reads CR as LF.

CJam, 254109 ≈ 1.34 x 10262
q~254b{_33>+_91>+c}%`"{_'[>-_'!>-}%254b"

I'm encoding the number in base 254 and represent each digit in that base as an ISO 8859-1 character, skipping " and \. The output has an overhead of 19 bytes, ""{_'[>-_'!>-}%254b, so I can represent everything less than 254128-19, or explicitly
13392914970384089616967895168962602841770234460440231501234736723328784159136966979592516521814270581662903357791625539571324435618053333498444654631269141250284088221909534717492397543057152353603090337012149759082408143603558512232742912453092885969482645766144

As an example, 6153501 would be encoded as
"abc"{_'[>-_'!>-}%254b

Here is a test program which prints the encoded integer, and then prints its length, and then executes it right away to show its validity (this avoids the trouble of having to copy the unprintable characters into a new program, which doesn't always work with the online interpreter).

Perl, 10216
print"print unpack'h*',q{",(pack'h*',<>),"}"

Also base 100 encoding, slightly more elegant. Output for 12345678 would be:
print unpack'h*',q{!Ce‡}

The delimeters { and } correspond to hex values b7 and d7 respectively, which cannot appear in the input, and therefore do not need to be escaped.
There are 20 bytes of overhead, leaving 108 for encoding, reaching a maximum value of 10216-1.

Perl, 10206
print"ord=~print\$' for'",(map chr"1$_",<>=~/.{1,2}/g),"'=~/.|/g"

Simple base 100 encoding. Output for 12345678 would look like this:
ord=~print$' for'p†œ²'=~/.|/g

There are 25 bytes of overhead, leaving 103 for encoding, reaching a maximum value of 10206-1.

Common Lisp,  36114 - 1 ~ 2.62 × 10117
(lambda(x)(format t"(lambda()#36r~36r)"x))

The largest number is:
2621109035105672045109358354048170185329363187071886946329003212335230440027818091139599929524823562064749950789402494298276879873503833622348138409040138018400021944463278473215
Simply use base 36. For the largest input, the 128-bytes long output is:
(lambda()#36rzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz)

Vyxal, 3 bytes ~\$10^{305}\$
øCṪ

Try it Online!
Thanks to emanresu A for 2 more orders of magnitude
Simple number compression builtin, then chop off the last char. Generates a Vyxal compressed number in base 255. Exceeds the 128 byte output limit at \$10^{305}\$, but can go up to \$10^{308}\$ if the ceiling is raised to 130 bytes.

Append a Ṫ for a little more compression

CJam, 233114 ≈ 7.561⋅10269
ri233b{Kms/m]_34=+c}%s`"{iKms*}%233b"

The output program "…"{iKms*}%233b decodes the 8-bit characters of a string to base 233 digits with n ↦ ⌊n ⋅ sin 20⌋ = ⌊n ⋅ 0.913⌋.  This transformation happens to be surjective without requiring the critical codepoints 34 (double quote) and 92 (backslash) as input.

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

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


text:
Remapping ASCII
Challenge
Write a program that reorders the ASCII characters!
It should output a single string containing all of the printable ASCII characters exactly once. The first character of this string is assigned the value 1, the second character the value 2, and so on.
If two characters are normally next to each other (the difference between their character codes is 1), they may not appear next to each other in the output.
Scoring
Your score will be the sum of the values for all of the characters in your source code, as dictated by your program's output.
Please see the Verification section to calculate your score.
Lowest score wins!
Rules

"Printable ASCII" is defined to mean character codes 32 - 126, inclusive.
You may write a full program or a function.
Your code may only contain printable ASCII characters and newlines.
Your program may not take any input.
Newlines will always have the value 1. Your program's output should not include a newline.

Verification
Use this stack snippet to verify that your code's output is valid, and to calculate your code's score!

var result = document.getElementById("result");document.getElementById("submit").onclick = function() {var code = document.getElementById("code").value;var output = document.getElementById("output").value;var values = [];for (var i = 0; i < output.length; i++) {var c = output[i];var v = c.charCodeAt();if (v < 32 || v > 126) {result.innerHTML = "Invalid output! Reason: `" + c + "` (code " + v + ") is out of range.";return;}if (values.indexOf(c) >= 0) {result.innerHTML = "Invalid output! Reason: `" + c + "` (code " + v + ") was repeated.";return;}if (i > 0) {var d = output[i - 1];var w = d.charCodeAt();if (Math.abs(v - w) == 1) {result.innerHTML = "Invalid output! Reason: `" + d + "` and `" + c + "` (codes " + w + " and " + v + ") cannot appear next to each other in the output.";return;}}values.push(c);}for (var j = 32; j <= 126; j++) {var c = String.fromCharCode(j);if (values.indexOf(c) < 0) {result.innerHTML = "Invalid output! Reason: `" + c + "` (code " + j + ") was missing.";return;}}var score = 0;for (var k = 0; k < code.length; k++) {var s = values.indexOf(code[k]) + 1;if (s <= 0) s = 1;score += s}result.innerHTML = "Your score is " + score + "!";}
<textarea id="code" rows=10 cols=50>Enter your code here.</textarea>
<textarea id="output" rows=1 cols=50>Enter your code's output here.</textarea>
<button id="submit">Submit</button>

Leaderboard
Thanks to this post for the leaderboard code!

var QUESTION_ID=57914,OVERRIDE_USER=42844;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

Loving the validation snippet.

Can you explain briefly how the score is calculated, so we know how to optimize our answers?

@Fatalize Basically, the idea is to write a program whose output assigns low values to the characters that it uses, by putting them towards the beginning of the outputted string. The "value" of each ASCII character is determined by its 1-based index in your code's output. Instead of counting each character in your source as 1, like a code-golf, each character in your source is counted as its value, as described above.

This seems like a good time to use Whitespace in a programming contest...

@C0deH4cker Unfortunately that would require tabs, which are not printable ASCII characters or newlines, so that would be invalid.

If we write a function, do we have to print the string or can we provide it as the return value?

@nimi You can choose whether you want to print or return.

Ah, I didn't think about tabs not counting as printable.

CJam, 356 186 168 131 126 111 99 96 94
"_|`'~,Y/G>z`|"_~

Try it online in the CJam interpreter.
Output
"_|`'~,Y/G>z[ \$&(*.02468:<@BDFHJLNPRTVXZ^bdfhjlnprtvx!#%)+-13579;=?ACEIKMOQSUW]acegikmoqsuwy{}

Idea
Using a variation of a technique common in CJam quines, we sort the printable ASCII characters by whether they appear in the source code, and the non-appearing ones – with two exceptions – by their code points' parity bits.
With the proper source layout, we also manage to sort the source code characters – with one exception – by their frequencies.
Special care has to be taken that two adjacent characters do not appear one after the other for the first time in the source code, as this would invalidate the answer.
Code
"             "_~  Push a string, duplicate it and evaluate the copy.
 _|                Perform the set union of the original string with itself.
                   This is just an "excuse" to introduce the underscore.
   `               Inspect the string (surrounds it with double quotes).
    '~,            Push the string of Unicode characters before the tilde.
       Y/          Divide it into pairs.
         G>        Discard the first 16 pairs (control characters).
           z       Zip. This interleaves the pairs, ordering the characters
                   by their code points' parities.
            `      Inspect the array, i.e., push its string representation.
             |     Perform set union with the string of source code characters.

Wouldn't be surprised to see CJam win this, Pyth doesn't have simple quines nor the ASCII characters in a built-in.

CJam doesn't have a built-in for ASCII characters either. I'm using a unary range, then discard the control characters.

Brainfuck, 1692 826 765
(Still) Unoptimized, I know. I'm working on it (leave opts in the comments).
++[------>+<]>.++.---[-->+++<]>-.[->+++++++++<]>.--[----->+<]>.[-->+++<]>+.++.>+++[<---------->-]<-[-->+<]>-++.>++[>+++<-]>[<<++.>>-]<<++++.++.++.++.++.++.++++>>++++[<++++++++>-]<[<++.>-]<---.++.-->+++[>+++++<-]>-[<<--.>>-]<<---->++++[>+++++<-]>++[<<--.>>-]<<------.--.--.--.--.

Output:
+->.<[] "$&(*,02468:@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~{}ywusqomkigeca_YWUSQOMKIGECA?=;97531/)'%#!

I'm already utilizing overflow on 8bit cells to some extent, but I guess you could still optimize it. Though that would decrease the use of cheap chars :).

I got 576 with a very naive program. Feel free to mix and match my idea. +1.

Pyth, 173 170
Code
-so%CN2rd\~p"p~\dr2NC%os-

Output
p~\dr2NC%os- "$&(*,.0468:<>@BDFHJLPRTVXZ^`bfhjlntvxz|!#')+/13579;=?AEGIKMOQSUWY[]_acegikmquwy{}

Hardcoding a quine-like string. Conveniently, the " character is very near the start of the generated string. Prints even then odd characters after the "quine".
Much thanks to Dennis for saving 3 points, and making the code a palindome!
Try it here

Using \~ for the character range improves your score by 3 points. (It also allows you to make your code a palindrome.)

Java, 3518 3189 2692
A simple loop that prints even characters, then odds. I tried a few things to optimize earlier ASCIIs, but most ended up making it longer overall, and ended up with a higher score.
void A(){for(char A=31;A!=126;System.out.print(A+=2))A=A==125?30:A;}

Output is:
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{} "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~

Edit: Misunderstood the scoring at first. After flipping it to odd first, then even, it scores a lot better.

Octave, 628
Code
["" 32:2:126 33:2:125]

Output:
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}

Two ranges implicitly converted to string. Not sure if returning as Ans is acceptable, also gives a warning about the implicit conversion. Tried some other range vectors, but could not find anything more efficient.

Returning an answer is acceptable, nice job!

C,42 bytes, score 1539
main(i){for(;i-191;i+=2)putchar(32+i%95);}

!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{} "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~

C,39 bytes, score 1687
main(i){for(;i-96;)i=putchar(32+i%95);}

!Aa"Bb#Cc$Dd%Ee&Ff'Gg(Hh)Ii*Jj+Kk,Ll-Mm.Nn/Oo0Pp1Qq2Rr3Ss4Tt5Uu6Vv7Ww8Xx9Yy:Zz;[{<\|=]}>^~?_ @`

In both cases, i is initialised to the number of strings on the commandline (as no arguments are given, this is 1.)
The first version does things the obvious way, incrementing by 2, taking modulo 95 and thefore printing all the odds then all the evens.
The second version takes advantage of the fact that putchar returns the character printed. As 32 is coprime to 95, we can cycle through the characters.
As C contains a lot of lowercase characters I hoped that this, besides being shorter, would have a lower score but unfortunately this is not the case.

i;main(){for(;i<3990;i+=42)putchar(i%95+32);} scores 1472, I think

@squeamishossifrage well spotted, it does indeed! How long did it take to find that one? I got bored of C, my brainfuck answer is much better.

Just noodling around with the Perl script I used to generate this answer :-)

you can lower your score using a as the variable name rather than i in both cases.

Befunge-93, 801 797 724 699 627 612
Code:
"!  "     ^
v     _@#$<
>:,2+:"~"`|
^         <

Output:
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}

You can try it here if you want.
It works by outputting 32-126 evens, and then 33-125 odds.  If anyone wants an explanation, I'd be willing to.
I golfed it until I got it better than brainf***, which I deemed to be the lowest I could go.  As far as golfing strategies, I generated the ascii characters and then tried to replace costly characters with cheaper ones (like 1 with 2).  I found out since g was so expensive, it was better to compute 126 every iteration.  I also wrapped around the top since ^ was cheaper than v.
801 -> 797: Recent change was removing extra spaces that was a relic from using g.
797 -> 724: I changed calculating 126 every time to just reading tilde using "~".  this also allowed for cutting away whitespace (And i'm beating one of the BF answers again)
724 -> 699: Similar to the last change, " " is an extremely cheap (4 points) way of obtaining 32
699 -> 627: Since I only go through the 2nd row pass once, I just changed it to setting 33 instead of maintaining another value on the stack and adding one.
627 -> 612: Moved as much as I could to string input.  I'm pretty sure the design would need to change drastically to golf it any further.
This is probably the final iteration, unless one of the non-golfing languages gets a lower solution.

Haskell, 830
['!','#'..'}']++[' ','\"'..'~']

Evaluates to the string:
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{} "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~

Inspired by @Jørgen's answer and completely different from my own.

Brainfuck, score 576 667
Thinking about it, 576 seemed to good to be true: I did a little estimation and worked out my score to be around 95*6 + 45*2 = 660. Something must have gone wrong the first time I ran the validator. The correct score is closer to my estimate. It's still not a bad score.
+++++++++++++++++++++++++++++++++++++++++++++.--.+++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.++.---.++.----.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.---.--.--.--.--.--.--.+++.--.++++.++.++.

Keep it simple.
Basically just walks up and down the ASCII set, printing characters. The three characters used in the program are printed first. Turning round at either end was a little bit tricky.
-+.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~{}ywusqomkigeca_][YWUSQOMKIGECA?=;97531/,*(&$" #!%')

Ruby 2.2, 1157
eval s='srand 1;([*s.bytes].shuffle|[*33..0x7e].shuffle).map{|c|putc c}'

Output:
f.p|cahu]xens7*0{)3tbmdy[}l1; r(o@&gN/MjzSVv~>D4I`L\KB92=i%PHE?5TQw,W-#6U'^Y!$R"XkO_q+CAGZF<8:J

This is a pretty dumb solution (and I'm not sure srand shouldn't be a standard loophole especially since it drastically reduces portability). Shuffles (most of) the bytes in its own source code and shuffles the rest, then uniques and concatenates the arrays. Uses a random seed picked so that the output is legal (the fact that it's a single digit is pure luck).

Interesting solution! I'll classify this as legal because it will always produce the same output (if I've understood correctly) given the same seed. Also, having a variety of different approaches is always more interesting.

gawk, 2782 1988 1821
END{for(rrf=rrr="rf(3)+=;1\"$?:~ptoin[<-EN% ^.|P";fr++<333;$fr=(ff=sprintf("%c",fr))~"[[(]"?f:ff);for(;r++<33+13+1;rrf=f)printf(rrf)(rrr~(rr=$(31+1+r+r))?f:rr)(rrr~(rr=$(133-(3+3+r+r)))?f:rr)}

Output
rf(3)+=;1"$?:~ptoin[<-EN% ^.|P}{&yw*u,sq02m4k68gec>a@_B]DFYHWJULSQORMTKVIXGZ\CA`bd9h7j5l/vx'z#!

Usage
Copy and paste the following to your console(mawk won't work, because it's too sctrict stricter with printf)
awk 'END{for(rrf=rrr="rf(3)+=;1\"$?:~ptoin[<-EN% ^.|P";fr++<333;$fr=(ff=sprintf("%c",fr))~"[[(]"?f:ff);for(;r++<33+13+1;rrf=f)printf(rrf)(rrr~(rr=$(31+1+r+r))?f:rr)(rrr~(rr=$(133-(3+3+r+r)))?f:rr)}' < /dev/null

The < /dev/null at the end signals the end of input, so the END block will be executed.
I basically interweaved the characters coming from the bottom and coming from the top. Then I analysed, which characters were used the most in the program and printed them first, in order of frequency. Then I had to make sure that no character is printed more than one time. The weaving in opposite directions made it more probable that an already used character wouldn't lead to printing neighbours. But they met in the middle at P, so I had to print that in the beginning too. Then there were some problems with characters which are used in regexps... Then I renamed the variables cheaply and did the whole thing over again. Then I found some characters I could replace in my program, and did the whole thing over again. And so on.. I finally tweaked the string with the preferred characters a little by testing.
I think I'm done :D
During the process I never executed the program from the command line, but constructed a string I executed from inside a script, which would analyse the output for correctness and give me the score and stuff. That score output helped a lot. Of course I rechecked here (you never know) but it got me the same result.
There the program looks like this
p=sprintf("END{"\
"for(rrf=rrr=%c%s%c;fr++<333;$fr=(ff=sprintf(%c%cc%c,fr))~%c[[(]%c?f:ff);"\
"for(;r++<33+13+1;rrf=f)printf"\
"(rrf)(rrr~(rr=$(31+1+r+r))?f:rr)(rrr~(rr=$(133-(3+3+r+r)))?f:rr)}"\
,34,s=sprintf("rf(3)+=;1%c%c$?:~ptoin[<-EN%c ^.|P",92,34,37),34,34,37,34,34,34)

CBM BASIC V2, 2553
1FORI=0TO47:PRINTCHR$(32+I*2);:NEXT
2FORI=0TO47:PRINTCHR$(33+I*2);:NEXT

the output (converted in ASCII by a python script on pc):
<blank>"$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}

Matlab, 763
Of course, it's quite impossible to beat the Octave solution in MATLAB, since it doesn't have " which is 'early' in the ASCII-range. However, I decided to get a bit creative and figured to abuse randperm. I admit that it's a bit hacky and some could consider it cheating, but I guess it's a nice touch. First, the program and output:
rng(1194663);['' randperm(95)+31]

Ouput:
p2)[]913r~jZe:'Xf +b(Atd@LHT*7&xmN>6!?CJgwsaSh|/McO4_EkK=$5VP-%D<"Gz#Yq08n};WB`{.l\Quy^vR,IFoiU

For calculating an appropriate seed, I used the following program, which I ran until seed=4648029 (i.e., until the dishes were done)
minscore=Inf;
for(seed=1:1e9)
    rng(seed)
    p=randperm(95)+31;
    if(any(abs(diff(p))==1))
        continue
    end
    codestring=sprintf('rng(%d);['''' randperm(95)+31]',seed);
    score=0;
    for(i=1:length(codestring))
        score=score + find(codestring(i)==p,1);
    end
    if(score<minscore)
        minscore=score;
        bestseed=seed;
    end
end

Perhaps one way to improve the program is to try out floating point seeds as well, e.g., 2.3e4 increase the number of seeds without having a longer seed length. If anyone feels like making a program to calculate all n-character numbers representable by Matlab.... ;)

I think this is an excellent solution. However, ['' 32:2:126 33:2:125] (with single quotes) is valid, and shorter at 728 points :-)

@Jørgen I know, but I wanted to try a different approach ;). I guess it would have yielded more interesting results if randperm wasn't such a long function name.

Haskell, 1660 1376
""!_="O"
(a:b)!(c:d)=a:c:b!d
a=[' '..'N']!['P'..]

Defines the function a which returns the string:
 P!Q"R#S$T%U&V'W(X)Y*Z+[,\-].^/_0`1a2b3c4d5e6f7g8h9i:j;k<l=m>n?o@pAqBrCsDtEuFvGwHxIyJzK{L|M}N~O

Java, 15470
class A{public static void main(String[]I) throws Exception{java.lang.reflect.Field C=Character.class.getDeclaredClasses()[0].getDeclaredField("cache");C.setAccessible(true);Character[]E=(Character[])C.get(C);for(char A=31,G=31;A!=126;E[G++]=new Character(A+=2))A=A==125?30:A;for(char A=31;A!=126;A++)System.out.printf("%c", A);}}

Not really optimal at all, but it actually remaps the chars (rather than just printing out a set of modified chars).
Ungolfed:
public class Main {
    public static void main(String[] args) throws Exception {
        java.lang.reflect.Field feild = Character.class.getDeclaredClasses()[0].getDeclaredField("cache");
        feild.setAccessible(true);
        Character[] array = (Character[]) feild.get(args); //Since it's a static field, we can supply whatever we want here, and args is cheaper than null.

        char i = 31;
        for (char c = 31; c != 126; array[i++] = new Character(c += 2)) {
            c = c == 125 ? 30 : c;
        }

        for (char c = 31; c < 126; c++) {
            System.out.printf("%c", c);
        }
    }
}

Output
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{} "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~

It orders the chars using the same method as Geobits' answer, and does something similar to this answer to change the chars.

JavaScript, 3169 2548 2144 2104 2071 1885 1876 1872
Code
t=''
i=S=95
while(i--)t+=String.fromCharCode(i*2291%S-
-32)
alert(t)

Output
ti^SH=2'{peZOD9.#wlaVK@5*~sh]RG<1&zodYNC8-"vk`UJ?4)}rg\QF;0%yncXMB7,!uj_TI>3(|qf[PE:/$xmbWLA6+

Is the v+ part of (v,i)=>v+i*3%95+32 necessary? It seems to me that it simply adds 0 every time since the array is filled with 0s....

@UndefinedFunction It seems not. Didn't focus too hard on optimizing, since I was working on an alternative method that ended up shorter anyways. Thanks! =)

for(w=95;w-->0;) can be for(w=95;w--;), because 0 is falsy and 1, 2, 3... are truthy.

@UndefinedFunction Wow, how did I not think of that! You just shaved 56 points off of my best, bringing it to 2144 now :D Still trying to get it below 2000 though...

Easy improvement: use newlines instead of semicolons to separate statements. Newlines count as 1.

Down another 40 to 2104. Almost there!

Let us continue this discussion in chat.

-\n- ... well done

Python 2, 72 bytes (3188) 116 bytes (1383) (1306) (1303)
thanks @FryAmTheEggman for the join trick ;)
thanks @nim (Did I misread the text? :P)
thanks @Mathias Ettinger
n='nr i(a)2:]o[c=fh1+t"3egj,p.7'
a=[chr(r)for r in range(32,127)if not chr(r)in n]
print n+"".join(a[::2]+a[1::2])

output:
 nr<blank>i(a)2:]o[c=fh1+t"3egj,p.7!$&*/469<?ACEGIKMOQSUWY\_bkmsvxz|~#%'-058;>@BDFHJLNPRTVXZ^`dlquwy{}

a=map(chr,range(32,172)) and "".join(a[::2]+a[1::2])

I think you can replace some of the ; with newlines, which count as 1

You can get 3 points out by starting with n='nr i(a… instead of n=' nri(a…

BBC BASIC, 2554
Code
n=32
s$=""
REPEAT
  s$+=CHR$(n)
  n+=2
  IFn=128THENn=33
UNTILn=127
PRINTs$

Output
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}

Fortran 90, 1523 1519 1171
This is a nested output loop, similar to other answers. Not too confident that much improvement is possible...
PRINT*,((CHAR(J),J=L,126,2),L=32,33)
END

Output:
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}

Edit:
Forgot that Fortran 90 is necessary for this code, 77 requires code to start in the 7th column. On the other hand, the language is case insensitive, allowing an easy improvement. The loop counters are J and L because these are the first two letters in the output string implicitly declared as integers by Fortran.

Perl, 1089 922
It turns out that printing the ASCII values in steps of 42 58 gives the lowest score with this approach:
print chr$_*58%95+32for 0..94

Output:
 Z5oJ%_:tO*d?yT/iD~Y4nI$^9sN)c>xS.hC}X3mH#]8rM(b=wR-gB|W2lG"\7qL'a<vQ,fA{V1kF![6pK&`;uP+e@zU0jE

print chr$_*42%95+32for 0..94 already achieves a score of 925, and 42 is most likely no longer optimal.

Thanks @Dennis — I had no idea you could write loops that way.

If you replace the spaces with linefeeds, print chr$_*63%95+32for 31..125 achieves a score of 799.

PHP, 1217 1081
The code:
for(;$T!=T;$T=($T+52)%95)echo chr(32+$T);

Because the variables are not initialized, it needs to suppress the notices on running (PHP complains but continues execution and uses a default value that is appropriate in the context; 0 in this case):
$ php -d error_reporting=0 remapping-ascii.php

Its output:
 T)]2f;oDxM"V+_4h=qFzO$X-a6j?sH|Q&Z/c8lAuJ~S(\1e:nCwL!U*^3g<pEyN#W,`5i>rG{P%Y.b7k@tI}R'[0d9mBvK

Remarks:

the output starts with a white space (chr(32));
the code prints the white space then each 52th character, wrapping around the range;
the magic number 52 was "discovered" by searching the entire range (1..94) of possible offsets; 1 produces the list of printable chars in the ascending order of their ASCII codes, 94 produces the list in the reverse order, both are bad; the multiples of 5 and 19 (the divisors of 95) produce short cycles and don't cover the entire range of values (also bad);
52 seems to be magic; it is the best offset for this code; but it is also the best for some variations of the code (that produce slightly bigger scores); the variations I tried: use while() instead of for(), use $f++, $f-- or --$f instead of ++$f, swap the operands around the < and + operators; squeeze the modification of $T into 32+$T;
the names of the variables ($T and $f) are the first letters from the output;
I tried to initialize $T with 4 or 11 but the scores were worse; starting with 4 makes $ the first character in the output; it is the most used character in a PHP source code; 11 brings + in front; $ and + are the most used characters in this code.

The code, tests, incremental changes I tried until I reached this solution and the script that tested all possible step values (the authoritative provider for 52 as the best step) can be found on github.

Fourier, 1236
Basically a conversion of my BBCB program
32~N127(Na^^~N{128}{33~N}N)

Output
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfhjlnprtvxz|~!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}

AWK, 49 bytes, Score: 1755
BEGIN{for(f=82;++f<178;)printf"%c",(2*f-1)%95+32}

Try it online!
Simply prints every other character then starts over filling in the blanks.
First character printed is an f.  I attempted printing in reverse order, but that greatly increased the score. Other patterns are possible by simply changing the multiplier and the loop criteria.

Perl 5, 1069
print chr$_*2%95+32for 0..94

Try it online!


text:
Pyramid Schemes
Mayan pyramids were (and are) an important part of ancient architecture, that were generally used for religious purposes.
They were usually step pyramids, but the steps on each were too steep to climb. Priests would climb to the tops of them via alternative staircases to perform ceremonies. The pyramids were also used as landmarks because of their height, and sometimes even used as burial sites for high ranking officials.

The Challenge
Write a program that can print out a pyramid schematic based on user specifications (see below).

Requirements

Take an input of two space-separated variables.

Input must be accepted through STDIN (or closest alternative).

Output must be through STDOUT (or closest alternative).

Input

Height as any positive integer. This is used as the base level's width (in blocks). Each succeeding level of the pyramid has the width n - 1 where n is the previous floor's width (in blocks).

Block size which will be 1 or any odd, positive integer ≤ (less than) 10.

Blocks
The given block size determines the width (and height) of each individual piece. Essentially, there are i^2 spaces inside the visible box where i is the block size.
A 1x1 block would look like this:
+++
| |
+++

While a 5x5 block would look like this:
+++++++
|     |
|     |
|     |
|     |
|     |
+++++++

Horizontally Adjacent Blocks
Horizontally side-by-side blocks must have their middle walls merged into one.
You must have this:
+++++
| | |
+++++

Instead of something like this:
++++++
| || |
++++++

Vertically Adjacent Blocks (-5% bonus)
Vertically side-by-side blocks have a special exception: the middle wall can be merged into one.
So, instead of 1x1 blocks looking like this:
 +++
 | |
 +++
+++++
| | |
+++++

They could look like this:
 +++
 | |
+++++
| | |
+++++

Examples
Input: 3 1

Output:

  +++
  | |
  +++
 +++++
 | | |
 +++++
+++++++
| | | |
+++++++

OR

  +++
  | |
 +++++
 | | |
+++++++
| | | |
+++++++

Input: 2 3

Output:

  +++++
  |   |
  |   |
  |   |
  +++++
+++++++++
|   |   |
|   |   |
|   |   |
+++++++++

OR

  +++++
  |   |
  |   |
  |   |
+++++++++
|   |   |
|   |   |
|   |   |
+++++++++

Scoreboard
To be ranked on the scoreboard, put your answer in this format:
# Language, Score

Or if you get the bonus -5%:
# Language, Score (Bytes - 5%)

function getURL(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function getAnswers(){$.ajax({url:getURL(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){var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),useData(answers)}})}function getOwnerName(e){return e.owner.display_name}function useData(e){var s=[];e.forEach(function(e){var a=e.body.replace(/<s>.*<\/s>/,"").replace(/.*<\/strike>/,"");console.log(a),VALID_HEAD.test(a)&&s.push({user:getOwnerName(e),language:a.match(VALID_HEAD)[1],score:+a.match(VALID_HEAD)[2],link:e.share_link})}),s.sort(function(e,s){var a=e.score,r=s.score;return a-r}),s.forEach(function(e,s){var a=$("#score-template").html();a=a.replace("{{RANK}}",s+1+"").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SCORE}}",e.score),a=$(a),$("#scores").append(a)})}var QUESTION_ID=57939,ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",answers=[],answer_ids,answers_hash,answer_page=1;getAnswers();var VALID_HEAD=/<h\d>([^\n,]*)[, ]*(\d+).*<\/h\d>/;
body{text-align:left!important}table thead{font-weight:700}table td{padding:10px 0 0 30px}#scores-cont{padding:10px;width:600px}#scores tr td:first-of-type{padding-left:0}
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Scores

	User	Language	Score

{{RANK}}	{{NAME}}	{{LANGUAGE}}	{{SCORE}}

What's the minimum input? 1 1?

Yes, which would be a single block. @minxomat It's explained under the "Input" section.

What would the input 3 2 produce?

According to the second bullet under the "Input" section, the second input integer must be odd. @Hand-E-Food If you meant to ask what would happen for an input like 2 3, it would exit when n - 1 = 0 where n is the previous floor's width in blocks.

@ZachGates, thanks! Don't mind me. Clearly the coffee has failed me.

I misspoke as well. Ignore the whole second sentence of my earlier comment. It's impossible to run out of blocks to build each floor, as the block size has no effect on the height. @Hand-E-Food

Hello, is this explicitly a challenge to output to ASCII, or may I use PETSCII (i.e., Commodore PET, VIC-20, C64 etc...)

Pyth, 45 (47 bytes - 5%)
AmvdczdVGjm.[Jh*GhHj*H?d\ \+*+2N?d\|\+\ hH;*J\+

Try it out here.
                                                   Implicit: z=input(), d=' '
    czd                                            Split input on spaces
 mvd                                               Evaluate each part of the above (convert to int)
A                                                  Store the pair in G,H
             Jh*GhH                                J = 1+(G*(H+1))
       VG                                          For N in [0 to G-1]:
          m                             hH;          Map d in [0 to H] to:
                                ?d\|\+                 Get '|' or '+' (vertical edges or corners)
                            *+2N                       Repeat the above (N+2) times
                      ?d\ \+                           Get ' ' or '+' (block centre or horizontal edge)
                    *H                                 Repeat the above H times
                   j                                   Join (|/+) by (   /+++)
           .[J                        \                Centrally pad the above to width J using spaces
         j                                           Join on newlines, implicit print
                                           *J\+    Get J '+'s, implicit print

+1. Better late than never. :P

JavaScript (ES6), 161 (169-5%) 166 (174-5%)
Using template strings, the 2 newlines are significant and counted.
Test running the snippet below in an EcmaScript 6 browser. Firefox ok, not Chrome because it lacks support for destructuring assignment.
Code explained after the snippet.

/*Test: redefine console.log*/ console.log=x=>O.innerHTML+=x+'\n';

for([h,b]=prompt().split` `,g='+'[R='repeat'](-~b),f=' '[R](b),n=o='';h--;o+=e+(d=g[R](++n)+`+
`)+f.replace(/./g,e+('|'+f)[R](n)+`|
`))e=' '[R](h*-~b/2);console.log(o+d)

Less Golfed
[h, b] = prompt().split` `; // get the space separated input values
c = -~b; // Add 1 to b. As b is of string type b+1 would be a string concatenation
g = '+'.repeat(c); // top border
f = ' '.repeat(b); // inner blank row
o = ''; // initialize output string
for(n = 0; h > 0; --h) // loop on height
{
   ++n;
   e = ' '.repeat(h*c/2); // blanks for offset from left margins
   d = g.repeat(n) + `+\n`; // top border repeated, then right end and newline
   // the block body is squared, there are as many rows as columns inside
   // so I can build the right number of rows replacing the chars in a single row
   o += e + d + f.replace(/./g, e + ('|'+f).repeat(n)+`|\n`)
}
o += d // add last top border as bottom
console.log(o)

Ruby, 124 (130 - 5%)
n=(g=gets).to_i
b=g[-2].to_i+1
a=(0..n*b-1).map{|i|[?+*(i/b*b+b+1),(?|+' '*(b-1))*(i/b+1)+?|][i%b<=>0].center(n*b+1)}
puts a,a[-b]

With comments
n=(g=gets).to_i                                  #get input and interpret as a number for pyramid height (everything after the space is ignored)
b=g[-2].to_i+1                                   #the single-character block size is the second last character (just before the newline.) Add 1 to give the pitch between squares.
a=(0..n*b-1).map{|i|                             #run through all lines except the last one
[?+*(i/b*b+b+1),                                 #calculate number of + symbols
(?|+' '*(b-1))*(i/b+1)+?|]                       #or alternatively, pattern '|    |'
     [i%b<=>0]                                   #check if i%b is zero or positive to decide which to print
     .center(n*b+1)}                             #centre the text. It will be mapped to the array a.
puts a,a[-b]                                     #a contains the pyramid, minus its last line. Print it, and add the last line

Don't forget about your bonus -5% (bringing your score to 124). Good work!

Python 2, 117 (123 bytes)
h,n=map(int,raw_input().split())
p,v='+|'
while h:p+='+'*-~n;v+=' '*n+'|';h-=1;l=~n/-2*h*' ';print l+p+('\n'+l+v)*n
print p

The idea is to build up the bricks' top p as +++++++++ and side v as |   |   |. The top starts as + and is augmented by n+1 +'s each layer. The side starts as | and is augmented by n spaces and a |. Each layer, we augment the tops and sides, then print one top and n sides.
To center them, we first print an indent l. It consists of a number of spaces that scales with the current height h. To update it, we decrementing the height variable h until it hits 0, after which the current layer is flush against the left edge of the screen. We print the top once more to make the bottom layer, and we're done.

Python 2, 200 (210 - 5%)
a,b=map(int,raw_input().split());c=0;a+=1;i=a*b+a-b;e=[i*'+']
while a-1:
 v=(('|'+' '*b)*a).rstrip();p=' '*((i-len(v))/2);a-=1;c+=1
 for u in range(b):e.insert(0,p+v)
 e.insert(0,p+'+'*len(v))
print'\n'.join(e)

I used string multiplication and stripped extra spaces.

Vyxal o, 44 bytes (46 - 5%)
(n£¹n-‹⁰½⌈*ð*:\+⁰›n›*›*+:→x,⁰(:₴\|:⁰꘍¥›*p,))←x

Try it Online!

05AB1E, 27 26 bytes
Takes the height and then block size on seperate lines. 30 bytes if the input format is strict.
Lε'|²úRy²>*>©∍²и®'+×.ø}˜.c

Try it online!
L                         # push range [1 .. h]
 ε                     }  # for y in [1 .. h]:
  '|                     '# push "|"
    ²úR                   # pad with w spaces in the back
       ²>*>               # line length: (w+1)*y+1
           ©              # store the line length in the register
            ∍             # extend the string to this length
             ²и           # push a list with w copies of the string
               ®'+×      '# push a string of "+"*line length
                   .ø     # surround the list with this string

˜                         # flatten into a list of strings
 .c                       # centralize

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


text:
Where is the Arrow Pointing?
Where is the Arrow Pointing?
In this challenge, your goal is to follow an arrow and output the character it is pointing to.
Examples
Input:
d  S------+    b
          |
          |
   c      +--->a

Output: a

Input:
S-----+---a->c
      |
      V
      b

Output: b
The arrow is not pointing at c because it is divided by the a, meaning this path never leads to an arrow head.

Input:
a S      s
  |      |
  V      V
  b      c

Output: b

Input:
d s<+S+--V
    |||  Q
    -++

Output: Q
This path starts at the S, goes down, to the right, goes up, to the right, then points down at the Q. Note that the path does not go straight from S to +.

Input:
d s-+   +-S  +--+
    +-->b |  |  |
     |  | +--+  |
     +--+ A<----+

Output: A

Input:
S-----+
|     +-^
+---+->B
    +---^

Output: B
Because the valid line will never lead to a whitespace character. The only line that doesn't lead to a whitespace character leads to a B
Challenge
The input will be a multi-line string in which you need to find the character the arrow is pointing at. There will only be one valid arrow. The valid arrow will only point to alphanumeric characters excluding S. A line will never overlap itself. e.g. -|-

S (capital) represents where the arrow starts.
- represents a horizontal line
+ represents a possible change in axis. A valid arrow will never start with a +.
| represents a vertical line
> < V ^ any of these represent the arrow head. These will never connect to a +.

There will only be one S in the string. The input will also be padded to be a rectangle (not necessarily a square).

"This will never appear adjacent to a S." Should probably be reworded to "This will never be the first character of the arrow." (Because the Q example has a  + adjacent to an S.) "+ represents a change in axis." might better be "+ represents a possible in change in axis." (Because the B example shows that you can move through a + without changing direction.) Otherwise, nice challenge. :)

I made a change to one of your test cases. I think that will make it harder to write programs that only happen to get the right answer, like mine did at first.

Can the arrow head change direction, i.e ---^? In other words, if in B example, could the B stay in the first row?

@edc65 do you mean like in the Q example?

uh ... right. Exactly what I mean. thx

An arrow head will not be connected to '+'. But could it be connected to 'S'? Is S>a valid ?

@edc65 yes, of course.

:-( then I need to revise my answer

JavaScript (ES6), 195 245 231 242 246 250
Edit4 Now, a single recursive function. Probably can't be golfed more
Edit3 Test for straight line and test for arrowhead merged in T function, S  and H functions removed.
Edit2 Revised and longer :( after this this clarification
Edit Small improvements, cutting some char here and there, waiting for CJammers to step in
Test running the snippet below in an EcmaScript 6 compliant browser. (works on Firefox. Chrome still missing the spread operator ...)

f=(s,p=s[I='indexOf']`S`,w=m=[o=~s[I]`
`,1,-o,-1],q,v,r)=>m.some((d,i)=>{for(v=w,q=p;r=s[q+=d],r=='|-'[i&1];)v='+';return r=r==v?f(s,q,v):/\w/.test(r=s[q+m['^>V<'[I](r)]])&&r},s=[...s],s[p]=0)&&r

// Less golfed
// U: recursive scan function
U = (s, // input string or array
     p = s.indexOf`S`, // current position, defult to position of S into string (at first call)
     w = // char to compare looking for a '+', at first call default to garbage as you can't follow '+' near 'S'
       m = [// m, global, offset array form movements.
         o = ~s.indexOf`\n`, // o, global, row line +1 (negated)
         1, -o, -1], // complete the values of m array
     // m and o are assigned again and again at each recursive call, but that is harmless
     // params working as local variables as the function is recursive
     q,v,r) =>
{
   s = [...s]; //convert to array, as I have to modify it while scanning
     //the conversion is done again and again at each recursive call, but that is harmless
   s[p] = 0; // make s[p] invalid to avoid bouncing back and forth

   m.some( // for each direction, stop if endpoint found
      (d,i ) => {
        q = p; // start at current position, then will add the offset relative to current direction
        v = w; // for each direction, assign the starting value that can be '+' or garbage at first call
        // compare char at next position with the expected char based on direction (- for horiz, | for vertical)
        // in m array, values at even positon are vertical movements, odds are horizontal
        while (s[q+=d] == '|-'[i&1]) // while straight direction, follow it until it ends
          v = '+'; // from now on '+' is allowed
        r = s[q];
        if (r == v) // check if found a '+'
          r = U(s, q, v) // recursive call to check all directions from current position
        else
        {
          r = s[q + m['^>V<'.indexOf(r)]], // pointed char in p (if arrowhead, else will return undefined)
          r = /\w/.test(r) && r // if alphanumeric, then we found our result - else r = false
        }
        return r; // returning r to .some; if r is truthy, the .some function will stop
      }
   )
   return r; // result if found, else undefined or null
}

// TEST
out=x=>O.innerHTML+=x.replace(/</g,'<')+'\n'

// Using explicit newlines '\n' to ensure the padding to a rectangle
;[
 ['z<+S-+->a','a']
,['a<-+S>b','b']
,['S-+\n  |\n  V\n  a','a']
,['a S      s\n  |      |\n  V      V\n  b      c  ','b']
,['S-----+  \n|     +-^  \n+---+->B \n    +---^','B']
,['d s<+S+--V\n    |||  Q\n    -++    ','Q']
,['d s-+   +-S  +--+\n    +-->b |  |  |\n     |  | +--+  |\n     +--+ A<----+  ','A']
,['S-----+   \n|     +-^ \n+---+->B  \n    +---^ ','B']
].forEach(t=>{
  r=f(t[0])
  k=t[1]
  out('Test '+(r==k?'OK':'Fail')+'\n'+t[0]+'\nResult: '+ r +'\nCheck: '+k+'\n')
})

JavaScript 2016, 264 263 249 240 235 234 bytes
Run it in Firefox:
m=l=>{o=(q,e)=>q.indexOf(e)
s=[-1,1,c=~o(l,`
`),-c]
f=i=>!o[i]&(!(r=l[i+s[o(a="<>^V",o[i]=c=l[i])]])|r<"0"|r>"z"|r=="S"||alert(s=r))&&c&&[for(j of (c!='+'?a:"")+"-|+")for(k of s)l[i+k]!=j|~o(l[i]+j,k*k>1?"-":"|")||f(i+k)]
f(o(l,'S'))}

m(`d s-+   +-S  +--+
    +-->b |  |  |
     |  | +--+  |
     +--+ A<----+`)

Scattered in some of my notes:
m=l=>{o=(q,e)=>q.indexOf(e) //shorthand for indexOf
s=[-1,1,c=o(l,`
`)+1,-c] // get all possible moves in 1d
w=[] // to keep track of the already-visited indexes
f=i=>{c=l[i] // current character
if(!w[i]&&c) // only continue if the index wasn't already visited and we aren't out of bounds
{r=l[i+s[o(a="<>^V",w[i]=c)]] // sets w[i] to a truthy value and maps the arrows to their corresponding moves in s. If c is an arrow, r is the character it's pointing to.
if(!r||r<"0"||r>"z"||r=="S"||alert(r)) // if r is an alphanumeric character that isn't r, show it and return. If not, continue.
for(j of (c!='+'?a:"")+"-|+") // iterate over all characters to make sure plusses are checked out last, which is necessary at the start.
for(k of s) // check out all possible moves
l[i+k]!=j|| // check if the move leads to the character we're looking for
~o(l[i]+j,k*k>1?"-":"|")|| // make sure the current nor that character goes against the direction of the move
f(i+k)}} // make the move, end of f
f(o(l,'S'))} // start at S

You may save some bits by doing o = 'indexOf' and then doing q[o](e) when you want to use it.

Also, in code golf, for(;;) loops are usually most efficient.  Might be wrong in this case, but try it out.

test case a<-+S->b I think it should give b only, as A valid arrow will never start with a +

Fixed that and turned f into a one-liner. I really liked your approach to this problem, by the way.

A side note: I really love array comprehension, but it's not in any version of EcmaScript standard anymore. I suggest to tag you anser JavaScript 2016 (stiil a valid and good answer, not problem with it)

VBA Excel 2007, 894 bytes
Well this started out a lot better then it ended. I have a feeling my logic is flawed and i could have saved a tonne of bytes if i reordered some of my logic, But Too much time has been sunk into this already =P
The input for this is Column A of whatever sheet you are on. This method uses the fact that Excel has this nice grid and Breaks everything out so you can see what it is doing more clearly.
Sub m() is just taking the Copy pasted data from Column A and Breaking it out by char. If We allow a Modified input then if you preformat the maze into 1 char per cell you can save a few bytes by removing sub m()
Paste a Maze into Excel any size upto 99 rows by 27 char across. If you want bigger mazes its only 2 extra Bytes to increase the scope to 999 rows and ZZ columns
Also might need a judges call on whether a Excel Sheet is Valid "Standard Input" for a VBA answer.  If not, Its pretty much impossible to give VBA Multi-line input VIA the Immediate window
To run this code just paste this code into a Excel module, Paste a maze into A1 and run sub j()
Sub m()
For k=1 To 99
u=Cells(k,1).Value
For i=1 To Len(u)
Cells(k,i+1).Value=Mid(u,i,1)
Next
Next
Columns(1).Delete
End Sub
Sub j()
m
With Range("A:Z").Find("S",,,,,,1)
h .row,.Column,0
End With
End Sub
Sub h(r,c,t)
If t<>1 Then l r-1,c,1,0,r
If t<>-1 Then l r+1,c,-1,0,r
If t<>2 Then l r,c-1,2,0,r
If t<>-2 Then l r,c+1,-2,0,r
End Sub
Sub l(r,c,y,p,i)
On Error GoTo w
q=Cells(r,c).Text
If q="V" Or q="^" Or q="<" Or q=">" Then
p=1
End If
f="[^V<>]"
If p=1 And q Like "[0-9A-UW-Za-z]" Then
MsgBox q: End
Else
If q="^" Then p=1: GoTo t
If q="V" Then p=1: GoTo g
If q="<" Then p=1: GoTo b
If q=">" Then p=1: GoTo n
Select Case y
Case 1
t:If q="|" Or q Like f Then l r-1,c,y,p,q
Case -1
g:If q="|" Or q Like f Then l r+1,c,y,p,q
Case 2
b:If q="-" Or q Like f Then l r,c-1,y,p,q
Case -2
n:If q="-" Or q Like f Then l r,c+1,y,p,q
End Select
If q="+" And i<>"S" Then h r,c,y*-1
p=0
End If
w:
End Sub

Python 3, 349 bytes
Ugh, so many bytes.
S=input().split('\n')
Q=[[S[0].find('S'),0]]
D=[[1,0],[0,1],[-1,0],[0,-1]]
A='-S--++-'
B='|S||++|'
P='>V<^'
i=0
while D:
 a,b=Q[i];i+=1
 j=S[b][a]
 for x,y in D:
  try:
   c,d=a+x,b+y;k=S[d][c]
   if k in P:
    z=P.index(k);print(S[d+D[z][1]][c+D[z][0]]);D=[]
   if (j+k in A and x)+(j+k in B and y)*~([c,d]in Q):Q+=[[c,d]]
  except IndexError: pass

Essentially a breadth-first search. Bonus: this actually exits gracefully instead of using exit(), which is longer anyway.

This doesn't implement about half of the search constraints, man. http://ideone.com/OzoWRX

@bopjesvla: Drat, you're right. Good spot!

How are you able to use a multiline string with input()? It's problematic for me.

@The_Basset_Hound: You can't manually enter the newlines; you have to copy-paste the entire thing at once.

@El'endiaStarman I'm copy/pasting and it's still only reading the first line it seems.

@The_Basset_Hound: I ran into the same problem recently. This will only work with Python 3.3 in IDLE. Using Python 3.5's IDLE or either one from the command line will result in each \n character "pressing" the Enter key, so to speak, so you have to use a while loop to catch them all.

@El'endiaStarman Alright, good to know. Thanks.

Perl 5
The solution turned out longer than other solutions.
Even after golfing it.  So this is the ungolfed version.
It prints the map so that you can follow the cursor.
The way it works? At each step it puts possible moves on the stack.
And it keeps on running till there's nothing left on the stack, or a solution is found.
It can be easily modified to find all solutions and choose the nearest --> while(@_){...
while(<>){
  chomp;
  @R=split//;
  $j++;$i=0;
  for(@R){$nr++;$i++;$A[$i][$j]=$_;if('S'eq$_){$x=$i;$y=$j}}
  $xm=$i,if$xm<$i;$ym=$j;
}
push(@_,[($x,$y,'S',0)]);
$cr='';
while(@_&&''eq$cr){
 @C=pop@_;
 ($x,$y,$d,$n)=($C[0]->[0],$C[0]->[1],$C[0]->[2],$C[0]->[3]);
 $c=$A[$x][$y];
 $A[$x][$y]='.';
 if($c=~m/[S+]/){
    if('L'ne$d&&$A[$x+1][$y]=~m/[+-]/){push(@_,[($x+1,$y,'R',$n+1)])}
    if('D'ne$d&&$A[$x][$y-1]=~m/[+|]/){push(@_,[($x,$y-1,'U',$n+1)])}
    if('R'ne$d&&$A[$x-1][$y]=~m/[+-]/){push(@_,[($x-1,$y,'L',$n+1)])}
    if('U'ne$d&&$A[$x][$y+1]=~m/[+|]/){push(@_,[($x,$y+1,'D',$n+1)])}
 }
 if($c eq'|'){
    if($d ne'U'&&$A[$x][$y+1]=~m/[+|<>^V]/){push(@_,[($x,$y+1,'D',$n+1)])}
    if($d ne'D'&&$A[$x][$y-1]=~m/[+|<>^V]/){push(@_,[($x,$y-1,'U',$n+1)])}
 }
 if($c eq'-'){
    if($d ne'L'&&$A[$x+1][$y]=~m/[+-<>^V]/){push(@_,[($x+1,$y,'R',$n+1)])}
    if($d ne'R'&&$A[$x-1][$y]=~m/[+-<>^V]/){push(@_,[($x-1,$y,'L',$n+1)])}
 }
 if($c=~m/[<>^V]/&&$n<$nr){
    if($c eq'>'&&$A[$x+1][$y]=~m/\w/){$cr=$A[$x+1][$y];$nr=$n}
    if($c eq'<'&&$A[$x-1][$y]=~m/\w/){$cr=$A[$x-1][$y];$nr=$n}
    if($c eq'V'&&$A[$x][$y+1]=~m/\w/){$cr=$A[$x][$y+1];$nr=$n}
    if($c eq'^'&&$A[$x][$y-1]=~m/\w/){$cr=$A[$x][$y-1];$nr=$n}
 }
 print_map()
}
print "$cr\n";
sub print_map {
    print "\033[2J"; #clearscreen
    print "\033[0;0H"; #cursor at 0,0
    for$j(1..$ym){for$i(1..$xm){print (($x==$i&&$y==$j)?'X':$A[$i][$j])}print"\n"}
    sleep 1;
}

Test
$ cat test_arrows6.txt
S-----+
|     +-^
+---+->B
    +---^

$ perl arrows.pl < test_arrows6.txt
.-----+
.     +-^
......XB
    .....
B

I saw the title and thought "Perl" and "done in 5 bytes". heart attack

PHP version (comments are french, sorry)
<?php
/*
* By Gnieark https://blog-du-grouik.tinad.fr oct 2015
* Anwser to "code golf" http://codegolf.stackexchange.com/questions/57952/where-is-the-arrow-pointing in PHP
*/
//ouvrir le fichier contenant la "carte et l'envoyer dans un array 2 dimmension
$mapLines=explode("\n",file_get_contents('./input.txt'));
$i=0;
foreach($mapLines as $ligne){
    $map[$i]=str_split($ligne,1);
    if((!isset($y)) && in_array('S',$map[$i])){
        //tant qu'à parcourir la carte, on cherche le "S" s'il n'a pas déjà été trouvé.
        $y=$i;
        $x=array_search('S',$map[$i]);
    }
    $i++;
}
if(!isset($y)){
    echo "Il n'y a pas de départ S dans ce parcours";
    die;
}
echo "\n".file_get_contents('./input.txt')."\nLe départ est aux positions ".$map[$y][$x]." [".$x.",".$y."]. Démarrage du script...\n";
$previousX=-1; // Contiendra l'ordonnée de la position précédente. (pour le moment, une valeur incohérente)
$previousY=-1; // Contiendra l'absycede la position précédente. (pour le moment, une valeur incohérente)
$xMax=count($map[0]) -1;
$yMax=count($map) -1;
$previousCrosses=array(); //On ne gardera en mémoire que les croisements, pas l'ensemble du chemin.
while(1==1){ // C'est un défi de codagee, pas un script qui sera en prod. j'assume.
    switch($map[$y][$x]){
        case "S":
            //même fonction que "+"
        case "+":
            //on peut aller dans les 4 directions
            $target=whereToGoAfterCross($x,$y,$previousX,$previousY);
            if($target){
          go($target[0],$target[1]);
            }else{
          goToPreviousCross();
            }
            break;
        case "s":
            goToPreviousCross();
            break;
        case "-":
        //déplacement horizontal
        if($previousX < $x){
          //vers la droite
          $targetX=$x+1;
          if(in_array($map[$y][$targetX],array('-','+','S','>','^','V'))){
        go($targetX,$y);
          }else{
        //On est dans un cul de sac
        goToPreviousCross();
          }
        }else{
          //vers la gauche
          $targetX=$x-1;
          if(in_array($map[$y][$targetX],array('-','+','S','<','^','V'))){
        go($targetX,$y);
          }else{
        //On est dans un cul de sac
        goToPreviousCross();
          }
        }
            break;
        case "|":
        //déplacement vertical
        if($previousY < $y){
          //on descend (/!\ y augmente vers le bas de la carte)
          $targetY=$y+1;
          if(in_array($map[$targetY][$x],array('|','+','S','>','<','V'))){
        go ($x,$targetY);
          }else{
        goToPreviousCross();
          }
        }else{
        //on Monte (/!\ y augmente vers le bas de la carte)
          $targetY=$y - 1;
          if(in_array($map[$targetY][$x],array('|','+','S','>','<','V'))){
        go ($x,$targetY);
          }else{
        goToPreviousCross();
          }
        }
            break;
    case "^":
    case "V":
    case ">":
    case "<":
      wheAreOnAnArrow($map[$y][$x]);
      break;
    }
}
function wheAreOnAnArrow($arrow){
  global $x,$y,$xMax,$yMax,$map;
  switch($arrow){
    case "^":
      $targetX=$x;
      $targetY=$y -1;
      $charsOfTheLoose=array(" ","V","-","s");
      break;
    case "V":
      $targetX=$x;
      $targetY=$y + 1;
      $charsOfTheLoose=array(" ","^","-","s");
      break;
    case ">":
      $targetX=$x + 1;
      $targetY=$y;
      $charsOfTheLoose=array(" ","<","|","s");
      break;
    case "<":
      $targetX=$x - 1;
      $targetY=$y;
      $charsOfTheLoose=array(" ",">","|","s");
      break;
    default:
      break;
  }
  if(($targetX <0) OR ($targetY<0) OR ($targetX>$xMax) OR ($targetY>$yMax) OR (in_array($map[$targetY][$targetX],$charsOfTheLoose))){
      //on sort du cadre ou on tombe sur un caractere inadapté
      goToPreviousCross();
  }else{
    if(preg_match("/^[a-z]$/",strtolower($map[$targetY][$targetX]))){
      //WIN
      echo "WIN: ".$map[$targetY][$targetX]."\n";
      die;
     }else{
      //on va sur la cible
      go($targetX,$targetY);
     }
  }
}
function whereToGoAfterCross($xCross,$yCross,$previousX,$previousY){

            //haut
            if(canGoAfterCross($xCross,$yCross +1 ,$xCross,$yCross,$previousX,$previousY)){
                return array($xCross,$yCross +1);
            }elseif(canGoAfterCross($xCross,$yCross -1 ,$xCross,$yCross,$previousX,$previousY)){
                //bas
                return array($xCross,$yCross -1);
            }elseif(canGoAfterCross($xCross-1,$yCross,$xCross,$yCross,$previousX,$previousY)){
                //gauche
                return array($xCross-1,$yCross);
            }elseif(canGoAfterCross($xCross+1,$yCross,$xCross,$yCross,$previousX,$previousY)){
                //droite
                return array($xCross+1,$yCross);
            }else{
          //pas de direction possible
          return false;
            }
}
function canGoAfterCross($xTo,$yTo,$xNow,$yNow,$xPrevious,$yPrevious){
    global $previousCrosses,$xMax,$yMax,$map;
    if(($xTo < 0) OR ($yTo < 0) OR ($xTo >= $xMax) OR ($yTo >= $yMax)){return false;}// ça sort des limites de la carte
    if(
    ($map[$yTo][$xTo]==" ") // on ne va pas sur un caractere vide
    OR (($xTo==$xPrevious)&&($yTo==$yPrevious)) //on ne peut pas revenir sur nos pas (enfin, ça ne servirait à rien dans cet algo)
    OR (($xTo==$xNow)&&($map[$yTo][$xTo]=="-")) //Déplacement vertical, le caractere suivant ne peut etre "-"
    OR (($yTo==$yNow)&&($map[$yTo][$xTo]=="|")) // Déplacement horizontal, le caractère suivant ne peut être "|"
    OR ((isset($previousCrosses[$xNow."-".$yNow])) && (in_array($xTo."-".$yTo,$previousCrosses[$xNow."-".$yNow]))) //croisement, ne pas prendre une direction déjà prise
   ){
      return false;
    }
    return true;
}
function go($targetX,$targetY){
    global $previousX,$previousY,$x,$y,$previousCrosses,$map;
    if(($map[$y][$x]=='S')OR ($map[$y][$x]=='+')){
        //on enregistre le croisement dans lequel on renseigne la direction prise et la direction d'origine
        $previousCrosses[$x."-".$y][]=$previousX."-".$previousY;
        $previousCrosses[$x."-".$y][]=$targetX."-".$targetY;
    }
    $previousX=$x;
    $previousY=$y;
    $x=$targetX;
    $y=$targetY;
    //debug
    echo "deplacement en ".$x.";".$y."\n";
}
function goToPreviousCross(){
  global $x,$y,$previousX,$previousY,$xMax,$yMax,$previousCrosses;

  /*
  * On va remonter aux précédents croisements jusqu'à ce
  * qu'un nouveau chemin soit exploitable
  */
  foreach($previousCrosses as $key => $croisement){
    list($crossX,$crossY)=explode("-",$key);
    $cross=whereToGoAfterCross($crossX,$crossY,-1,-1);
    if($cross){
      go($crossX,$crossY);
      return true;
    }
  }
  //si on arrive là c'est qu'on est bloqués
  echo "Aucun chemin n'est possible\n";
  die;
}

Haskell, 268 bytes
Congratulations to the Javascripters! Gave up the bounty, but here is what I got. May/Might not work in all cases, but actually handles arrows starting in and arrowheads conncting to +es, as far as I know. Didn't even include searching for the S, is just (0,0) for now.
import Data.List
x%m=length m<=x||x<0
a s(x,y)z|y%s||x%(head s)=[]|0<1=b s(x,y)z$s!!y!!x
b s(x,y)z c|g c>[]=filter(>' ')$concat[a s(x+i k,y+i(3-k))k|k<-g c,k-z`mod`4/=2]|0<1=[c]
i=([0,-1,0,1]!!)
g c=findIndices(c`elem`)$words$"V|+S <-+S ^|+S >-+S"
f s=a(lines s)(0,0)0

I would like to see an APL version in spirit of https://www.youtube.com/watch?v=a9xAKttWgP4
As a start, a vectorized Julia solution which I think can be translated 1:0.3 to APL or J. It takes a string R representing a L x K arrowgram. It first translates the matrix of symbols into a matrix of small 3x3 matrices whose patterns are the binary expansions of the letters of the string "\0\x18\fH\t]]\x1cI". For example '+' is encoded as reshape([0,digits(int(']'),2,8)],3,3)
  0 2 0
  2 2 2
  0 2 0

In this representation, the path consists of 2's and gets flooded by 3's from the starting point.
A=zeros(Int,L*3+3,K*3+3)
s(i,j=i,n=2)=A[i:end+i-n,j:end+j-n]
Q=Int['A':'Z';'a':'z']
for k=0:K-1,l=0:L-1
r=R[K*l+k+1]
q=search(b"V^><+S|-",r)
d=reverse(digits(b"\0\x18\fH\t]]\x1cI"[q+1],2,8))
A[1+3l:3l+3,1+3k:3k+3]=2*[d;0]
A[3l+2,3k+2]+=r*(r in Q&&r!='V'&&r!='^')+(1-r)*(r=='S')+3(5>q>0)
end
m=0
while sum(A)>m
m=sum(A)
for i=0:1,j=1:2,(f,t)=[(3,6),(11,15)]
A[j:end+j-2,j:end+j-2]=max(s(j),f*(s(j).*s(2-i,1+i).==t))
end
end
for i=[1,4],k=Q
any(s(1,1,5).*s(5-i,i,5).==11*k)&&println(Char(k))
end

To test,
   R=b"""
       d  S------+    b
                 |
                 |
          c      +--->a
       """;

   K=search(R,'\n') # dimensions
   L=div(endof(R),K)

   include("arrow.jl")

a

By the way, I think the clause "Another + may be adjacent but the arrow should prioritize going on a - or | first." puts a vector approach at a disadvantage. Anyway, I just ignored it.


text:
Extended Domino Dots
Introduction
Classes have started! And so does the boredom. I decided to doodle in my notebook and started to draw some dots in (IMO) an aesthetically pleasing way. I came up with these numbers:

based on these conditions:
Given (n, m)
1) There must be n dots
2) All dots must lie on an m by m lattice
3) The position of the dots must minimize the spread* from the top left corner
4) The configuration of the dots must be diagonally symmetric as pictured:

*Spread (in this context) is defined as the sum of the distances from the top left dot position (whether or not there is a dot there). For example, the spread of the example above is 0 + 1 + 2 + 1 + √2 + 2 + 2√2 = 6 + 3√2
The Challenge
Come up with an algorithm using that uses natural numbers n and m (where it will always be that n <= m^2) to generate a configuration of dots that follow all the rules above.
Input can be received via STDIN, command-line argument, or function parameter.
Output the pattern to STDOUT or return a string with newlines. Any two different characters may be used in the output.
(e.g.
110
100
000

is the same as
**-
*--
---

Shortest Code in Bytes Wins
Example
STDIN: 6 3
STDOUT:
***
**_
*__

The Challenge has Ended!!!
After seven days I decided to declare the winner, but first some special awards!
Fastest code goes to... orlp with his submission in Pyth !
Slowest code goes to... orlp with his submission in Pyth !
Most straightforward code goes to... orlp with his submission in Pyth !
Most confusing code goes to... orlp with his submission in Pyth !
Longest Code goes to... orlp with his submission in Pyth !
And last but not least
Shortest code goes to......... orlp with his submission in Pyth !
Congratulations!

I updated the conditions so that 10 3 will never be an input. Also 0 is not a natural number so 0 0 will also never be an input

natural numbers is ambiguous. The set-theoretic definition of natural number, e.g., includes 0. To avoid confusion, it's preferable to use (strictly) positive integers.

@Dennis Also, if one specifically wants to include zero, nonnegative integers are a good choice.

What if there there are several valid solutions? E.g. 24 6.

@steveverrill I think they're sqrt(1^2+2^2)=sqrt(5)

@MartinBüttner Kudos for finding a case with two solutions! In such cases, just one solution is enough.

@KoreanwGlasses finding these cases isn't too hard. 24 6 is just the first case where you can put two dots on a diagonal which corresponds to a Pythagorean triple.

Pyth, 37 bytes
jc:*d*QQiRQhos.aMNf.Am}_dTT.c^UQ2vzNQ

Slow solution. Generates all possible pairs of [0, m), generate all possible n-combinations of those pairs (without repetition). Filter each combination of pairs such that if P is in the combination, so is reverse(P). This guarantees diagonal symmetry. Sort by the sum of distances to the origin. Decode the pairs of numbers as base-m numbers, giving a list of indices. Create a string of spaces except for those indices, putting quotation marks instead. Finally chop into m pieces and join by newlines. Creates outputs like such:
""""
"""
""
"