text:
Exploded Suffixes
Given an ASCII string, output the exploded suffixes of it. For example, if the string was abcde, there are 5 suffixes, ordered longest to shortest:
abcde
bcde
cde
de
e

Each suffix is then exploded, meaning each character is copied as many times as its one-indexed location in that suffix. For example, exploding the suffixes of abcde,
abcde
12345
abbcccddddeeeee

bcde
1234
bccdddeeee

cde
123
cddeee

de
12
dee

e
1
e

Altogether, the exploded suffixes of abcde are
abbcccddddeeeee
bccdddeeee
cddeee
dee
e

Rules

This is code-golf so the shortest code wins.
The input will consist of the printable ASCII characters. (This excludes newlines but includes spaces.)
The output will have each string on a separate line.
Trailing spaces are allowed on each line and there may be an extra newline at the end.

Test Cases
''

'a'
a

'bc'
bcc
c

'xyz'
xyyzzz
yzz
z

'code-golf'
coodddeeee-----ggggggooooooollllllllfffffffff
oddeee----gggggoooooolllllllffffffff
dee---ggggooooollllllfffffff
e--gggoooolllllffffff
-ggooollllfffff
goolllffff
ollfff
lff
f

's p a c e'
s  ppp    aaaaa      ccccccc        eeeeeeeee
 pp   aaaa     cccccc       eeeeeeee
p  aaa    ccccc      eeeeeee
 aa   cccc     eeeeee
a  ccc    eeeee
 cc   eeee
c  eee
 ee
e

Related, sorta.

Related. Related. Related.

What happen in 'ccodegolf'?

Jelly, 5 bytes
ṫJxJY

Try it online! or verify all test cases.
How it works
ṫJxJY  Main link. Argument: s (string)

 J     Indices; yield I := [1, ..., len(s)].
ṫ      Tail; get the suffixes of s starting at indices [1, ..., len(s)].
   J   Indices; yield I again.
  x    Repeat. The atom 'x' vectorizes at depth 1 (1D arrays of numbers/characters)
       in its arguments. This way, each suffix t gets repeated I times, meaning
       that the first character of t is repeated once, the second twice, etc.
       If left and right argument have different lengths, the longer one is
       truncated, so I can safely be applied to all suffixes.
    Y  Join, separating by linefeeds.

J, 22 12 8 bytes
Thanks to miles for saving 14 bytes!
(#~#\)\.

Now this is a really nice solution. Pretty succinct, too.
This is the hook #~#\ applied to the suffixes (\.) of the input. The hook, when called on input y, is decomposed as thus:
(#~#\) y
y #~ #\ y

Here are some intermediate results:
   ]s =: 's p a c e'
s p a c e
   #\ s
1 2 3 4 5 6 7 8 9
   (quote) s
's p a c e'
   (quote;#)\ s
+-----------+-+
|'s'        |1|
+-----------+-+
|'s '       |2|
+-----------+-+
|'s p'      |3|
+-----------+-+
|'s p '     |4|
+-----------+-+
|'s p a'    |5|
+-----------+-+
|'s p a '   |6|
+-----------+-+
|'s p a c'  |7|
+-----------+-+
|'s p a c ' |8|
+-----------+-+
|'s p a c e'|9|
+-----------+-+
   1 2 3 # '123'
122333
   3 3 3 # '123'
111222333
   ]\. s
s p a c e
 p a c e
p a c e
 a c e
a c e
 c e
c e
 e
e
   quote\. s
's p a c e'
' p a c e'
'p a c e'
' a c e'
'a c e'
' c e'
'c e'
' e'
'e'
   (#~#\) s
s  ppp    aaaaa      ccccccc        eeeeeeeee
   (#~#\)\. s
s  ppp    aaaaa      ccccccc        eeeeeeeee
 pp   aaaa     cccccc       eeeeeeee
p  aaa    ccccc      eeeeeee
 aa   cccc     eeeeee
a  ccc    eeeee
 cc   eeee
c  eee
 ee
e

Test cases
   f =: (#~#\)\.
   f
(#~ #\)\.
   f ''
   f 'a'
a
   f 'bc'
bcc
c
   f 'xyz'
xyyzzz
yzz
z
   f 'code-golf'
coodddeeee-----ggggggooooooollllllllfffffffff
oddeee----gggggoooooolllllllffffffff
dee---ggggooooollllllfffffff
e--gggoooolllllffffff
-ggooollllfffff
goolllffff
ollfff
lff
f
   f 's p a c e'
s  ppp    aaaaa      ccccccc        eeeeeeeee
 pp   aaaa     cccccc       eeeeeeee
p  aaa    ccccc      eeeeeee
 aa   cccc     eeeeee
a  ccc    eeeee
 cc   eeee
c  eee
 ee
e

   ]tc =: <;._1 '|' , '|a|bc|xyz|code-golf|s p a c e'
++-+--+---+---------+---------+
||a|bc|xyz|code-golf|s p a c e|
++-+--+---+---------+---------+
   ,. f &. > tc
+---------------------------------------------+
+---------------------------------------------+
|a                                            |
+---------------------------------------------+
|bcc                                          |
|c                                            |
+---------------------------------------------+
|xyyzzz                                       |
|yzz                                          |
|z                                            |
+---------------------------------------------+
|coodddeeee-----ggggggooooooollllllllfffffffff|
|oddeee----gggggoooooolllllllffffffff         |
|dee---ggggooooollllllfffffff                 |
|e--gggoooolllllffffff                        |
|-ggooollllfffff                              |
|goolllffff                                   |
|ollfff                                       |
|lff                                          |
|f                                            |
+---------------------------------------------+
|s  ppp    aaaaa      ccccccc        eeeeeeeee|
| pp   aaaa     cccccc       eeeeeeee         |
|p  aaa    ccccc      eeeeeee                 |
| aa   cccc     eeeeee                        |
|a  ccc    eeeee                              |
| cc   eeee                                   |
|c  eee                                       |
| ee                                          |
|e                                            |
+---------------------------------------------+

Cool, another way to save some bytes is by using the prefix adverb

@miles what do you mean?

You can get the length of each prefix as a shorter way of generating that range

@miles Ah, of course.

Python, 61 bytes
f=lambda s,i=0:s[i:]and-~i*s[i]+f(s,i+1)or s and'\n'+f(s[1:])

Alternative 63:
f=lambda s,b=1:s and f(s[:-1],0)+s[-1]*len(s)+b*('\n'+f(s[1:]))

Python 3, 91 68 65 bytes
def f(s):f(s[1:print(''.join(i*c for i,c in enumerate(s[0]+s)))])

Terminates with an error after printing the desired output. Test it on Ideone.
How it works
Before f can call itself recursively, the indices of s[1:...] have to be computed.
First enumerate(s[0]+s) yields all pairs (i, c) of characters c of s – with its first character duplicated – and the corresponding indices i. Prepending s[0] serves two purposes here.

The first character of s has to be repeated once, but the first index is 0.
Once all characters have been processed, s[0] will raise an IndexError, causing f to terminate with an error rather than printing newlines until the recursion limit is reached.

''.join(i*c for i,c in ...) builds a flat string of each c repeated i times, which print echoes to STDOUT.
Finally, since print returns None and s[1:None] is simply s[1:], the recursive call f(s[1:...]) repeats the above process for s without its first character.

Perl 6, 38 bytes
m:ex/.+$/.map:{put [~] .comb Zx 1..*}

37 bytes + 1 for -n command line switch
Example:
$ perl6 -ne 'm:ex/.+$/.map:{put [~] .comb Zx 1..*}' <<< 'code-golf'
coodddeeee-----ggggggooooooollllllllfffffffff
oddeee----gggggoooooolllllllffffffff
dee---ggggooooollllllfffffff
e--gggoooolllllffffff
-ggooollllfffff
goolllffff
ollfff
lff
f

Expanded:
# -n command line switch takes each input line and places it in ｢$_｣

# You can think of it as surrounding the whole program with a for loop
# like this:
for lines() {

  # match
  m
  :exhaustive # every possible way
  / .+ $/     # at least one character, followed by the end of the string

  .map:

  {
    put           # print with newline
      [~]         # reduce using string concatenation ( don't add spaces between elements )
        .comb     # split into individual chars
        Z[x]      # zip using string repetition operator
        1 .. *    # 1,2,3,4 ... Inf
  }

}

Brachylog, 17 bytes
@]Elyk:Erz:jac@w\

Try it online!
Explanation
@]E                 E is a suffix of the Input
   lyk              The list [0, ..., length(E) - 1]
      :Erz          The list [[0th char of E, 0], ..., [Last char of E, length(E) - 1]]
          :ja       For all elements of that list, concatenate the Ith char I times to itself
             c      Concatenate the list into a string
              @w    Write followed by a line break
                \   False: backtrack to another suffix of the Input

Haskell, 48 bytes
e=map(concat.zipWith replicate[1..]).scanr(:)[]

is interfaced by any of
ghc exploded_suffixes.hs -e 'e"abcde"'
ghc exploded_suffixes.hs -e 'mapM_ putStrLn.e=<<getLine' <<<code-golf
ghc exploded_suffixes.hs -e 'Control.Monad.forever$putStr.unlines.e=<<getLine'

I like the pointfree-ness. You should put your 63-byte code in its own block and then show the invocation separately.

You don't need putStr., we accept as function output. You do need to import Data.List though to use tails.

You can replace uncurry ... zip with zipWith: unlines.map(concat.zipWith replicate[1..]).tails.

Yes indeed!  The zipWith replicate shorten also occured to me when i awoke.
Pity that tails is not in Prelude i could fetch tails from Data.List implicitly without a full import  and still without outgrowing the foldr equivalent.
Regarding purity without IO boiler-plate i would also leave the mapM_ putStrLn seasoning to readers' tastes and perform no unlines either.  Defining a block e= would cost byte count.

Using qualified names without imports is not standard Haskell, but a feature of the ghci repl. Depending on such things counts as a separate language, so I suggest to change the title of your answer to something like Haskell (ghci). (See also this meta discussion ).

The challenge asks for a string output, so you need something like unlines. You can get suffixes shorter without the import.

C#, 101 bytes
f=s=>{var r="\n";for(int i=0;i<s.Length;)r+=new string(s[i],++i);return""==s?r:r+f(s.Substring(1));};

Recursive anonymous function, which also prints a leading newline. If the leading newline is not allowed, 3 extra bytes turn it into a trailing newline:
f=s=>{var r="";for(int i=0;i<s.Length;)r+=new string(s[i],++i);return""==s?r:r+"\n"+f(s.Substring(1));};

Full program with ungolfed method and test cases:
using System;

namespace ExplodedSuffixes
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<string, string> f = null;
            f = s =>
            {
                var r = "\n";
                for (int i = 0; i < s.Length; )
                    r += new string(s[i], ++i);
                return "" == s ? r : r + f(s.Substring(1));
            };

            // test cases:
            string x = "abcde";
            Console.WriteLine("\'" + x + "\'" + f(x));
            x = "";
            Console.WriteLine("\'" + x + "\'" + f(x));
            x = "a";
            Console.WriteLine("\'" + x + "\'" + f(x));
            x = "bc";
            Console.WriteLine("\'" + x + "\'" + f(x));
            x = "xyz";
            Console.WriteLine("\'" + x + "\'" + f(x));
            x = "code-golf";
            Console.WriteLine("\'" + x + "\'" + f(x));
            x = "s p a c e";
            Console.WriteLine("\'" + x + "\'" + f(x));
        }
    }
}

05AB1E, 13 bytes
.sRvyvyN>×}J,

Try it online!
Explanation
.s              # push list of suffixes of input
  R             # reverse the list
   vy           # for each string
     vy   }     # for each char in string
       N>×      # repeat it index+1 times
           J,   # join and print with newline

CJam, 14 bytes
Sl+{_eee~n1>}h

Try it online!
Explanation
Sl+   e# Read input and prepend a space.
{     e# While the string is non-empty...
  _   e#   Make a copy.
  ee  e#   Enumerate. Gives, e.g. [[0 ' ] [1 'a] [2 'b] [3 'c]].
  e~  e#   Run-length decode. Gives "abbccc".
  n   e#   Print with trailing linefeed.
  1>  e#   Discard first character.
}h

Java, 150 127 bytes
Edit:

-23 bytes off. Thanks to @Kevin Cruijssen

Snipet:
f->{String s[]=f.split(""),o="";int i=-1,j,l=s.length;for(;++i<l;)for(j=-2;++j<i;o+=s[i]);return l<1?"":o+"\n"+f.substring(1);}

Ungolfed:
public static String explodeSuff(String suff){
  char [] s = suff.toCharArray();
  String out = "";
  if(s.length==0)return "";
  for(int i=-1;++i<s.length;){
    for(int j=-2;++j<i;){
      out+=s[i];
    }
  }
  return out+"\n"+suff.subString(1);
}

Hi, you can golf it quite a bit simply by removing spaces and some small tricks: f->{String s[]=f.split(""),o="";int i=-1,j,l=s.length;for(;++i<l;)for(j=-2;++j<i;o+=s[i]);return l<1?o:o+"\n"+f.substring(1);}

Perl, 36 + 1 (-n) = 37 bytes
/.+$(?{$.=say$&=~s%.%$&x$.++%rge})^/

Needs -n and -E (or -M5.010) to run :
perl -nE '/.+$(?{$.=say$&=~s%.%$&x$.++%rge})^/' <<< "code-golf"

Note that it works on only one instance each time you run it (because it uses the variable $. which is incremented every time a line is read, so it hold 1 only the first time a line is read). (But no problem here, just ^D and re-run it!)

Retina, 31 bytes
Byte count assumes ISO 8859-1 encoding.
M&!`.+

$.%`$*»
%+r`»($|.)
$1$1

Try it online!

Racket 184 bytes
(let p((l(string->list s))(ol'()))(cond[(null? l)(display(list->string(flatten ol)))]
[else(p(cdr l)(append ol(list #\newline)(for/list((i l)(n(length l)))(for/list((j(+ 1 n)))i))))]))

Ungolfed:
(define(f s)
 (let loop((l(string->list s))
             (outl '()))
    (cond
      [(null? l)
       (display
        (list->string
         (flatten outl)))]
      [else
       (loop
        (rest l)
        (append outl
                (list #\newline)
                (for/list ((i l)
                           (n (length l)))
                  (for/list ((j (add1 n)))
                    i
                    ))))]  )))

(f "abcde")
(f "xyz")

Output:
abbcccddddeeeee
bccdddeeee
cddeee
dee
e

xyyzzz
yzz
z

JavaScript (ES6), 65 bytes

f=s=>s?[s.replace(/./g,(c,i)=>c.repeat(i+1)),...f(s.slice(1))]:[]
<input oninput=o.textContent=f(this.value).join`\n`><pre id=o>

Previous attempts:
67: s=>[...s].map((_,i)=>s.slice(i).replace(/./g,(c,i)=>c.repeat(i+1)))
84: s=>s.replace(/./g,`$&$'
    `).match(/.+/g).map(s=>s.replace(/./g,(c,i)=>c.repeat(i+1)))
89: f=(s,t=s.replace(/./g,(c,i)=>c.repeat(i+1)))=>t?[]:[t,...f(s,t.replace(/(.)(?=\1)/g,''))]

MATL, 12 bytes
&+gYRYs"G@Y"

I love it when quote marks come together!
Try it online!
Explanation
This works by building a matrix whose columns are used, one by one, to run-length decode the input. As an example, for input 'abcde' the matrix is
1 0 0 0 0
2 1 0 0 0
3 2 1 0 0
4 3 2 1 0
5 4 3 2 1

Code:
&+g    % Implicit input. NxN matrix of ones, where N is input size
YR     % Set entries above diagonal to zero
Ys     % Cumulative sum of each column. This gives the desired matrix
"      % For each column
  G    %   Push input (for example 'abcde')
  @    %   Push current column (for example [0;0;1;2;3])
  Y"   %   Run-length decode (example output 'cddeee')
       % Implicit end
       % Implicit display

PHP, 103 bytes (99 with short tags)
<?php for($s=$argv[1];""!=$s[$i++];$o.="
")for($j=0;""!=$l=$s[$j+$i-1];)$o.=str_pad('',++$j,$l);echo$o;

I'm pretty certain this isn't the shortest possible answer.

Python 3, 95 bytes
def f(s):return'\n'.join(''.join(s[j:][i]*(i+1)for i in range(len(s)-j))for j in range(len(s)))

This was surprisingly harder than I expected it to be. I redid my whole function maybe 4 times.

Java 7,140 bytes
void c(char[]a,int l,int j){if(l<1)return;c(a,--l,++j);for(int i=0,k;i<j;i++)for(k=0;k++<=i;)System.out.print(a[i+l]);System.out.println();}

Ungolfed
 void c(char[]a,int l,int j)
{
if (l < 1)
return ;
c(a , --l , ++j) ;
for(int i = 0 , k; i < j ; i++)
for(k = 0 ; k++ <= i ;)
System.out.print(a[i+l]);
System.out.println();
}

Following line giving me very pain.i don't know how can i golfed it(because there are two loops to break the condition to put "\n" in print statement).
System.out.println();

How about a proper method which doesn't require sending the array length too as an argument? Currently one can trigger an IndexOutOfBounds exception by sending a wrong value accidentally...

Pyke, 12 bytes
VilS],A*s
}t

Try it here!

Ruby, 51 bytes
Uses the -n flag for +1 byte.
(k=0;puts$_.gsub(/./){$&*k+=1};$_[0]="")while$_>$/

R, 108 bytes
Read input from stdin and prints to stdout
s=scan(,"");n=nchar(s);for(i in 1:n)cat(do.call("rep",list(strsplit(s,"")[[1]][i:n],1:(n-i+1))),"\n",sep="")

I felt the use of do.call was appropriate here. It basically takes two inputs: 1. a function name in form of a string (rep here) and a list of arguments and 2. iteratively applies calls the function using the arguments in the list.
E.g.:

rep("c",3) produces the vector "c" "c" "c"
do.call("rep",list(c("a","b","c"),1:3)) produces the vector "a" "b" "b" "c" "c" "c"
which is equivalent to consecutively calling rep("a",1), rep("b",2) and rep("c",3)

C, 186 Bytes
#include <string.h>
#define S strlen
p(char* s){char *t=s;char u[999]="";for(int i=0;i<S(s);i++){for(int j=i+1;j>0;j--){sprintf(u+S(u),"%c",*t);}t++;}printf("%s\n",u);if(S(s)>1)p(s+1);}

This probably can be shortened quite a bit, but I just wanted to try it. It's my second try at golf, so give me any pointers (*lol) you can. It takes a string as a parameter and does the exploding from there. u is used as a buffer that stores the exploded string.
Ungolfed:
#include <string.h>
#define S strlen
p(char* s){
    char *t=s;
    char u[999]="";
    for(int i=0;i<S(s);i++){
        for(int j=i+1;j>0;j--){
            sprintf(u+S(u),"%c",*t);
        }
        t++;
    }
    printf("%s\n",u);
    if(S(s)>1)p(s+1);
}

Acc!!, 150 bytes
Expects input on stdin, terminated with a tab character.
N
Count c while _/128^c-9 {
_+N*128^(c+1)
}
Count i while _-9 {
Count j while _/128^j-9 {
Count k while j+1-k {
Write _/128^j%128
}
}
Write 10
_/128
}

Explanation
This is actually a pretty good task for Acc!!, since it only requires reading a string and iterating over it with some nested loops. We read the string into the accumulator, treating it as a sequence of base-128 digits, with the first character on the low-order end. After the opening Count c loop, the accumulator value can be conceptualized like this (using xyz as example input):
128^   3  2  1  0
     tab  z  y  x

(The actual accumulator value for this example is 9*128^3 + 122*128^2 + 121*128 + 120 = 20888824.)
We can then iterate over the string by iterating over increasing powers of 128. And we can iterate over the suffixes by dividing the accumulator by 128 after each iteration, chopping off a character.
With indentation and comments:
# Initialize the accumulator with the first input character
N
# Loop until most recent input was a tab (ASCII 9)
Count c while _/128^c - 9 {
    # Input another character and add it at the left end (next higher power of 128)
    _ + N * 128^(c+1)
}

# Loop over each suffix, until only the tab is left
Count i while _ - 9 {
    # Loop over powers of 128 until the tab
    Count j while _/128^j - 9 {
        # Loop (j+1) times
        Count k while j + 1 - k {
            # Output the j'th character
            Write _ / 128^j % 128
        }
    }
    # Output a newline
    Write 10
    # Remove a character
    _/128
}

Vim, 43 bytes
qqYlpx@qq@qqr0<C-H><C-V>{$:s/\v%V(.)\1*/&\1/g<CR>@rq@r
First macro separates the suffixes, second macro "explodes" them. Likely beatable. Spaces are annoying.

Vyxal j, 6 bytes
ÞKvÞżṠ

Try it Online!

Knight, 48 bytes
;=xP Wx;=iF;W<=i+1i+1LxO+*Gx-iT1i"\";O""=xSxF1""

Try it online!


text:
Natural Pi #1 - Sand
Goal
Generate (N) random line segments of uniform length (l), check if they cross the equidistant (t) parallel lines.
Simulation
What are we simulating? Buffon's needle. Smooth out the sand in your sandbox, draw a set of equally spaced parallel lines (call the distance in between t). Take a straight stick of length l and drop it N times into the sandbox. Let the number of times it crossed a line be c. Then Pi = (2 * l * n) / (t * c)!
How are we simulating this?

Take input N,t,l
With N, t, l all being positive integers
Do the following N times:

Generate a uniformly random integer coordinate x,y
With 1 <= x, y <= 10^6
x,y is the center of a line segment of length l
Generate a uniformly random integer a
With 1 <= a <= 180
Let P be the point where the line segment would cross the x-axis
Then a is the angle (x,y), P, (inf,0)

Count the number, c, of line segments that cross the line x = i*t for any integer i
Return (2 * l * N) / (t * c)

Specification

Input

Flexible, take input in any of the standard ways (eg function parameter,STDIN) and in any standard format (eg String, Binary)

Output

Flexible, give output in any of the standard ways (eg return, print)
White space, trailing and leading white space is acceptable
Accuracy, please provide at least 4 decimal places of accuracy (ie 3.1416)

Scoring

Shortest code wins!

Test Cases
Your output may not line up with these, because of random chance. But on average, you should get about this much accuracy for the given value of N, t, l.
Input (N,t,l)    ->  Output
-----------        ------
10,10,5          -> ?.????
10,100,50        -> ?.????
1000,1000,600    -> 3.????
10000,1000,700   -> 3.1???
100000,1000,700  -> 3.14??

TL;DR
These challenges are simulations of algorithms that only require nature and your brain (and maybe some re-usable resources) to approximate Pi. If you really need Pi during the zombie apocalypse, these methods don't waste ammo! There are nine challenges total.

I thought you already did number 1?

@ConorO'Brien I zero-index it XD

the problem with this is, in languages without complex numbers, you need to turn the number 0..180 into 0..pi, which rather defeats the purpose of the buffon`s needle experiment.

@NonlinearFruit can the direction a be also created by another method, if it is uniform? (thinking of a 2D Gauss Bubble)

@LevelRiverSt You could generate random values for sin ( [-1,1] then calculate cos ) and use that, if your language is unable to use the prescribed method.

@KarlNapf The calculation for the direction of the segment is flexible. Anything that gives the segment uniform probability of facing any direction will work (as long as it is at least as granular as the given method).

Can a fraction be output?

@LegionMammal978 Fractions are acceptable

Can it be assumed that t > l? Two solutions below make this assumption, which simplifies the check for intersection quite a bit.

@primo Good catch. t could be equal to 1. "all being positive integers"

R, 113 100 75 70 68 67 65 59 63 57 bytes
As a statistical, functional programming language, it's not surprising that R is fairly well-suited to this kind of task. The fact that most functions can take vectorized input is really helpful for this problem, as rather than looping over N iterations, we just pass around vectors of size N. Thanks to @Billywob for some suggestions that lead to cutting off 4 bytes. Many thanks to @Primo for patiently explaining to me how my code wasn't working for cases where t > l, which is now fixed.
pryr::f(2*l*N/t/sum(floor(runif(N)+sinpi(runif(N))*l/t)))

Try it online!
Sample output:
N=1000, t=1000, l=500
3.037975

N=10000, t=1000, l=700
3.11943

N=100000, t=1000, l=700
3.140351

Explanation
The problem boils down to determining whether the two x values of the needle are on either side of a parallel line. This has some important consequences:

y-values are irrelevant
The absolute location on the x-axis is irrelevant, only the position relative to the closest parallel lines.

Essentially this is a task in a 1-dimensional space, where we generate a line with length in [0, l] (the angle a determines this length), and then we check to see how many times this length exceeds t. The rough algorithm is then:

Sample x1 values from [0, 1000000]. Since parallel lines occur at every tth point along the x-axis, the relative x-position is x modulo t.
Sample an angle a.
Calculate the x2 position based on a.
Check how many times x1+x2 fits into t, i.e. take the floor of (x1+x2)/t.

Sampling N numbers in [0, 1e6] modulo t is equivalent to simply sampling N numbers in [0, t]. Since (x1+x2)/t is equivalent to x1/t + x2/t, the first step becomes sampling from [0, t]/t, i.e. [0, 1]. Lucky for us, that is the default range for R's runif function, which returns N real numbers from 0 to 1 from a uniform distribution.
                          runif(N)

We repeat this step to generate a, the angle of the needle.
                                         runif(N)

These numbers are is interpreted as a half-turn (i.e. .5 is 90 degrees). (The OP asks for degrees from 1 to 180, but in comments it's clarified that any method is allowed if it is as or more precise.) For an angle θ, sin(θ) gives us the x-axis distance between the ends of the needle. (Normally you'd use the cosine for something like this; but in our case, we are considering the angle θ as being relative to the y-axis, not the x-axis (that is, a value of 0 degrees goes up, not right), and therefore we use the sine, which basically phase-shifts the numbers.) Multiplied by l this gives us the x location of the end of the needle.
                                   sinpi(runif(N))*l

Now we divide by t and add the x1 value. This yields (x1+x2)/t, which is how far the needle protrudes from x1, in terms of number of parallel lines. To get the integer of how many lines were crossed, we take the floor.
                    floor(runif(N)+sinpi(runif(N))*l/t)

We calculate the sum, giving us the count c of how many lines are crossed by needles.
                sum(floor(runif(N)+sinpi(runif(N))*l/t))

The rest of the code is just implementing the formula for approximating pi, that is, (2*l*N)/(t*c). We save some bytes on parentheses by taking advantage of the fact that (2*l*N)/(t*c) == 2*l*N/t/c:
        2*l*N/t/sum(floor(runif(N)+sinpi(runif(N))*l/t))

And the whole thing is wrapped into an anonymous function:
pryr::f(2*l*N/t/sum(floor(runif(N)+sinpi(runif(N))*l/t)))

@rturnbull Nice one! Shouldn't you be able to skip the parentheses in the beginning though? (2*l*N) => 2*l*N?

@Billywob Well-spotted! Thanks.

@rturnbull Oh and by the way, (2*l*N)/(t*c) = 2*l*N/t/c so you can save another two bytes by skipping the parentheses on the last part as well.

@Billywob Again, well-spotted! Thanks again.

@primo Thanks again, it should be fixed now.

I giggled at sinpi, senpai.

Perl, 97 bytes
#!perl -p
/ \d+/;$_*=2*$'/$&/map{($x=(1+~~rand 1e6)/$&)-$a..$x+($a=$'/$&/2*sin~~rand(180)*71/4068)-1}1..$_

Counting the shebang as one, input is taken from stdin, space separated. If non-integer random values were allowed, this could be somewhat shorter.
I have taken one liberty, approximating π/180 as 71/4068, which is accurate within 1.48·10-9.
Sample Usage
$ echo 1000000 1000 70000 | perl pi-sand.pl
3.14115345174061

More-or-less mathematically equivalent substitutions
Assuming the x-coordinate represents the left-most point of the needle, rather than its middle, as specified in the problem description:
89 bytes
#!perl -p
/ \d+/;$_*=2*$'/$&/map{($x=(1+~~rand 1e6)/$&)..$x+($'/$&*sin~~rand(180)*71/4068)-1}1..$_

The problem specifies that x is to be sampled as a random integer. If we project the line spacing to a gap of one, this will leave us with values of the form n/t with 0 <= n < t, not necessarily uniform, if t does not evenly divide 1e6. Assuming that a uniform distribution is nonetheless acceptable:
76 bytes
#!perl -p
/ \d+/;$_*=2*$'/$&/map{($x=rand)..$x+($'/$&*sin~~rand(180)*71/4068)-1}1..$_

Note that since rand will always be less than one (and therefore truncated to zero), it is not necessary at the start of the range:
70 bytes
#!perl -p
/ \d+/;$_*=2*$'/$&/map{1..(rand)+($'/$&*sin~~rand(180)*71/4068)}1..$_

Assuming that the angle of the needle need not be an integer degree, but only uniformly random:
59 bytes
#!perl -p
/ \d+/;$_*=2*$'/$&/map{1..(rand)+abs$'/$&*sin rand$`}1..$_

Assuming that the angle may be any uniform distribution:
52 bytes
#!perl -p
/ \d+/;$_*=2*$'/$&/map{1..(rand)+abs$'/$&*sin}1..$_

The above is a mathematically correct simulation of Buffon's Needle. However, at this point I think most people would agree that this isn't actually what the question asked for.

Really pushin' it
We could just throw away half of the test cases, whenever the second endpoint is to the left of the first (rather than swapping them):
47 bytes
#!perl -p
/ \d+/;$_*=$'/$&/map{1..(rand)+$'/$&*sin}1..$_

Note that the values of t and l are inconsequential to the results of the experiment. We could just ignore them (implicitly assuming them to be equal):
28 bytes
#!perl -p
$_/=map{1..(rand)+sin}1..$_

Obviously non-competing, but you have to admit, it does have a certain elegance to it.

Python 2, 141 bytes
shameless port of rtumbull, already skipping y because totally not needed.
from math import*
from random import*
lambda N,t,l:(2.*l*N)/(t*sum(randint(1,1e6)%t+abs(cos(randint(1,180)*pi/180))*l>t for _ in range(N)))

Problem is only, that pi is already known in the program.
Here it is (golfable) with unknown pi and no trigonometric functions
def g(N,t,l):
 c=0
 for _ in range(N):
    x,y=gauss(0,1),gauss(0,1);c+=randint(1,1e6)%t+abs(x/sqrt(x*x+y*y))*l>t
 return(2.*l*N)/(t*c)

x,y in g is only for the direction.

Requires from random import randint;from math import cos,pi. Fails for t < l, e.g. 1000000,1000,70000.

source: Stack Exchange

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

sort: votes


text:
How many answers does this question have?
Write a program or a function that outputs the integer number of answers this question has. Your solution should still work as more answers are added.
Languages that run in a browser may be run from the js console while on this page. Otherwise, you'd probably have to download this page. Multi-language solutions, e.g. wgeting the page and parsing it using grep is ok. Just sum up the command line and all source used.
This is code golf; shortest answer in bytes wins.
EDIT:
Let's allow at most one occourance of the url of this page to not count, either as input or in the source. No url shorteners, no data stored as get parameters etc. Quotes around url, if needed, still count. Taking the url as input is also fine. If you want to remove some part of the url, e.g. /how-many-answers..., you can, but it probably doesn't help you.

It's probably too late to rule on this now, but should the count include deleted answers?

@Dennis I cannot see deleted answers, so I would say nobody has to worry about them. Count them if you want to. I won't count them since I cannot see them.

Can the function accept the url as an input? Would the input then count towards the bytecount?

@JHM yes and yes

@JHM or maybe no, as Dennis points out below one of the answers, it's unfair against browser code to count the url's. If that's the case, then I'd say url constants maybe shouldn't count either. What do you people think?

Please define "output". Do you mean that it returns that integer, or that it outputs the integer in a human readable format?

@FilipHaglund, I think that it would make most sense to have the URL byte count in the code be subtracted from the total count or have it be taken as input because that sort of makes it impossible for languages that don't run in the browser to have a chance at winning

@Dopapp Subtract from byte count is slippery. Some languages have ways to compress the URL.

@Dennis, then maybe it could optionally be taken as input?

That (although in some languages taking input could require even more bytes) or only allow to subtract if the URL http://... appears verbatim in the source code.

@Mayken when the code is executed, I want to see "9" on the screen. If you use a repl, return values are fine, since it prints them to the screen. Also ints vs strings; both are fine (but please don't output quotation marks).

Let's allow at most one occourance of the url of this page to not count, either as input or in the source. No url shorteners, no data stored as get parameters etc. Quotes around url, if needed, still count. Taking the url as input is also fine. If you want to remove some part of the url, e.g. /how-many-questions..., you can, but it probably doesn't help you.

You should add that to the question. This comment is hidden by default, so not everybody will see it before answering.

-1, not enough jQuery in all those answers.

Javascript + jQuery, 23 bytes
_=>+$("h2>span").text()

Couldn't this fail if there's an h2>span in the body of the challenge?

@MartinEnder No, <span>-tags will be stripped: http://meta.stackexchange.com/a/135909

Might be good to add that to the answer then. :)

Is the + really needed ? I was thinking that "4" as a string, it's still the integer number of answers

Could this be made runnable ("run code snippet")?

@RudolfL.Jelínek, No, it will not work from a snippet. Snippets don't have access to the overall page's <document>.  They are contained within an <iframe> which is used to make sure anything in the snippet does not impact the rest of the page.

Note that this uses jQuery which is not pure JavaScript (i.e. it should not be labeled as just "JavaScript"). Using a library which is included on top of the language should at least be explicitly stated. I'm not arguing against using jQuery, just that it should be stated.

@Makyen StackOverflow's network uses jQuery. The question says "Languages that run in a browser may be run from the js console while on this page.". jQuery doesn't have to be loaded, since it already was. Maybe that's why jQuery isn't specified.

Mathematica, 33 bytes
Length@Import[#,"Data"][[4,2]]-1&

The input is the url of this page.

Python 2, 120 bytes, 79 w/o URL
I can't say Python was made for this challenge.
import urllib
print[l for l in urllib.urlopen("http://codegolf.stackexchange.com/q/96298")if"answerCount"in l][0][83:-9]

Unfortunately, inline import is the same length :(
Any help with golfing this further would be greatly appreciated!
If the URL (a whopping 41 bytes—over 1/3 my byte count) can be taken as input, it is 82 bytes:
import urllib
lambda u:[l for l in urllib.urlopen(u)if"answerCount"in l][0][83:-9]

Try using requests library

I think the trailing slash can be omitted...?

@TheInitializer, oh yes thanks!

If you change the line import urllib to import urllib as u then you can save 3 bytes

@sonrad10, how so? It ends up being the same length, no?

@Dopapp I forgot to consider the whitespace needed to add it in

Javascript, 67 bytes
alert($(".answers-subheader").children().first().children().html())

This look way too long

Javascript (ES5), 46 44 40 38 33 bytes
_=>parseInt($('#answers').text())

5 bytes saved thanks to Ismael Miguel
Note: This is pretty slow, and won't work if you have the PPCG-Design userscript.

This isn't much different than the other Javascript answer. In fact, this is simply an un-optimized version of it.

@IsmaelMiguel 1. It was written before the other one, and 2. It uses the element before the hidden one the other answer uses.

Fair enough. But you can use parseInt($('#answers').text()), which will work. That saves you a few bytes.

CJam, 15 bytes
lg"2>"/1=A>S/0=

Expects this page's URL as input.
How it works
l                e# Read a line (the URL) from STDIN.
 g               e# Fetch the resource the URL points to.
  "2>"/          e# Split the source at occurrences of "2>".
       1=        e# Select the second chunk, i.e., everything between the first
                 e# <h2> and the first </h2>.
         A>      e# Discard the first 10 characters (a linefeed and 9 tabs).
           S/0=  e# Split at spaces and select the first chunk.

171 bytes bash + 3 keys lynx
lynx -cfg=<(echo PRINTER:Answercount:grep [0-9]*.Answers %s|less:FALSE:999') http://codegolf.stackexchange.com/questions/96298/how-many-answers-does-this-question-have

Count Count has just risen from 5 to 6 ;-)

You could replace http:// ...  with http://codegolf.stackexchange.com/q/96298

I preferred zero redirect as I would still be hopelessly behind even with 171-49=122.

99 bytes sh + curl + jq + stackexchange API
curl -s --compressed api.stackexchange.com/questions/96298/answers?site=codegolf|jq .items\|length

Using the API, I was able to avoid issues related to page formatting and html. Unfortunately, 60 bytes of my answer are the maximally golfed url for this particular api query, and another 13 bytes for curl to unzip the resulting of the query, because stackexchange refuses to serve uncompressed data via the api.
The actual "logic" comes from curling the api to ask for a json reply with the answers to this post. That is unzipped and then piped into jq, a json parser, which extracts the "items" array and outputs its length.
You can get impressively close to having the api just return the number of answers, but from what I could come up with you could not get 100% of the way there, and getting closer would cost more bytes than just passing it through jq.
101 bytes to return {"total":}:
curl -s --compressed api.stackexchange.com/questions/96298/answers?site=codegolf&filter=!)V)MSZJUgX_

The filter parameter in api queries is very powerful, but it falls just short of providing a "just curl a url" solution. There may be a middle ground here, where you can get a shorter response and then just count the lines or extract the number, but unfortunately filter strings are a set length, and the required jq command was already more efficient.

Cool. Note that you can save many bytes ussing an URL shortener and adding the -L option to make curl follow redirects; for example curl -sL --compressed bit.ly/2ebw404|jq .total

@sergioFC URL shorteners are forbidden by default.

@Dennis Didn't knew that, thank you.

PHP, 76 (Code) + 41 (URL) = 117 bytes
preg_match_all('<h2>(.*) answers<span',file_get_contents("http://codegolf.stackexchange.com/q/96298"),$o);
echo $o[0];

Java, 230 269-41=228 bytes
interface A{static void main(String[]a)throws Exception{System.out.print(new java.util.Scanner(new java.net.URL("http://codegolf.stackexchange.com/q/96298").openStream()).useDelimiter("\\Z").next().replaceAll("\n|\r","").replaceAll("^.+?\\s+(\\d+) Answers.+$","$1"));}}

(Only counts non-deleted answers)

JavaScript + jQuery (already included in page), 20 bytes
+$('h2>span').text()

This is a program intended to be executed in the console for the current page (opened with F12).  It outputs the number of answers, without quotation marks. It works in Chrome, Firefox, IE11, and Edge. It should work in other browsers, but I have only tested it in those listed.
Unlike other JavaScript solutions here, it is a program by itself rather than a function expression using ES6 arrow function notation. Also unlike those solutions, it actually produces output (without quotes) in the console with the number of answers (rather than just being a function expression which produces no output). Producing output relies on the feature in each browser's console that the value of an expression is output after that expression has been evaluated.
This relies on the only <span> on the page with a parent that is an <h2> element is the one containing the number of answers as its text content. After experimentation, this appears to be the case, and it does not appear possible to intentionally create an <h2> with a <span> child using the editor: all explicitly inserted <span> elements are stripped and no Markdown, as used on Stack Exchange, creates an actual <span> within an <h2>. If someone can demonstrate a case where the page can be manipulated such that 'h2>span' selector is no longer unique, then this will need to be revised.
If evaluating to a string instead of a number is acceptable, then
JavaScript + jQuery (already included in page), 19 bytes
$('h2>span').text()

However, while this does not evaluate to include "", in all tested consoles it produces output which is enclosed within "". I read Filip Haglund's comments on the question as precluding this output.

R, 80 bytes
Answer is based on searching the vector returned by readLines using regular expressions. I'm guessing that this could be broken by text in comments/answers (possibly even my own). Will delete if so. Also the pattern could also be gofled but not sure if that would increase the likelihood of getting a false value.
x=readLines(scan(,""));regmatches(x,regexpr("(?<=answerCount\">).*?(?=<)",x,,T))

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


text:
Generate a 6 character string from a 15 character alphabet
In one of our projects at work, we recently discovered a particularly large method for generating a 6 character string from a 15 character alphabet. A few of us claimed "I bet we can get that in one line" which started a little internal game of code golf.
Your task is to beat us, which I have no doubt won't take long!
The original algorithm used the alphabet 0-9A-E, but we've experimented with other alphabets. There are therefore three subtasks.

Generate a 6 character string randomly selecting from an arbitrary hardcoded 15 character alphabet like ABC123!@TPOI098. (This is just an example, and should be customizable without affecting the byte count.)
Generate a 6 character string randomly selecting from a 15 character alphabet 0123456789ABCDE.
Generate a 6 character string randomly selecting from a 15 character alphabet of your choice (printable characters only please).

Each character should have equal chance of selection and repetition should be possible.
The best we have been able to manage for each of the subtasks is:

"ABC123!@TPOI098" - 24 bytes
"0123456789ABCDE" - 21 bytes
Custom alphabet   -  13 bytes

Your score is the sum of the bytes in each subtask's solution. i.e. our score is currently 58.
We've attempted using among others, CJam and Ruby. The original was in C#. Use any language you like, but we'll be interested to see solutions in these languages particularly

Regarding multi-part challenges. Unfortunately, I don't have a good solution in this case, since these three subtasks are way too similar for it to make sense to split them up into multiple challenges. I've also been considering proposing an exception to that policy for multi-part challenges where the subtasks are just minor variations of the same challenge. (Although that still has the problem that sub-solutions can be taken from other answers.) So I won't mod-hammer this, and see what the community thinks.

"Your score is the sum of the bytes..." so my first example is unfortunate. I'll amend to another potential example

@MartinEnder My 2 cents: I think it's OK and will not VTC. Sure, I generally think a challenge with a single interesting task is better, but since these tasks are very similar, it's a lot better than a "golf-course" that says "do these 8 random unrelated tasks." Even though there is no interaction between tasks, in my eyes this challenge is not very different than say Golf all 16 logic gates.

Are there any time or memory limits? Do the subtasks have to be independent or are they allowed to share code?

@DJMcMayhem Yes, that is actually the challenge which made me consider the exception I mentioned. I just didn't get around to sorting out my thoughts on the matter yet.

Borderline dupe

Does "generate a string" mean the code has to actually generate a string value with the appropriate characters in it, or is outputting the six characters (not separated by space or newlines) acceptable?

Maybe I’m being dense here, but how can the character alphabet possibly be customisable without affecting the byte count? Wouldn’t changing the character set from 0123456789ABCDE to 0123456789x̃ᾖत्रुँֆ齉 increase the byte count by definition (unless the encoding uses 4 bytes for all characters)? Or is ‘character’ here to be taken to refer to single-byte ASCII characters only?

Jelly, 38 bytes
TryItOnline links A, B, and C.
A: ABC123!@£POI098, 22 bytes
“ABC123!@£POI098”Wẋ6X€

(thinking about a compression to lessen this one)
B: 0123456789ABCDE, 8 bytes:
ØHṖWẋ6X€

C:123456789ABCDEF (choice), 8 bytes:
ØHḊWẋ6X€

How?
...Wẋ6X€ - common theme
   W     - wrap (string) in a list
    ẋ6   - repeat six times
      X€ - random choice from €ach

ØH...... - hexadecimal digit yield: "0123456789ABCDEF"

..Ṗ..... - pop: z[:-1] (B)

..Ḋ..... - dequeue: z[1:] (C)

CJam (23 + 14 + 10 = 47 bytes)
Arbitrary alphabet: 23 bytes (online demo)
{"ABC123!@TPOI098"mR}6*

Hexadecimal alphabet: 14 bytes (online demo)
{FmrAbHb'0+}6*

Custom alphabet: ABCDEFGHIJKLMNO, 10 bytes (online demo)
{Fmr'A+}6*

Dissection
The hexadecimal one is the interesting one:
{      e# Loop...
  Fmr  e#   Select a random number from 0 to 14
  AbHb e#   Convert to base 10 and then to base 17
       e#   (i.e. add 7 if the number is greater than 9)
  '0+  e#   Add character '0' (i.e. add 48 and convert from integer to character)
       e#   Note that 'A' - '0' = 17
}6*    e# ...six times

The six characters are left on the stack and printed automatically.

AbHb is brilliant. I thought about that general approach but _9>7*+ was too long.

Perl, 46 + 26 + 26 = 98 bytes
A lot of the credit goes to @Dom Hastings for saving 13 bytes!
The 3 programs are pretty much identical, except for the alphabet that changes.

Hardcoded alphabet (ABC123!@)POI098 in this example) -> 46 bytes:
say map{substr"ABC123!@)POI098",15*rand,1}1..6

Fixed alphabet 0123456789ABCDE -> 26 bytes:
printf"%X",rand 15for 1..6

Custom alphabet 0123456789ABCDE in that case -> 26 bytes:
printf"%X",rand 15for 1..6

You can put them all in a file to run them :
$ cat 6chr_strings.pl
say map{substr"ABC123!@)POI098",15*rand,1}1..6;
say "";
printf"%X",rand 15for 1..6;
say "";
printf"%X",rand 15for 1..6;
say "";
$ perl -M5.010 6chr_string.pl
CB8!8!
24D582
9ED58C

(the say ""; are just here to improve the output format)

Good answers! I had pretty much the same for the first and last, but you can save a byte using say: say map{("ABC123!@)POI098"=~/./g)[rand 15]}1..6 and say map{(A..O)[rand 15]}1..6. For the second you can use printf: printf"%X",rand 15for 1..6 to save 11 over all! I'm sure Ton can advise on some arcane magic to save more too!

Actually with the custom alphabet substr saves another: say map{substr"ABC123!@)POI098",15*rand,1}1..6

@DomHastings Hmm indeed, that's nice, well played! Thanks :-)

I like that you removed the note about the code being straightforward :D

@DomHastings with printf"%X", substr..rand and map, it's just a bit less obvious, so I let people enjoy perl magic with no spoilers! :D

JavaScript (ES6), 167 166 164 163 bytes
Saved 1 byte thanks to Neil
Saved 2 bytes thanks to ETHproductions
Saved 1 byte thanks to premek.v
Hardcoded: "ABC123!@TPOI098" (58 bytes)
f=(n=6)=>n?"ABC123!@TPOI098"[Math.random()*15|0]+f(n-1):''

Fixed: "0123456789ABCDE" (58 57 bytes)
f=(n=6)=>n?f(n-1)+("ABCDE"[n=Math.random()*15|0]||n-5):''

Custom: "()+.1=>?M[afhnt" (51 49 48 bytes)
f=(n=6)=>n?(f+1)[Math.random()*15|0+5]+f(n-1):''

(n=6)=>n?f(n-1)+("ABCDE"[n=Math.random()*15|0]||n-5):'' saves you a byte.

1/8+Math is great :)

But .1+JSON is better ;)

Or JSON+f ([object JSON](n => " (JNOS[]bcejnot")

@ETHproductions Nice one. :)

R, 33+43+59 = 135 bytes
Arbitrary hard-coded alphabet (change the string to change the alphabet):
cat(sample(strsplit("ABC123!@TPOI098","")[[1]],6,1),sep="")

Alphabet of [0-9A-E]:
cat(sample(c(0:9,LETTERS[1:6]),6,1),sep="")

User-defined alphabet from stdin:
cat(sample(scan(,''),6,1),sep="")

All cases print the output word to stdout.

JavaScript (ES6), 184 bytes
Custom alphabet: 66 bytes
_=>"......".replace(/./g,c=>"ABC123!@TPOI098"[Math.random()*15|0])

0-9A-E: 63 bytes
_=>"......".replace(/./g,c=>"ABCDE"[n=Math.random()*15|0]||n-5)

0-9a-e: 55 bytes
_=>(Math.random()*11390625+1e8|0).toString(15).slice(1)

(Subtract 6 bytes if date-based randomness is permissible.)

You can save a byte on the last one with **: _=>((Math.random()+1)*15**6|0).toString(15).slice(1)

@ETHproductions Surely that would make it ES7, rather than ES6? (Also, it looks like a 3-byte saving to me.)

Yes, and it does appear to save 3 bytes. I must have included the f= in the byte count

q, 42 bytes
A
19 bytes
6?"ABC123!@TPOI098"

B
14 bytes
6?15#.Q.n,.Q.A

C
9 bytes
6?15#.Q.a

(uses the first fifteen letters of the alphabet)

Julia (36+26+21 = 83)
join(rand(["ABC123!@TPOI098"...],6))

base(15,rand(15^6:15^7-1))

join(rand('a':'o',6))

CJam, 48 bytes
Arbitrary alphabet, 23 bytes:
{"ABC123!@TPOI098"mR}6*

Try it online!
Hex digits, 15 bytes:
{A,'F,65>+mR}6*

Try it online!
Alphabet ABCDEFGHIJKLMNO, 10 bytes:
{Fmr'A+}6*

Try it online!

I had a bad idea. If we consider U+FFFE a character, ~c instead of 'A+ returns something technically printable.

Maybe I'm wrong. I didn't find a definition of printable Unicode characters.

Ruby 47 + 37 + 31 = 115
Hardcoded: "ABC123!@TPOI098" (47)
(1..6).map{"5CABC123!@TPOI098".chars.sample}*''

Fixed: "0123456789ABCDE" (37)
(1..6).map{[*0..9,*?A..?E].sample}*''

Custom: "ABCDEFGHIJKLMNO" (31)
(1..6).map{[*?A..?O].sample}*''

05AB1E, 43 bytes
Arbitratry alphabet (ABC123!@TPOI098), 23 bytes Try it online
"ABC123!@TPOI098"6F.r¬?

Almost hexadecimal alphabet (0123456789ABCDE), 10 bytes Try it online
14Ýh6F.r¬?

Custom alphabet (abcdefghijklmno), 10 bytes Try it online
A15£6F.r¬?

Python 2, 70 + 70 + 64 = 204 bytes
from random import*
s=""
exec"s+=choice('ABC123!@TPOI098');"*6
print s

from random import*
s=""
exec"s+=choice('0123456789ABCDE');"*6
print s

from random import*
s=""
exec"s+=chr(randint(65,80));"*6
print s

Unfortunately, the second example is easier with the first method than something like choice([randint(48,57)),choice(65,69)])

Why do you use from random import*? I think you can use import random and random.choice at least in the first two examples.

import random random.choice is 27 but from random import* choice is 26, also import random as r r.choice is 27

For the hex case, we can do a bit better by using format(randrange(8**8),'X'), I think.

@DSM the problem is, there must be no F

Vitsy, 27 + 24 22 + 13 10 = 64 62 59 bytes
#1:
"ABC123!@TPOI098"6\[eR2+@O]

Try it online!
#2:
aH7+D4+H6\[eR2+@68*+O]

Try it online!
#3:
6\[eR5F-O]

Where the available characters are:
ﾖﾕﾔﾓﾒﾑﾐﾏﾎﾍﾌﾋﾊﾉﾈ

Try it online!

J, 24 + 24 + 18 10 = 58 bytes
8 bytes saved thanks to miles!
'ABC123!@TPOI098'{~?6#15
'0123456789ABCDE'{~?6#15
u:65+?6#15

Yeah, the second string isn't easily compressible in J:
u:47+23#.inv 12670682677028904639x
u:47+;(+i.@])/"1&.>1 10;18 5
('ABCDE',~1":i.10)
(toupper,hfd?6#15)
'0123456789ABCDE'

If a lowercase hex alphabet is fine, then there's ,hfd?6#15 for 9 bytes, as @miles noted.
Anyhow, ?6#15 is 6 random numbers between 0 and 15; {~ is take-from. u: converts numbers to chars. The last example encodes ABCDEFGHIJKLMNOP.
Bonus: general case
{~6?@##

{~6?@## is roughly:
{~6?@##  input: y
      #  length of y
  6  #   six copies of the length
   ?@    random numbers between 0 and the length
{~       taken from y

On the second case, there's a builtin named hfd which converts to hex from decimal. You can get a 9 byte solution using ,hfd?6#15. The last case, just to have something easily read, uses the alphabet from 'A' for a 10 byte solution u:65+?6#15, making a total 24 + 9 + 10 = 45.

@miles I think the second case requires capitalized letters. As for the last case... haha, oops. I completely forgot about vectorized addition.

PHP, 46+36+35=117 bytes
Hardcoded (46 bytes)
for(;$i++<6;)echo"ABC123!@TPOI098"[rand()%15];

(47 bytes)
for(;$i++<6;)echo"ABC123!@TPOI098"[rand(0,14)];

Hexadecimal (lowercase) (36 bytes)
for(;$j++<6;)echo dechex(rand()%15);

For uppercase, 46 bytes with Hardcoded version.
Custom (A-O) (35 bytes)
for(;$k++<6;)echo chr(rand(65,79));

I don't think I can accept your 2nd part. a-e isn't the same as A-E

Scala, 154 bytes
Hardcoded alphabet (54 bytes):
Seq.fill(6)("ABC123!@TPOI098"((math.random*14).toInt))

Hex alphabet (54 bytes):
Seq.fill(6)("0123456789ABCDE"((math.random*14).toInt))

Custom alphabet ABCDEFGHIJKLMNO (47 bytes):
Seq.fill(6)(('A'to'O')((math.random*14).toInt))

Explanation:
Seq.fill(6)(               //build a sequence of 6 elements, where each element is...
  "ABC123!@TPOI098"(         //from the string
    (math.random*14).toInt   //take a random char
  )
)

'A'to'O' creates a sequence of 15 chars, A to O

Pip, 42 bytes
Hardcoded alphabet, 22 bytes:
L6ORC"ABC123!@TPOI098"

Hex digits, 11 bytes:
L6ORR15TB16

First 15 lowercase letters, 9 bytes:
L6Oz@RR15

Explanation
All three programs start with L6O: loop 6 times and output the given expression.

RC"...": Random Choice of a character from the hard-coded string
RR15TB16: RandRange(15), converted To Base 16
z@RR15: lowercase alphabet z, indexed with RandRange(15)

Try it online!

Skript/skQuery, 108 bytes
Hardcoded (43 bytes):
random 6 char string from `A@cD%F3h9JK{mN!`

0123456789ABCDE (34 bytes):
random 6 char string from `0-9A-E`

Choice (31 bytes):
random 6 char string from `A-M`

Can you move the opening ``` to the left?

@VTCAKAVSMoACE No, it doesn't let you

Jolf, 26 + 14 + 13 = 51 bytes
Μ*S6d rG"ABC123!@TPOI098"E

Custom alphabet, 24 bytes. Try it here!
Μ*S6d r lp^0wά

0-9A-E alphabet, 14 bytes. Try it here! lp^0wά is lp (0-Z) sliced (l) from 0 to 15 (wά).
Μ*S6d r lp^1ά

1-9A-F alphabet, 13 bytes. Try it here! lp^1ά is the same as above, except from 1 to 16.

General method:
Μ*S6d r
M*S6d      map six newlines over this function:
      r    select random element from array.

Other attempts (using string compression):
Μ*S6d rGμpwΞ $AE

PowerShell v2+, 45 + 44 + 37 = 126 bytes
Fixed alphabet, 45 bytes
-join(0..5|%{'ABC123!@TPOI098'[(Random)%15]})

Nearly-hexadecimal alphabet, 44 bytes
-join[char[]](0..5|%{Random(48..57+65..69)})

Custom alphabet (A to O), 37 bytes
-join[char[]](0..5|%{Random(65..79)})

All of these follow the same pattern -- loop from 0 to 5, each iteration selecting a Random character or ASCII value, casting that as a char-array if necessary, and -joining it together into a string. That string is left on the pipeline, and output is implicit.

Examples
PS C:\Tools\Scripts\golfing> -join(0..5|%{'ABC123!@TPOI098'[(Random)%15]})
32ATB3

PS C:\Tools\Scripts\golfing> -join(0..5|%{'ABC123!@TPOI098'[(Random)%15]})
III@B2

PS C:\Tools\Scripts\golfing> -join(0..5|%{'ABC123!@TPOI098'[(Random)%15]})
@302O@

PS C:\Tools\Scripts\golfing> -join[char[]](0..5|%{Random(48..57+65..69)})
74E117

PS C:\Tools\Scripts\golfing> -join[char[]](0..5|%{Random(48..57+65..69)})
09D7DD

PS C:\Tools\Scripts\golfing> -join[char[]](0..5|%{Random(65..79)})
COJDFI

PS C:\Tools\Scripts\golfing> -join[char[]](0..5|%{Random(65..79)})
EAKCNJ

Pyke, 35 bytes
Arbitary alphabet, 20 bytes
6V"ABC123!@TPOI098"H

Try it here!
Hex alphabet, 8 bytes
6V~J15<H

Try it here!
~J15< - "0123456789abcdefghijklmno..."[:15]

Custom alphabet, 7 bytes
6VG15<H

Try it here!
G15< - alphabet[:15]

Alphabet chosen: abcdefghijklmno
6V     - repeat 6 times:
  ...  -   get alphabet
     H -  choose_random(^)

This seems to output 6 chars separated by newline instead of a 6-char string.

The question doesn't state the output format.

I see the words Generate a 6 character string in 4 places in the specification.


text:
Export The $PATH Variable, Line-By-Line
Inspired by this question on AskUbuntu.
Your job is extremely simple. Take the PATH environment variable (echo $PATH) and export it such that each entry (separated by the : character) is on its own line.
For example, if the PATH is /bin:/usr/bin:/usr/local/bin, your program should output:
/bin
/usr/bin
/usr/local/bin

Your program may not return a leading newline, but it may return a single trailing newline. You do not need to check if the PATH is right, or that the directory exists. Your program should take no input, meaning that your program is responsible for getting the PATH itself. You may safely assume that objects in the PATH do not contain : or newlines. However, spaces are fair game.
Reference implementations are present in the answers to the question above.
Rules

This is (obviously) code-golf, so the shortest answer will win the prized green checkmark.
The accepted answer will be tested to make sure it's actually legit.
Both Windows and *nix entries are accepted.

However, if you don't explicitly specify Windows, I will try running it in Linux and fail. (If it's obvious (hi, Batch!), you don't need to specify explicitly.)

Only have one solution per answer. If you have both a Windows and *nix version, I will count the shorter one.
If two answers have the same length, I will give priority to the one with the higher vote total. If they have the same vote total, I will count the older one. If the time posted is the same, I will choose the one that executes faster. If they execute in the same amount of time, I don't know.

Leaderboard

var QUESTION_ID=96334,OVERRIDE_USER=15422;function answersUrl(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 commentUrl(e,s){return"https://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

Ahh! It was hard to visit the AskUbuntu Question without giving some golfing tipps.

Some of the (shell) answers seem to assume that the path doesn't contain spaces. Should they be corrected?

@Dennis Typically, the path variable shouldn't have spaces, but as they can, they should be corrected. However, we can safely assume that paths themselves won't contain : or a newline.

Is a function acceptable?

@corvus_192 Unless the challenge explicitly says otherwise, functions are allowed.

Similar to http://golf.shinh.org/p.rb?PATH

Z shell (zsh), 13 bytes
<<<${(F)path}

Uses the $path parameter, which is a special array parameter used by the shell that is tied to the $PATH parameter, and a parameter expansion flag to join an array with newlines.

Apparently one does simply out-golf @Dennis... Huh.

Bash/Coreutils, 17 16 bytes
tr : '
'<<<$PATH

tr : '\n'<<<$PATH should work as well

It does . . . editing right now

I think you can remove the spaces around <<< as well (tested on Ubuntu only)

@Arnauld i don't think that's Ubuntu only thing, it's bash thing, so should work accross the distros

The \n can be replaced by a newline reducing the bytes from 17 to 16.

@RomanCzyborra how so ?

i mutated your reply as i cannot force linebreaks in my comments it seems

It doesn't save any bytes, but using \\n instead of the quoted variable is more readable imho.

Batch, 41 bytes
@for %%a in ("%PATH:;=";"%")do @echo %%~a

PATH is semicolon-delimited on Windows of course. Conveniently, for splits on semicolons by default, but inconveniently, also on spaces, so I have to use string replace trickery to quote each path element before splitting. It then remains to remove the quotes afterwards.

Running from the command line you can replace %% with % saving 2 bytes.

@DavidPostill Wouldn't that make it a code snippet rather than a program?

I'm not sure what the exact code golf rules are, but aren't most of other answers just snippets as well? Most of them require a "shell" of some description to run ...

Z shell (zsh), 15 bytes
<<<${PATH//:/
}

You can test the code on Anarchy Golf: click use form, select zsh, paste the code and submit.
Bash (pure), 19 bytes
echo "${PATH//:/
}"

Same idea, but with Bash's less golfy syntax. Test it on Ideone.

Powershell, 20 bytes
$env:PATH-split':'

Edit:

-2 bytes off. Thanks to @TimmyD

Old:
$env:PATH.split(":")

Ruby, 25 bytes
puts ENV["PATH"].split":"

Nice, tiny bit shorter than my answer on the original question on AskUbuntu

You don't need to count the Ruby invocation, only the program itself, so this is only 26 bytes.

@Jordan didn't know that. Is it in FAQ?

@Jordan It's shown in the tour itself. So, edited. Thank you for telling that

Oh, also you can change split ":" to split":" or split ?: for 1 byte.

Perl, 22 bytes
say$ENV{PATH}=~y/:/
/r

Needs -E or -M5.010 to run :
perl -E 'say$ENV{PATH}=~y/:/
/r'

Bash+Python, 43 bytes
Let's use shell's variable expansion. It eliminates calling os.environ , thus less code and less imports. That gives us 46 bytes, and with xnor's trick and removing space before -c we've got 43 bytes.
python -c"print('$PATH'.replace(*':\n'))"

Note that this fails if a directory with a single quote or a backslash appears in your PATH.

@JoeyMarianer  Since there can be almost any character in filename/path string, then yes - this may fail and becase PATH will expand to '/dir'1:/dir2' , which gives incorrectly formatted command to python. The backslash doesn't necessarily fail - it just interprets what's in the string itself. IMHO , backslash escapes shouldn't appear in normal user's path names , so for 99% of cases this is OK. I however agree - this should be kept in mind anytime you deal with shell directly or indirectly as in this case

GNU sed + bash, 25 bytes:
sed 's/:/\n/g' <<<"$PATH"

If the PATH contains no directory name with whitespace, no quoting needed, 23 bytes:
sed 's/:/\n/g' <<<$PATH

Even shorter, transliterating : to newline, thanks to @Dennis:
sed y/:/\\n/<<<"$PATH"

Java, 58 bytes
System.out.print(System.getenv("Path").replace(';','\n'));

Full program: 106 bytes
class E {
    public static void main (String[] args) {
        System.out.print(System.getenv("Path").replace(';', '\n'));
    }
}

Vim, 19 bytes
"=$PATH<CR>p:s/:/\r/g<CR>
Grab $PATH from the expression register and paste it. Turn the :s into newlines. Nothing tricky.

They should put this in Vim tutorials. As someone reading about how to get into Vim I appreciate this example.

PHP, 36 35 33 32 bytes
Saved 1 byte, thanks to Blackhole
Saved 2 bytes, thanks to user59178
saved 1 byte, thanks to Martijn
*nix version
<?=strtr(getenv(PATH),":","
")?>

Windows version
<?=strtr(getenv(PATH),";","
")?>

To what does the star reffer?

@RomanGräf *nix is just a way of referring to a Unix-like system.

If you want a "multi-plataform" version, you can use the constant PATH_SEPARATOR

Don't use \n, but a true newline instead, it'll save you one byte.

you can also drop the "s around PATH. You get an "use of undefined constant" notice but it still works, saving you 2 bytes.

Using the short echo <?=strtr(getenv(PATH),":","")?> safes a byte (*cant newline in comments)

; instead of ?> saves one byte

deprecated, but still working: $_ENV[PATH] is one byte shorter than getenv(PATH). With register_globals=On (PHP <4.2) you can even use $PATH to save another 6 bytes.

Python 2, 49 bytes
Saving 2 bytes thanks to @xnor and 1 byte by replacing environ with getenv thanks to @Serg and @Oliver
import os
print os.getenv('PATH').replace(*':\n')

For Python 3, just add ( and ) around the print argument and add 1 to the byte count.

How will this get the input?

@Anwar from os.environ['PATH'] , that will return the string

@Serg ah. got it.

os.getenv is shorter than os.environ by one byte

replace can take packed arguments replace(*':\n').

You should mark that as Python 2, since it doesn't work in 3 if i recall correctly.

@DenkerAffe despite the print() syntax in 3, it also works.

@KarlNapf Yea, thats the point. This program as-is does not run in Python 3, so you should specify the version it works with.

@KarlNapf Replace os.environ['PATH'] with os.getenv('PATH') to save one byte.

C, 85 84 bytes
-1 byte for using #import
#import<stdlib.h>
main(){char*a=getenv("PATH");while(*a)putchar(*a++==58?10:a[-1]);}

C (x86), 60 bytes
f(){char*p=getenv("PATH");for(;*p;p++)putchar(*p-58?*p:10);}

This won't work on 64-bit platforms without including stdlib.h, since getenv returns an int (32 bits) while char pointers are 64 bits wide.
I have yet to find an online 32-bit C compiler.
C (x86-64), 70 bytes
f(){char*getenv(),*p=getenv("PATH");for(;*p;p++)putchar(*p-58?*p:10);}

Instead of including stdlib.h, we declare getenv ourselves as a function returning a char pointer.
I've tested this with gcc and clang on Linux; other setups may cry blood. Try it on Ideone.

jq, 18 characters
(16 characters code + 2 characters command line option)
env.PATH/":"|.[]

Sample run:
bash-4.3$ PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

bash-4.3$ jq -nr 'env.PATH/":"|.[]'
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin

C#, 64 bytes
x=>Environment.GetEnvironmentVariable("PATH").Replace(";","\n");

Anonymous function which returns the path variable, each directory on a separate line. Note that x is just a dummy object to save 1 byte instead of using ().
Full program:
using System;

namespace ExportPathVariable
{
    class Program
    {
        static void Main(string[] args)
        {
            Func<object,string>f= x=>Environment.GetEnvironmentVariable("PATH").Replace(";","\n");

            Console.WriteLine(f(0));
        }
    }
}

Also works on UNIX systems if you replace ; with :, presuming Mono libraries are available. Try it online on ideone, .NET Fiddle returns a security exception.
Alternatively, a full C# program, which is rather verbose:

C#, 118 bytes
using System;class P{static void Main(){Console.Write(Environment.GetEnvironmentVariable("PATH").Replace(";","\n"));}}

Racket 39 bytes
Using sed command of @heemayl :
(system "sed 's/:/\\n/g' <<<\"$PATH\"")

Ungolfed:
(define (f)
  (system "sed 's/:/\\n/g' <<<\"$PATH\"")
)

Testing:
    (f)
Output:
/usr/local/bin
/usr/bin
/bin
/usr/games
/usr/lib/java/bin
/usr/lib/java/jre/bin
#t

Scala, 31 bytes
sys env "PATH"replace(':','\n')

In scala, a b c is syntactic sugar for a.b(c), so this compiles to sys.env("PATH").replace(':','\n')

Perl 6,  28 25  24 bytes
%*ENV<PATH>.split(':')».put

put %*ENV<PATH>~~tr/:/\n/

put %*ENV<PATH>~~tr/:/
/

Factor, 28 bytes
for unix-likes. I dunno how to do it on Windows since I'm not at a Windows box.
"PATH"getenv ":" "\n"replace

Haskell, 72 bytes
import System.Environment
m ':'='\n'
m x=x
map m<$>getEnv"PATH">>=putStr

An expensive import and no replace within the standard library make it quite long.

surely m ':'... doesn't need that space?

@cat: the space is mandatory, because ' is a valid character within identifiers. Without space we'd define a function named m'.

Awk, 51 44 characters
BEGIN{$0=ENVIRON["PATH"];gsub(":",RS);print}

Thanks to:

ninjalj for suggesting to use gsub() instead of manipulating built-in variables (-7 characters)

The typical awk way would be to set up the built-in variables which influences how awk manipulates the data automatically:
BEGIN{FS=":";OFS=RS;$0=ENVIRON["PATH"];$1=$1;print}

Sample run:
bash-4.3$ PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

bash-4.3$ awk 'BEGIN{FS=":";OFS=RS;$0=ENVIRON["PATH"];$1=$1;print}'
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin

Doh. You are right, @ninjalj. I was to focused on doing it in awk-specific way. Thank you.

Node.js, 36 bytes
_=>process.env.PATH.split`:`.join`
`

Pretty straight forward.

MATLAB, 34 bytes
disp(strrep(getenv('PATH'),58,10))

Here is an online demo in Octave with a slight modification since strrep in octave requires the second and third inputs to be char variables rather than numeric values.

R, 38 bytes
cat(gsub(":","\n",Sys.getenv('PATH')))

Grab the $PATH, replace : with newlines and prints to stdout. You can try it online here.

Groovy, 43 Bytes
System.env['PATH'].replaceAll(":","\n")

ELF/x86, 78 bytes
00000000  7f 45 4c 46 01 00 00 00  43 0f 00 00 43 5f eb 10  |.ELF....C...C_..|
00000010  02 00 03 00 0c 50 eb 10  0c 50 eb 10 04 00 00 00  |.....P...P......|
00000020  5f 5f b1 05 be 49 50 eb  10 3d 20 00 01 00 5f f3  |__...IP..= ..._.|
00000030  a6 75 ef 89 f9 80 3f 3a  75 03 80 2f 30 42 ae 75  |.u....?:u../0B.u|
00000040  f4 4a 04 04 cd 80 93 cd  80 50 41 54 48 3d        |.J.......PATH=|
0000004e

NASM source:
BITS 32                                         ;
ORG 0x10eb5000                                  ;
                                                ;   ELF HEADER    --   PROGRAM HEADER
; ELF HEADER                                    ; +-------------+
DB 0x7f,'E','L','F'                             ; | magic       |    +--------------------+
                                                ; |             |    |                    |
; PROGRAM HEADERS                               ; |             |    |                    |
DD 1                                            ; |*class   32b | -- | type: PT_LOAD      |
                                                ; |*data   none |    |                    |
                                                ; |*version   0 |    |                    |
                                                ; |*ABI    SysV |    |                    |
DD 0xf43        ; offset = vaddr & (PAGE_SIZE-1); |*ABI vers    | -- | offset             |
                                                ; |             |    |                    |
entry:  inc     ebx     ; STDOUT_FILENO         ; |*PADx7       | -- | vaddr = 0x10eb5f43 |
        pop     edi     ; discard argc          ; |             |    |                    |
        jmp     short skip                      ; |             |    |                    |
DW 2                                            ; | ET_EXEC     | -- |*paddr LO           |
DW 3                                            ; | EM_386      | -- |*paddr HI           |
DD 0x10eb500c                                   ; |*version     | -- | filesz             |
DD 0x10eb500c                                   ; | entry point | -- | memsz              |
DD 4                                            ; | ph offset   | -- | flags: RX          |
                                                ; |             |    |                    |
skip:   pop     edi     ; discard argv[0]       ; |*sh offset   | -- |*align              |
        pop     edi     ; discard argv[1]=NULL  ; |             |    |                    |
env:    mov     cl,5    ; \ strlen("PATH=")     ; |             |    |                    |
        mov     esi,PATH; > "PATH="             ; |*flags    /--|    |                    |
DB 0x3d         ; cmp eax,0x10020               ; |*ehsize      |    +--------------------+
DW 32                                           ; | phentsize   |
DW 1                                            ; | phnum       |
                                                ; |             |
        pop     edi     ; > envp                ; |*shentsize   |
        repe    cmpsb   ; > strcmp(envp,"PATH="); |*shnum       |
        jne     env     ; /                     ; |*shstrndx    |
        mov     ecx,edi                         ; +-------------+

nlcolon:cmp     byte[edi],58  ; \ if (char == ':')
        jne     nosub         ; >
        sub     byte[edi],48  ; >   char -= '0'
nosub:  inc     edx           ; > wlen++
        scasb                 ; >
        jne     nlcolon       ; / while(char != 0)

        dec     edx           ; wlen--
        add     al,4
        int     0x80          ; write(1, ecx, wlen)
        xchg    eax,ebx
        int     0x80          ; exit(...)

PATH: db "PATH="

DOS .COM File, 52 bytes
00000000  31 f6 8b 16 2c 00 8e da  bf 2f 01 b9 05 00 f3 a6  |1...,..../......|
00000010  74 06 f7 d9 f2 ae eb f0  b4 02 ac 3c 3b 75 06 b2  |t..........<;u..|
00000020  0d cd 21 b0 0a 92 08 c0  74 04 cd 21 eb ea c3 50  |..!.....t..!...P|
00000030  41 54 48 3d                                       |ATH=|
00000034

NASM Source:
BITS 16
ORG 0x100

                                ; we assume ax is zeroed on start
        xor     si,si
        mov     dx, [0x2c]
        mov     ds, dx          ; PSP:002C points to the environment segment

searchpath:
        mov     di, PATH
        mov     cx, 5
        repe    cmpsb           ; search for PATH= in environment
        je      loop            ; jump if found
        neg     cx
        repne   scasb           ; scan for '\0': skip to the next env var
        jmp     searchpath

loop:   mov     ah, 2           ; WRITE TO STDOUT; AH=02 DL=char
        lodsb                   ; load the next character from PATH
        cmp     al,59
        jne     nosemi
        mov     dl, 0x0d        ; \ if it is a semicolon,
        int     0x21            ; > output '\r',
        mov     al,0x0a         ; / and change it to '\n'
nosemi: xchg    dx,ax           ; 1 byte shorter than mov dl,al
        or      al,al
        je      end             ; if it is '\0', end
        int     0x21
        jmp     loop

end:    ret

PATH: db "PATH="

On some older DOS versions (e.g: 3.3) SI is apparently zeroed at start, so 2 bytes can be saved. Newer DOS versions apparently set SI to 100h.

Q 20 Characters
If no double quotes in the output the length is 17 chars
q)-1":"vs getenv`PATH;
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
q)

Gema, 36 characters
\A=@subst{\\:=\\n;@getenv{PATH}}@end

Sample run:
bash-4.3$ PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'

bash-4.3$ gema '\A=@subst{\\:=\\n;@getenv{PATH}}@end'
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin

Befunge-98 + EVAR fingerprint, 34 bytes
"RAVE"4("HTAP"Gv
:!k@:':-!'0*-, >

Loads the EVAR fingerprint ("RAVE"4() to easily access environment variables, gets the PATH envvar ("HTAP"G), and for each character, exits the program if the character is "\0" (:!k@), substracts ASCII 48 "0" if the char is ASCII 58 ":" (:':-!'0*-), and outputs the character (,).

Tcl, 34 bytes
puts [regsub -all : $env(PATH) \n]

Try it online!


text:
The 3x3 Hexa Prime Square Puzzle
The 3x3 Hexa Prime Square Puzzle
Introduction
We consider 3x3 squares of hexadecimal digits (from 0 to F) such as:
2 E 3    1 F 3
8 1 5    7 2 7
D D 5    B B 9

We define a 3x3 Hexa Prime Square (HPS3) as such a square for which all hexadecimal numbers read from left to right and from top to bottom are odd primes (i.e. primes greater than 2).
This is true for the left square and false for the right square:
2 E 3 --> 0x2E3 = 739       1 F 3 --> 0x1F3 = 499
8 1 5 --> 0x815 = 2069      7 2 7 --> 0x727 = 1831
D D 5 --> 0xDD5 = 3541      B B 9 --> 0xBB9 = 3001
| | |                       | | |
| | +---> 0x355 = 853       | | +---> 0x379 = 889 = 7 x 127
| +-----> 0xE1D = 3613      | +-----> 0xF2B = 3883 = 11 x 353
+-------> 0x28D = 653       +-------> 0x17B = 379

Goal
Given a list of 9 hexadecimal digits, your goal is to find an arrangement that forms a HPS3.
Example:
Input: 123558DDE
Possible output: 2E3815DD5 (a flattened representation of the above left example)

Input / Output
Input and output formats are flexible. The only requirement is that output digits are ordered from left to right and from top to bottom. Below are some possible options:
"2E3815DD5"
[ 0x2, 0xE, 0x3, 0x8, 0x1, 0x5, 0xD, 0xD, 0x5 ]
[ "2", "E", "3", "8", "1", "5", "D", "D", "5" ]
[
  [ 0x2, 0xE, 0x3 ],
  [ 0x8, 0x1, 0x5 ],
  [ 0xD, 0xD, 0x5 ]
]
[ "2E3", "815", "DD5" ]
etc.

Using the same format for both input and output is not required.
Rules

This is code-golf, so the shortest answer in bytes wins. Standard loopholes are forbidden.
Your algorithm must be deterministic
You can't just bogosort the array until it's valid, even in a deterministic way (by using a constant random seed).
You may list all possible solutions for a given input, but this is neither required nor subject to a bonus.
You're not required to support inputs that do not admit any solution. (It's perfectly fine if your code is looping forever or crashing in that case.)

Test cases
Input       Possible output
---------------------------
123558dde   2e3815dd5
1155578ab   a7b851551
03bddffff   ffd0dfb3f
35899beff   8f99e3bf5
15899bbdf   581bb9fd9
14667799f   6f1469779
13378bcdd   78d1cd33b
24577bbdd   7274bd5db
1118bbddd   11b18dbdd
223556cdd   623c25dd5
12557899a   8a5295971
113579bbd   5b3db7191

"You can't just bogosort the array until it's valid, even in a deterministic way (by using a constant random seed)." What if I simply check all permutations of the input? At no more than 362880 permutations, this isn't even going to be particularly slow.

@MartinEnder Trying all permutations (only once each) is perfectly fine. Any random method that would potentially try several times the same permutation is prohibited.

It took me like 10 minutes just to understand the logic. To make a post about it... from now #1 on my ToNotDo list :)

05AB1E, 23 21 bytes
Uses CP-1252 encoding.
œJvy3ôD€SøJìHDps2›*P—

Too slow for TIO.
Explanation
œJ                     # all permutations of input as strings
  v                    # for each permutation
                       # EXAMPLE: 2E3815DD5
   y3ô                 # split in pieces of 3
                       # EXAMPLE: ['2E3','815','DD5']
      D                # duplicate
                       # EXAMPLE: ['2E3','815','DD5'], ['2E3','815','DD5']
       €SøJ            # zip the copy to swap rows and columns
                       # EXAMPLE: ['2E3','815','DD5'], ['28D','E1D','355']
           ì           # attach them to the same list
                       # EXAMPLE: ['2E3','815','DD5','28D','E1D','355']
            H          # convert from base 16 to base 10
                       # EXAMPLE: [739, 2069, 3541, 653, 3613, 853]
             D         # duplicate
                       # EXAMPLE: [739, 2069, 3541, 653, 3613, 853],[739, 2069, 3541, 653, 3613, 853]
              p        # check first copy for primality
                       # EXAMPLE: [739, 2069, 3541, 653, 3613, 853],[1,1,1,1,1,1]
               s2›     # check that each in second copy is larger than 2
                       # EXAMPLE: [1,1,1,1,1,1],[1,1,1,1,1,1]
                  *    # pairwise multiplication
                       # EXAMPLE: [1,1,1,1,1,1]
                   P   # product (1 if all were primes larger than 2, else 0)
                       # EXAMPLE: 1
                    —  # if 1, print y
                       # EXAMPLE: 2E3815DD5

Python 2, 212 206 197 194 bytes
Requires input enclosed in quotes, like "123558dde"
from itertools import*
k,p,P=3,4,[]
while k<5e3:P+=[k][:p%k];p*=k;k+=1
print[s for s in map(''.join,permutations(input()))if all(int(s[3*i:][:3],16)in P and int(s[i::3],16)in P for i in(0,1,2))]

Saving 9 and 3 bytes thanks to Jonathan Allan
Found new prime filter from xnor (modified the square away, since we dont want 2 as prime here), old prime filter is from Bob

How about P+=[k][:p%k] - when p%k is not 0 the slice will yield [k], when it is 0 it will yield [].

Also from itertools import* is a neat golf trick that'll save a couple of bytes. Also forgo the efficiency and do k<5e3.

@JonathanAllan The import saved only 1 byte in this case, thought it helps only if stuff was used multiple times. Oh the efficiency, it is hard for me to drop it ;) That refactor with the slice for P is great.

Couple more bytes by printing a list of strings: print[s for s in map(''.join,permutations(input()))if all(int(s[3*i:][:3],16)in P and int(s[i::3],16)in P for i in(0,1,2))]

Jelly, 34 30 bytes
i@€ØH’
s3µ;ZÇ€ḅ⁴µ>2aÆPẠ
Œ!ÇÐfḢ

(I should be able to use an nfind to just fetch the first match, 1# in place of ÐfḢ, for less bytes and more speed, but I'm seeing errors when I try. EDIT: wrote some changes to possibly implement this in Jelly.)
Brute force search of all permutations, filtered for the criteria, returning first match.
Way too slow for TtyItOnline. Local output examples:
C:\Jelly\jelly-master>python jelly -fu test.txt "123558DDE"
28DE1D355
C:\Jelly\jelly-master>python jelly -fu test.txt "1155578AB"
11B8A5557

How?
i@€ØH’ - Link 1, convert from hexadecimal string to integer list: string
   ØH  - yield hexadecimal characters, "0123456789ABCDEF"
i@€    - index of €ach character of s in hex chars
     ’ - decrement (vectorises) (from 1 based jelly index to place value)

s3µ;ZÇ€ḅ⁴µ>2aÆPẠ - Link 2, check if a flattened square is "all prime": string
s3               - split into threes (rows)
  µ              - monadic chain separation
   ;             - concatenate with
    Z            - transpose (columns)
     Ç€          - call last link (1) as a monad for €ach string in the list
                       -> list of integer lists
       ḅ⁴        - convert from base 16 (vectorises) -> list of decimals
         µ       - monadic chain separation
          >2     - greater than 2
            a    - and
             ÆP  - isPrime? -> list of 1s and 0s
               Ạ - all truthy?

Œ!ÇÐfḢ  - Main link: string
Œ!      - all permutations of the string
   Ðf   - filter keeping entries that evaluate to truthily for
  Ç     - last link (3) as a monad
     Ḣ  - head - return first entry

Pyth, 23 21 bytes
f*F}R-Pd2iR16sCBc3T.p

Times out online, but finishes in 1.5 minutes on my laptop. Takes input in quotes.
Explanation
f*F}R-Pd2iR16sCBc3T.p
                   .pQ     permutations of input (implicit Q)
f                 T        filter each T:
                c3             divide into rows
              CB               make pair (rows, columns)
             s                 join those lists
         iR16                  interpret items as hex
   }R                          check if each number d is in
      Pd                           its prime factors
     -  2                          with twos removed
 *F                            product (also known as all)
                           implicitly print matches

J, 49 bytes
[:(#~([:*/@(2&<*1&p:)@(,&dfh|:)_3]\])"{)i.@!@#A.]

Brute-force search that tests all permutations and outputs all permutations that satisfy the conditions for the puzzle.
The performance is good enough to compute each test case in about 3 seconds.
Usage
   f =: [:(#~([:*/@(2&<*1&p:)@(,&dfh|:)_3]\])"{)i.@!@#A.]
   f '123558dde'
28de1d355
28de1d355
28de1d355
28de1d355
2e3815dd5
2e3815dd5
2e3815dd5
2e3815dd5
   timex 'f ''123558dde'''
3.68822

Explanation
[:(#~([:*/@(2&<*1&p:)@(,&dfh|:)_3]\])"{)i.@!@#A.]  Input: string S
                                             #     Length of S
                                           !@      Factorial
                                        i.@        Range [0, len(S)!)
                                                ]  Get S
                                              A.   Find the permutations of S by index
[:(                                    )           Operate on the permutations
     (                              )"{              For each permutation P
                                   ]                   Get P
                               _3]\                    Get sublists of size 3
      [:              (       )                        Operate on the sublists
                            |:                           Transpose
                        &dfh                             Convert both the transpose and
                                                         initial from hex to decimal
                       ,                                 Join them
           (        )                                  Operate on the decimals
                1&p:                                     Test each for primality
            2&<                                          Test each if greater than 2
               *                                         Multiply them (AND)
        */@                                            Reduce using multiplication
   #~                                                Filter the permutations by those
                                                     values and return

Mathematica, 115 bytes
#<>""&@@Select[Permutations@#,And@@(PrimeQ@#&&#>2&)/@(FromDigits[#<>"",16]&/@#~Join~Transpose@#)&[#~Partition~3]&]&

The input must be a list of characters (e.g. {"1", "2", "3", "5", "5", "8", "D", "D", "E"})

Ruby, 146 bytes
Anonymous function takes an array of nine integers, returns one solution as an array of nine integers. Relies on helper function g and a require.
require'prime'
g=->x,y,z{(2<s=x<<8|y<<4|z)&&s.prime?}
->r{r.permutation{|i|a=1
3.times{|j|a&&=g[*i[j*3,3]]&&g[i[j],i[j+3],i[j+6]]}
a&&(return i)}}

This 140-byte version prints all possible solutions, with the integers as decimals (not sure if that's allowed.)
require'prime'
g=->x,y,z{(2<s=x<<8|y<<4|z)&&s.prime?}
->r{r.permutation{|i|a=1
3.times{|j|a&&=g[*i[j*3,3]]&&g[i[j],i[j+3],i[j+6]]}
a&&p(i)}}

Ungolfed in test program
require'prime'
g=->x,y,z{(2<s=x<<8|y<<4|z)&&   #combine 3 input values, check if >2
  s.prime?}                     #and check if prime
h=->r{
  r.permutation{|i|             #iterate over all permutations
    a=1                         #a=truthy
    3.times{|j|
      a&&=g[*i[j*3,3]]&&        #check rows (3 consecutive integers)
          g[i[j],i[j+3],i[j+6]] #and columns
    }
    a&&(return i)               #if a still truthy, return solution.
  }
}

#test cases: uncomment to run. solutions do not always match example solution from OP.
a=10;b=11;c=12;d=13;e=14;f=15
#p h[[1,2,3,5,5,8,d,d,e]]   #2e3815dd5
#p h[[1,1,5,5,5,7,8,a,b]]   #a7b851551
#p h[[0,3,b,d,d,f,f,f,f]]   #ffd0dfb3f
#p h[[3,5,8,9,9,b,e,f,f]]   #8f99e3bf5
#p h[[1,5,8,9,9,b,b,d,f]]   #581bb9fd9
#p h[[1,4,6,6,7,7,9,9,f]]   #6f1469779
#p h[[1,3,3,7,8,b,c,d,d]]   #78d1cd33b
#p h[[2,4,5,7,7,b,b,d,d]]   #7274bd5db
#p h[[1,1,1,8,b,b,d,d,d]]   #11b18dbdd
#p h[[2,2,3,5,5,6,c,d,d]]   #623c25dd5
#p h[[1,2,5,5,7,8,9,9,a]]   #8a5295971
#p h[[1,1,3,5,7,9,b,b,d]]   #5b3db7191

Groovy, 134 Bytes
Finds all possible solutions and returns them as an array, returns [] if there isn't a solution.
{it.toList().permutations().collect{it.collate(3).every{x=Integer.parseInt(it.join(),16);(2..x**0.5).every{x%it>0};}?it.join():0}-[0]}

Example input: 123558dde
Output:
[8235d5e1d, 2dd851e35, 815e352dd, 2e3d5518d, d2d3e5581, 853de5d21, 2dd3558e1, 2dd3e5581, 2e355d18d, 2518dd3e5, dd52e3185, e1d5d5283, 823ed1d55, 28d3e515d, 28d15de35, e351258dd, e5dd21853, 851d2d3e5, ed515d283, 2dd3e5185, 85de35d21, 5d1ed5823, 8dd355e21, d2d3e5815, d2d3e5851, 251e358dd, 2dde35851, 8235d5ed1, 2dde35815, e3585dd21, d2d8153e5, 85d5d12e3, 21dd85e35, d8521de35, 21d85d3e5, e1d5d5823, e35581d2d, 3e52dd581, dd52e3851, dd52e3815, 3e5281dd5, 8dd1253e5, 3e5815d2d, 3e55d128d, ed515d823, de5853d21, e218dd355, d8d1253e5, d8d251e35, d8d5512e3, 2dde35581, 3e52dd851, 5d1ed5283, e21dd5853, 3e5d2185d, 2513e58dd, 2dd3e5815, 2dd3e5851, e1d823d55, 3e52dd815, 581d2de35, e3515d28d, 2e318dd55, ed1823d55, dd52813e5, dd52e3581, 2e3515d8d, 28d3e55d1, 82355de1d, 82355ded1, 2dde35185, 3e5d8d125, 85d21de35, 281dd53e5, d21d85e35, d21e35d85, 2dd8e1355, 28d5d1e35, 85d15d2e3, 2813e5dd5, 3e5d2d185, 5d1e5d283, 3e5d2d581, e1dd55823, 3558e12dd, d55283e1d, 15dde5283, 5d128d3e5, 5518dd2e3, e5d28315d, 5d5823ed1, d2d1853e5, 823d55e1d, de521d853, d81d552e3, 5d5823e1d, 21ded5853, 823e1dd55, 3e52dd185, 5812dde35, d85e35d21, 3e585d21d, 8512dd3e5, 3e5251d8d, d2d8513e5, e1dd55283, 2e3d81d55, 853ed5d21, 2835d1ed5, 15d2e3d85, 5d1e3528d, 15dde5823, e35851d2d, 55d283e1d, 2e3551d8d, 8dd3e5125, 85d3e5d21, 8152e3dd5, 28de1d355, e1d55d823, 8dd3e5251, 5158dd2e3, e3521dd85, e1d35528d, 2e35d185d, 21de5d853, 823d55ed1, 5813e52dd, 8153e5d2d, e1d55d283, 21de3585d, d85d21e35, 5152e3d8d, 8513e5d2d, dd5e21853, 3552dd8e1, d552e318d, e5d2835d1, 2835d1e5d, 2835d1de5, 5d1e5d823, 8dde35125, 5d52e3d81, 3e5821dd5, 28d5d13e5, e35d21d85, dd51852e3, d2d185e35, 8dde35251, 8dd2513e5, e35d2d185, 2835d5e1d, 1852e3dd5, d85d213e5, 515d8d2e3, dd53e5821, d5518d2e3, 8dd5512e3, 283d55ed1, e5d5d1823, 28d355ed1, 3e58152dd, d812e3d55, e5d85321d, d8515d2e3, d2d581e35, 3e5581d2d, 85d21d3e5, 283d55e1d, dd53e5281, 851dd52e3, e35dd5821, 3e51258dd, dd58512e3, 28d355e1d, d8d2513e5, 125e358dd, e35dd5281, e35d2d851, d8d2e3515, e35d2d815, d21853ed5, d8d2e3551, 1852dd3e5, d21853e5d, 85dd213e5, d21853de5, 5d1283e5d, 823ed155d, 5d1283de5, ed521d853, 283e1dd55, d8d355e21, d8de35251, 5d1283ed5, e35d2d581, 3e528d15d, d55283ed1, 8512dde35, 3e5851d2d, 823ed15d5, 15d28de35, 15d3e528d, 2835d5ed1, 5d12e385d, 5d185d2e3, 5d5283e1d, 55d2e3d81, d2185de35, d55e1d283, ed582315d, 2dd8513e5, 853e5d21d, e352dd581, 851e352dd, 2dd5813e5, e352dd815, 853d21e5d, e352dd851, dd5821e35, ed155d283, 3e5d8d251, d8de35125, 2e3d8d551, 3e528d5d1, e5d21d853, dd5853e21, 853d21ed5, 85de3521d, e352518dd, 2e3d8d515, 125d8de35, e352dd185, 853d21de5, 8e13552dd, 1258dde35, 581e352dd, e21d8d355, ed155d823, e21853dd5, e3528d5d1, d2d851e35, 5512e38dd, 125d8d3e5, 2e3815dd5, 2513e5d8d, 21dde5853, 355d2d8e1, d55ed1283, 815dd52e3, 283ed1d55, 8152dd3e5, 281e35dd5, 28355de1d, 355e1d28d, ed182355d, 853dd5e21, e3528d15d, ed18235d5, 15d85d2e3, e351852dd, d55e1d823, 8e12dd355, 28355ded1, 2dd815e35, 581d2d3e5, d55ed1823, 15d283ed5, 821dd53e5, 2e35d518d, 5d5283ed1, 15d283e5d, 15d283de5, e1d28355d, e5d5d1283, 251d8d3e5, e1d2835d5, dd5281e35, ed15d5823, 21de35d85, dd58152e3, 2dd1853e5, 1258dd3e5, 5d5e1d283, 1253e58dd, 3e5d8521d, 18d2e3d55, e358152dd, 5512e3d8d, e35251d8d, 853ed521d, 3e5dd5281, 5813e5d2d, ed15d5283, 18d55d2e3, 281dd5e35, 8dde21355, 1852dde35, 3e585dd21, d85e3521d, 581e35d2d, ed1283d55, d812e35d5, 2e35518dd, 5d128de35, 8153e52dd, ed55d1823, e5d82315d, e35d85d21, d812e355d, d853e521d, 8dd2e3551, 2e3581dd5, 15de5d823, 8dd2e3515, 185e35d2d, 125e35d8d, 581dd52e3, 5d5e1d823, 5812e3dd5, 5152e38dd, 3558e1d2d, 85d3e521d, 5d1d852e3, 823de55d1, 2e3d8155d, d213e585d, ed55d1283, 2e3dd5581, 2e3dd5815, 15d823ed5, 2e3dd5851, d552e3d81, 55de1d823, e5d8235d1, 21d853de5, de528315d, d21e3585d, 2e3d815d5, 21d853e5d, ed58235d1, 2e3dd5185, 21d853ed5, de52835d1, 15d823e5d, e1d28d355, 355ed128d, 5812dd3e5, 815d2d3e5, 15d823de5, 823de515d, 55de1d283, ed5853d21, 2dd8153e5, 2e3d855d1, 185dd52e3, 8e1355d2d, 2e3d55d81, d2d3558e1, d8521d3e5, e5d15d823, ed52835d1, 35528de1d, dd5e35281, 3e58dd251, 5d5ed1283, dd58213e5, e355d128d, 3e58dd125, 3e5125d8d, 8213e5dd5, 355e218dd, 2e3d8515d, 35528ded1, e5d15d283, 853e21dd5, 8dd125e35, 15ded5823, e358dd251, 2e315dd85, 851d2de35, 551d8d2e3, d2d5813e5, ed528315d, 2e3185dd5, 185d2de35, 8152dde35, e35d2185d, 15de3528d, e358dd125, 251e35d8d, 5d5ed1823, 821dd5e35, 251d8de35, 8512e3dd5, 5d1823de5, d2d815e35, 3e51852dd, 5d1823e5d, 82315dde5, 3e5dd5821, 82315de5d, 5d518d2e3, 1853e5d2d, 8dd251e35, ed128355d, e1d8235d5, 82315ded5, d21ed5853, 823ed515d, 2e38dd551, ed135528d, 2e38dd515, 5d1823ed5, 2e318d55d, 15de5d283, e1d82355d, ed1d55823, 2e3851dd5, d8d5152e3, 283de515d, 823ed55d1, 3e55812dd, dd5e35821, 15ded5283, e21355d8d, 21d85de35, 8dd5152e3, e35125d8d, e355812dd, 5d52e318d, 8e1d2d355, d8155d2e3, 3e5d21d85, 21d3e5d85, ed12835d5, de585321d, d2185d3e5, 85dd21e35, 2e318d5d5, d213e5d85, 2e385d5d1, 55d823ed1, 15d2e385d, 3e521dd85, 283de55d1, ed1d55283, d8de21355, de5d21853, 55d823e1d, d852e315d, 355d8de21, d852e35d1, 8513e52dd, 185d2d3e5, 853e5dd21, 21d3e585d, 2dd581e35, de582315d, 823e5d15d, de515d283, 185e352dd, 28de3515d, 3e5d2d815, d21de5853, 283ed155d, 3e5d2d851, 55d283ed1, 3558dde21, 283ed15d5, d815d52e3, 28de355d1, 851e35d2d, de515d823, 5d1de5823, 55dd812e3, 283e5d15d, dd55812e3, 823e5d5d1, 15dd852e3, d2de35185, 1253e5d8d, 2e35d5d81, 1853e52dd, 2e35158dd, 21dd853e5, e35185d2d, 283e5d5d1, 18dd552e3, e35281dd5, 5d13e528d, e1d283d55, 2e385d15d, 28315de5d, 85d2e35d1, 28315dde5, 2dd185e35, e3585d21d, 283ed55d1, 5d1de5283, 28315ded5, d55823ed1, 5d12e3d85, e5d853d21, e35d8d125, e358512dd, d55823e1d, 815e35d2d, e35d8d251, 18d5d52e3, 28ded1355, e3521d85d, 283ed515d, 821e35dd5, d2d3e5185, 85321de5d, d2de35815, e35d8521d, d55d812e3, e213558dd, e35815d2d, d855d12e3, 15d28d3e5, d21e5d853, 85d2e315d, 3e58512dd, d2de35851, ed128d355, 28d15d3e5, 3e52518dd, 18d2e355d, de55d1823, d2de35581, 85321ded5, d2d8e1355, d853e5d21, 18d2e35d5, 2e35d1d85, 85321dde5, 3e5185d2d, 853de521d, 355e21d8d, 5d5d812e3, 55ded1823, de55d1283, 8235d1ed5, e35821dd5, 2518dde35, 8235d1de5, 8235d1e5d, 3e521d85d, d8d125e35, 2e315d85d, ed5d21853, 55ded1283, 815d2de35, 283e1d55d, 823e1d55d, 2e355dd81, 3e5d85d21, d8d3e5125, 3e515d28d, d21d853e5, 283e1d5d5, ed585321d, 823e1d5d5, 55d2e318d, d8d3e5251, 55d18d2e3, de58235d1]

Example input: 222222222
Output: []
If anyone wants me to comment it out, holler at a brother.

Is it also testing the vertical primes?

Gaahhh fuck good point... I thought that was too easy... Fixing expect +70 bytes.


text:
Write a self-aware program
A standard (but disputed) test of self-awareness is the mirror test: An animal is considered self aware if it can recognize itself in the mirror.
Your task is to write a program that is self-aware according to this test. More exactly:

The program reads input in whatever form is suitable for your language.
If the input contains a mirror image of its own source code, it produces a truthy value, otherwise a falsey value.
A valid mirror image is the exact source of the program with the order of characters reversed, with no extra characters in between. As a special exception, for systems/languages that don't use single characters to terminate/separate lines (e.g. using a CR/LF sequence), the line termination sequence is allowed, but not required to be kept intact on reversal. However the program must be consistent in its treatment of lines.
For example, on a system using CR/LF as line separator, the sequence  AB<cr><lf>CD may be reversed either to DC<cr><lf>BA (keeping the line ending intact) or to DC<lf><cr>BA (completely reversing the character sequence).
The mirror image must be detected also if it is preceded or followed by junk, even if that junk contains reversed fragments of the code.

This is code golf; the shortest entry wins.
Note this is not the same as this question because of (a) the  reversal of the code, and (b) the fact that it has to tolerate junk before and after the reversed code, including junk that is very similar to the actual reversed code.

Borderline duplicate.

@MartinEnder I'd call it a dupe.

Note about generalized quines.

@xnor I was just about to post that before I realised that Retina does actually have a solution that isn't based on the standard quine.

Please use the Sandbox in the future to get feedback on your challenges before posting them to the main site.

Just out of curiosity, would the following JS answer have been considered as valid according to the current quine rules? (I'm not familiar with them.) s=>~s.indexOf([...unescape(q='s=>~s.indexOf([...unescape(q=%270%27).replace(0,q)].reverse().join\`)').replace(0,q)].reverse().join``)`

Retina, 1 byte
x

Try it online!
Prints a positive integer when the input contains at least one "reversed" copy of the source and 0 otherwise.
Any character that isn't a backtick or a regex metacharacter ([()?*+\\^$.) would work.

Interesting solution, but don't we require quines to be proper now?

@xnor If we extend that definition to generalised quines, then don't all solutions have to be extensions of a standard quine? I figured the only way to have interesting solutions to those is to find a way to circumvent that. (Especially since there's no way to use this approach for a standard quine in Retina, nor for most generalised quines.)