text:
Decimal Time of Day Conversion
Introduction
Time is confusing. Sixty seconds to a minute, sixty minutes to an hour, twenty-four hours to a day (and not to mention that pesky am/pm!).
There's no room for such silliness nowadays, so we've decided to adopt the only sensible alternative: decimal days! That is to say, each day is considered 1 whole unit, and anything shorter is written as a decimal fraction of that day. So, for example: "12:00:00" would be written as "0.5", and "01:23:45" might be written as "0.058159".
Because it will take time to get used to the new system, you are tasked with writing a program that can convert between them in both directions.
Challenge
Write a program in the language of your choice, that given a modern time in the ISO-8601 format of "hh:mm:ss", will return the equivalent decimal fraction unit. Likewise, given a decimal fraction, the program should return the time in the modern format initially specified.
You can make the following assumptions:

The modern time input and output can range from "00:00:00" to "24:00:00"
The decimal time input and output can range from "0" to "1", and should be able to accept/output up to at least 5 decimal places (such as "0.12345"). More precision is acceptable
The program should be able to know which conversion direction to perform based on input
You cannot use time related functions/libraries

The winner will be determined by the shortest code that accomplishes the criteria. They will be selected in at least 7 decimal day units, or if/when there have been enough submissions.
Examples
Here's a(n intentionally) poorly written piece of JavaScript code to be used as an example:
function decimalDay(hms) {
    var x, h, m, s;
    if (typeof hms === 'string' && hms.indexOf(':') > -1) {
        x = hms.split(':');
        return (x[0] * 3600 + x[1] * 60 + x[2] * 1) / 86400;
    }
    h = Math.floor(hms * 24) % 24;
    m = Math.floor(hms * 1440) % 60;
    s = Math.floor(hms * 86400) % 60;
    return (h > 9 ? '' : '0') + h + ':' + (m > 9 ? '' : '0') + m + ':' + (s > 9 ? '' : '0') + s;
}
decimalDay('02:57:46'); // 0.12344907407407407
decimalDay('23:42:12'); // 0.9876388888888888
decimalDay(0.5); // 12:00:00
decimalDay(0.05816); // 01:23:45

Hmm... 60 is almost 64. I wonder what time would be like if there were 64 seconds in a minute and 64 minutes in an hour (and 16 or 32 hours in a day).

Do we have to handle leap seconds? so 23:59:60 is 1 second from the end of a 86401 second day?

@Sparr No need to worry about leap seconds. This is the future, where we have decided that it's silly for a second to be considered an absolute value while also tying it to the relative speed of the rotation of the earth ;)

@MichaelT It'd be a programmers dream world =P

@Mwr247 yep. DNS TTL has (had?) a field that is n where n is 2^n seconds.  So a value of '6' had a TTL of about 1 minute. A value of '12' had a TTL of about 1 hour. '15' was about 8 hours and so on. It allowed one byte to define the timeout and give you enough control for short or long times.

For those looking for loopholes, note that MicroSoft Excel and LibreOffice Calc already use floating point as their internal representations of dates and times! They both have scripting languages built-in.

CJam, 58 56 42 bytes
I am sure this is too long and can be golfed a lot. But here goes for starters:
86400q':/:d_,({60bd\/}{~*i60b{s2Ue[}%':*}?

Try it online here

Heh, we have similar ideas

@aditsu Oh!. Didn't see yours before updating mine and then was in a hurry to commute.

You know what.. feel free to use my code: 86400q':/:d_,({60bd\/}{~*mo60bAfmd2/':*}?, I'm deleting my answer. The mo is so that 0.058159 converts to 01:23:45

Python 2, 159 150 141 + 2 = 143 Bytes
Straightforward solution, can probably be much shorter. Will work on it.
Added two bytes to account for input needing to be enclosed in "s. Also, Sp3000 pointed out an issue with eval() interpreting octals, and showed a way to shorten formatting, use map() and remove one print.
n=input();i=float;d=864e2
if':'in n:a,b,c=map(i,n.split(':'));o=a/24+b/1440+c/d
else:n=i(n);o=(':%02d'*3%(n*24,n*1440%60,n*d%60))[1:]
print o

Check it out on ideone here.

C, 137 bytes
Full C program. Takes input on stdin and outputs on stdout.
main(c){float a,b;scanf("%f:%f:%d",&a,&b,&c)<3?c=a*86400,printf("%02d:%02d:%02d",c/3600,c/60%60,c%60):printf("%f",a/24+b/1440+c/86400.);}

Ungolfed and commented:
int main() {
    // b is float to save a . on 1440
    float a,b;
    // c is int to implicitly cast floats
    int c;

    // If the input is hh:mm:ss it gets splitted into a, b, c
    // Three arguments are filled, so ret = 3
    // If the input is a float, it gets stored in a
    // scanf stops at the first semicolon and only fills a, so ret = 1
    int ret = scanf("%f:%f:%d", &a, &b, &c);

    if(ret < 3) {
        // Got a float, convert to time
        // c = number of seconds from 00:00:00
        c = a * 86400;
        printf("%02d:%02d:%02d", c/3600, c/60 % 60, c%60);
    }
    else {
        // a = hh, b = mm, c = ss
        // In one day there are:
        // 24 hours
        // 1440 minutes
        // 86400 seconds
        printf("%f", a/24 + b/1440 + c/86400.);
    }
}

Very clear use of scanf and %f

D'oh! I meant "clever".

Your c is int therefore c/86400=0

Javascript (ES6), 116 110 bytes

f=x=>x[0]?([h,m,s]=x.split(':'),+s+m*60+h*3600)/86400:[24,60,60].map(y=>('0'+~~(x*=y)%60).slice(-2)).join(':')

// for snippet demo:
i=prompt();
i=i==+i?+i:i; // convert decimal string to number type
alert(f(i))

Commented:
f=x=>
    x[0] ? // if x is a string (has a defined property at '0')
        ([h, m, s] = x.split(':'), // split into hours, minutes, seconds
        +s + m*60 + h*3600) // calculate number of seconds
        / 86400 // divide by seconds in a day
    : // else
        [24, 60, 60]. // array of hours, minutes, seconds
        map(y=> // map each with function
            ('0' + // prepend with string zero
                ~~(x *= y) // multiply x by y and floor it
                % 60 // get remainder
            ).slice(-2) // get last 2 digits
        ).join(':') // join resulting array with colons

24:00:00 produces 1 but the inverse is not true

@rink.attendant.6 fixed

Julia, 152 143 142 bytes
Well, I updated my approach to be less "Julian," as they say, for the sake of golfing. For a better (though less concise) approach, see the revision history.
x->(t=[3600,60,1];d=86400;typeof(x)<:String?dot(int(split(x,":")),t)/d:(x*=d;o="";for i=t q,x=x÷i,x%i;o*=lpad(int(q),2,0)*":"end;o[1:end-1]))

This creates an unnamed function that accepts a string or a 64-bit floating point number and returns a 64-bit floating point number or string, respectively. To call it, give it a name, e.g. f=x->....
Ungolfed + explanation:
function f(x)
    # Construct a vector of the number of seconds in an hour,
    # minute, and second
    t = [3600, 60, 1]

    # Store the number of seconds in 24 hours
    d = 86400

    # Does the type of x inherit from the type String?
    if typeof(x) <: String
        # Compute the total number of observed seconds as the
        # dot product of the time split into a vector with the
        # number of seconds in an hour, minute, and second
        s = dot(int(split(x, ":")), t)

        # Get the proportion of the day by dividing this by
        # the number of seconds in 24 hours
        s / d
    else
        # Convert x to the number of observed seconds
        x *= d

        # Initialize an output string
        o = ""

        # Loop over the number of seconds in each time unit
        for i in t
            # Set q to be the quotient and x to be the remainder
            # from x divided by i
            q, x = divrem(x, i)

            # Append q to o, padded with zeroes as necessary
            o *= lpad(int(q), 2, 0) * ":"
        end

        # o has a trailing :, so return everything up to that
        o[1:end-1]
    end
end

Examples:
julia> f("23:42:12")
0.9876388888888888

julia> f(0.9876388888888888)
"23:42:12"

julia> f(f("23:42:12"))
"23:42:12"

Python 3: 143 Bytes
i,k,l,m=input(),60,86400,float
if'.'in i:i=m(i)*l;m=(3*':%02d'%(i/k/k,i/k%k,i%k))[1:]
else:a,b,c=map(m,i.split(':'));m=(a*k*k+b*k+c)/l
print(m)

Same byte count as the python 2 solution but it seems we took different approaches to the maths.

J, 85 bytes
Results:
T '12:00:00'
0.5
T 0.5
12 0 0
T '12:34:56'
0.524259
T 0.524259
12 34 56
T=:3 :'a=.86400 if.1=#y do.>.(24 60 60#:y*a)else.a%~+/3600 60 1*".y#~#:192 24 3 end.'

Total 85

Welcome to the site! I edited your post so that the code will be displayed as code. As for an online link, the best one I know of is TIO. I would give you a link, but I'm not experienced with J, so I don't know the right way to invoke it. Also, this seems to be 91 bytes when you include the first and last lines. Is this correct?

Thanks for your help! The program [a=... to end.] Is 77. The title is 10. The terminator is 1, so that makes 88. With three line feeds that makes 91! I'll work on it :o)

Now down to an 85 byte one-liner!

C, 156 152 bytes
I thought it is going to be easy for C. But still ended up quite large. :(
n,m=60;d(char*s){strchr(s,58)?printf("%f",(float)(atoi(s)*m*m+atoi(s+3)*m+atoi(s+6))/m/m/24):printf("%02d:%02d:%02d",(n=atof(s)*m*m*24)/m/m,n/m%m,n%m);}

Test Program:
#include <stdio.h>
#include <stdlib.h>

int n,m=60;
d(char*s)
{
    strchr(s,':') ?
        printf("%f",(float)(atoi(s)*m*m+atoi(s+3)*m+atoi(s+6))/m/m/24):
        printf("%02d:%02d:%02d",(n=atof(s)*m*m*24)/m/m,n/m%m,n%m);
}

int main()
{
    d("01:23:45");
    printf("\n");
    d("02:57:46");
    printf("\n");
    d("23:42:12");
    printf("\n");
    d("12:00:00");
    printf("\n");
    d("0.5");
    printf("\n");
    d("0.05816");
    printf("\n");
    d("0");
    printf("\n");
    d("1");
    printf("\n");
    return 0;
}

Output:
0.058160
0.123449
0.987639
0.500000
12:00:00
01:23:45
00:00:00
24:00:00

Javascript, 194 192 190 188 bytes
function(z){if(isNaN(z)){x=z.split(':');return x[0]/24+x[1]/1440+x[2]/86400}h=(z*24)|0;h%=24;m=(z*1440)|0;m%=60;s=(z*86400)|0;s%=60;return""+(h>9?'':0)+h+':'+(m>9?'':0)+m+':'+(s>9?'':0)+s}

JavaScript ES6, 98 130 bytes
s=>s==+s?'246060'.replace(/../g,l=>':'+('0'+~~(s*=+l)%60).slice(-2)).slice(1):s.split`:`.reduce((a,b)=>+b+(+a)*60)*1/864e2;f(0.5);

Unfortunately, time related functions (such as "Date" and "toTimeString") are not allowed in this challenge. Otherwise, it's a much more concise way of doing it =)

@Mwr247 oh did not see that, I'll be fixing this then

PHP, 70 69 bytes
<?=strpos($t=$argv[1],58)?strtotime($t)/86400:date("H:i:s",$t*86400);

takes input from command line argument, prints to STDOUT:
If input contains a colon, convert to unix time and divide by (seconds per day),
else multply numeric value with (seconds per day) and format unix time to hh:mm:ss.

No time function

Perl, 109 108 101 + 6 (-plaF: flag) = 107 bytes
$_=$#F?($F[0]*60+$F[1]+$F[2]/60)/1440:sprintf"%02d:%02d:%02d",$h=$_*24,$m=($h-int$h)*60,($m-int$m)*60

Using:
perl -plaF: -e '$_=$#F?($F[0]*60+$F[1]+$F[2]/60)/1440:sprintf"%02d:%02d:%02d",$h=$_*24,$m=($h-int$h)*60,($m-int$m)*60' <<< 01:23:45

Try it on Ideone.

Excel, 178 bytes
=IF(LEFT(A1,2)="0.",TEXT(FLOOR(A1*24,1),"00")&":"&TEXT(MOD(FLOOR(A1*1440,1),60),"00")&":"&TEXT(MOD(FLOOR(A1*86400,1),60),"00"),((LEFT(A1,2)*60+MID(A1,4,2))*60+RIGHT(A1,2))/86400)


text:
mini SPICE solver
SPICE is an electrical circuit simulation program originating from UC Berkeley. Your goal is to implement a minimalistic version which can solve for the nodal voltages and branch currents of a circuit composed of resistors and DC current sources.
Input Format
The input may come from a file, io stream, or the nearest equivalent in your language of choice. However, it cannot be a function input or hard-coded string. The format should be a subset of what the original SPICE used. A quick summary of what is required for the input format:

First line is a title line
Following the title is the description of circuit components and their connectivity. This may be in any order (i.e. you can't assume all resistors come before current sources/vice-versa). See component descriptors below for how component descriptions are formatted.
Following the circuit components is the command control block. The only solver you need to implement is the DC operating point solver (.OP)
Following the command control block are the values to output (nodal voltages/branch currents). See output descriptors below for how these should be formatted.
The last line is .END (you may choose whether an ending carriage return is required or optional)
Any line beginning with * denotes a comment and must be skipped by your parser.

Component Descriptors
All component descriptors are in the form:
XN A B C

Where:

X is R for resistor or I for a current source
XN is the name of the component. N may be any alphanumeric sequence.
A is a non-negative integer indicating which node the positive terminal for the component is connected.
B is a non-negative integer indicating which node the negative terminal for the component is connected.
C is a decimal value (for a resistor this is the resistance, and for a current source this is the current from this source)
By convention, node 0 is considered ground and is at 0V. All other nodal voltages are referenced from ground.
By convention, positive current flows from the positive terminal to the negative terminal.

Output descriptors
The only output format you need to support is .PRINT. This may output to a file, output stream, or the nearest equivalent in your language of choice. It may not be just a function return string.
Format of .PRINT statements:
.PRINT X(N)

X is V for printing a nodal voltage or I for printing the current through a component.
N is the name of the quantity being outputted. For a nodal voltage, this is any non-negative number. For a current, this is the component name.

For each print statement, you should output the argument and the appropriate value v:
X(N) v

You may print the output in any order so long as there's one output per line.
Things you don't have to support

Subcircuits
"Line continuations" (i.e. any lines starting with a +)
"SI" suffixes (e.g. 1k instead of 1000). However, your code should be able to handle decimal input (you may specify the format)
Error handling (i.e. you may assume the input is properly formatted and has a unique solution)
You may specify any case requirements (all upper case, all lower case, case insensitive, case sensitive, etc.)
You may choose to require that the nodes may be ordered sequentially without skipping any integers.
You may use any solver algorithm you want.

Scoring and Misc.

This is code golf, shortest code in bytes wins.
You may use any libraries you wish provided it wasn't designed specifically for handling circuits. Ex.: Using BLAS/LAPACK for matrix math is ok, but you can't use Ngspice because it is a SPICE circuit simulator already.
Any other standard loop holes are prohibited.
For guidance on how to implement a solver, here's a quick guide on modified nodal analysis. Note that because there are no voltage sources you can implement only the basic nodal analysis part (I link this resource because it has some good insights on how to implement such a solver). Additional resources on MNA and another another approach, sparse tableau analysis, can be found here.

Example inputs and expected outputs
Ex. 1
Example 1
* this is a comment
R1 1 0 1
I1 0 1 1
.OP
.PRINT I(R1)
.PRINT V(1)
.END

Output:
I(R1) 1
V(1) 1

Ex. 2
Example 2
I1 1 0 1
* this is a comment
R1 1 0 1
.OP
.PRINT V(0)
.PRINT I(R1)
.PRINT I(I1)
.PRINT V(1)
.END

Output:
V(0) 0
I(R1) -1
I(I1) 1
V(1) -1

Ex. 3
Example 2
ISINK 1 0 1.0
ISOURCE 0 2 2
R1 1 0 10
R2 1 2 1
.OP
.PRINT V(1)
.PRINT V(2)
.PRINT I(R1)
.PRINT I(ISOURCE)
.PRINT I(R2)
.END

Output:
V(1) 10
V(2) 12
I(R1) 1
I(ISOURCE) 2
I(R2) -2

Python + MiniZinc, 703 642 bytes
thanks to @Unrelated String for the input to golf more
import sys
t=sys.stdin.readlines()[1:]
d=[[x.split()[i]for x in t if x[0]not in".*"]for i in range(4)]
a="array[1..m]of "
F=r"/\forall(j in "
print("output[",*(fr'"{x[7:-1]} \({x[7].lower()}[{x[7]=="I"and-~d[0].index(x[9:-2])or x[9:-2]}])\n",'for x in t if".P"==x[:2]),'""];',fr"int:m={len(d[0])};int:n={max(map(int,d[1]+d[2]))};"+fr"array[0..n]of var float:v;{a}var float:i;{a}int:s;{a+'int:e;enum T={R,I};'+a}T:t;{a}float:x;constraint v[0]=0{F}1..m)(t[j]=I/\x[j]=i[j]\/t[j]=R/\v[s[j]]-v[e[j]]=x[j]*i[j]){F}0..n)(sum([i[k]*((s[k]=j)-(e[k]=j))|k in 1..m])=0);")
d[0],_=zip(*d[0])
for i,n in enumerate("tsex"):print(f"{n}=[{','.join(d[i])}];")
Attempt This Online!
How to run: python <script file> | minizinc -. It may be necessary to explicitly select the solver to use, passing the arguments --solver <solver id> to minizinc.
What is MiniZinc?
Minizinc is a constraint programming modelling language; the homonymous command line tool compiles the model, runs a solver, and outputs the solution in the desired format. It is not a proper programming language (since it is not Turing complete), but it can be considered a library since one could replace it by using its proper native python interface.
How it works
The Python code just handles the input format, translating it into a MiniZinc model. The model imposes the following constraints:

the voltage of node 0 must be 0;
Kirchhoff's current law must be respected in all nodes;
Ohm's law must be respected in all resistors.

Here's an ungolfed version of the MiniZinc model (without the actual parameters):
% n is the number of nodes (excluding the ground node)
% m is the number of edges (resistors and current sources)

array[0..n] of var float: voltage;
array[1..m] of var float: current;

array[1..m] of 0..n: start; % the first  node of each edge
array[1..m] of 0..n: end;   % the second node of each edge

enum T = {R, I}; % the two types of edge: resistors and current sources

array[1..m] of T: t; % the type of each edge
array[1..m] of float: x; % the value (resistance or current) associated with each edge

% 0 is ground
constraint volt[0]=0;

% source current is equal to current
constraint forall (i in 1..m where t[i]==I) (x[i] == current[i]);

% V = R * I
constraint forall (i in 1..m where t[i]==R) (voltage[start[i]] - voltage[end[i]] = x[i] * current[i]);

% sum of currents is zero
constraint forall (j in 0..n)
  ( sum([current[i] | i in 1..m where start[i]==j]) ==
    sum([current[i] | i in 1..m where end[i]==j]));

Amazing! Can be golfed a bit, and maybe more by compressing some common substrings like array[, but I don't actually understand the problem itself well enough to know what ways would be valid.

if x[0]not in".*" => if(x[0]in".*")^1 for -1

And import sys;t=sys.stdin.readlines()[1:] => _,*t=open(0)

source: Stack Exchange

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

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

sort: votes


text:
Create an interface that fits the XKCD Types

colors.rgb("blue") yields "#0000FF". colors.rgb("yellowish blue") yields NaN. colors.sort() yields "rainbow"

Using the rules set out in the image and its title text (quoted here), create a program that accepts all the given input and displays the appropriate output.

Input can be taken with stdin or nearest equivalent. There should be a line like [n]> on which to type it, and n increases by 1 each command. It should start at 1.
The result should be displayed using stdout or nearest equivalent. There should be a => on each line of output.

All 13 conditions, plus the 3 in the title (quoted) must work.
This is code golf, so shortest answer wins.

How general should the interface be? For instance, does the floor function have to work for any provided float or can we assume it will only ever be passed 10.5?

Are the > for the output aligned with the > for the input, as n grows and the input > moves farther to the right?

This comic can potentially be interpreted in several ways. Could you provide a list of what specific types and operations we need to implement?

@dohaqatar7 any interpretation is acceptable unless stated otherwise. Only the test cases have to match.

@dohaqatar7 only 10.5 - I have no idea what 3+5 is :)

@Sparr it would be cool, but is optional.

@Sparr if it outputs the test cases, you're fine.

@Tim the alignment in the test cases is unclear. it appears to show [1] > and [10] > being the same width, and all that implies for the = > lines below them.

[tag:code-golf] questions require a strict specification.  "any interpretation is acceptable" is far too fuzzy, IMO.

@DigitalTrauma that's not what I said - I said if it outputs the above it's fine.

Why should n increase by 1? That's not what the comic does... ;-)

To be brutally honest, I think that this is way too underspecified as we do not know how each example reacts for any input. In the end this broils down to a [tag:kolmogorov-complexity] variant.

@BetaDecay Then don't answer it?

@WolframH It is - but he made 2 = 4 in command 11 so it displays 14 not 12.

@Tim LOL, thanks for clearing that up :-)

@Tim I don't see how 2+2 means 2 should become 4. Yes, the output of command 14 shows that it now is, but still, I don't get it.

@MrLister I think it's 2 is 2 then he +2 to it.

Python 3, 700 698 697 689 683 639 611
Tabs as indentation.
from ast import*
E=literal_eval
O='=>%s\n'
P=print
I=int
def Q(a):P(O%a)
def W(a):Q('"%s"'%str(a))
def gb(a):W(_ if'y'in a else'#0000FF')
def t():W('rainbow')
def FLOOR(n):P(O%'|'*3+(O%'|{:_^10}').format(n))
def RANGE(*a):Q([('"','!',' ','!','"'),(1,4,3,4,5)][len(a)])
c=0
while 1:
    try:
        c+=1;A,*B=input('[%d]>'%c).split('+')
        if not A:W(c+I(B[0]))
        elif A=='""':Q("'\"+\"'")
        elif B:
            A=E(A);B=E(B[0])
            if A==B:Q('DONE')
            elif type(A)==list:Q(A[-1]==B-1)
            elif type(B)==list:W([I(A)])
            else:W(A+I(B))
        else:eval(A.lstrip('colrs.'))
    except:Q('Na'+['N','P','N.%s13'%('0'*13)][('-'in A)+len(B)])

Since this uses a bare Except you can't Ctrl-C it. Ctrl-Z and kill %% work though
Some of the conditions are generalized and others will only work with exact input.

A+"B" will work with any A and B not just when A == B
"A"+[] will work for any A that can be converted to an int (Includes hex and binary strings e.g 0xff and 0b01010)
(A/0) will work for any A, Eval Causes DivideByZeroError which is handled in the except
(A/0)+B will work with any A or B. literal_eval (E) raises an error.
""+"" only works for the + sign. Anything else will print NaN, NaP or NaN.00...
[A, B, C]+D works by checking that D == C+1 so will work for any length of list and any numbers.
^^
2/(2-(3/2+1/2)), Anything that fails to parse that has - with a + somewhere after it will output NaN.000...13
RANGE(" ") Hardcoded
+A will work for any A. Ouputs "current_line_number+A"
A+A works for any A as long as they are the same and are bulitin python types
RANGE(1,5) Hardcoded.
FLOOR(A) works for any A.
colors.rgb("blue") The lstrip in eval turns this in gb("blue") which has a hardcoded response.
colors.rgb("yellowish blue") The lstrip in eval turns this in gb("yellowish blue") which attempts to use a non existent variable if y is present in the arguement causing an error which the except turns into NaN
colors.sort() The lstrip turns this into t() which has a hardcoded response.

Brainsteel pointed out an error in my assumption for rule 10.

Very neat. I think, on #10, it seems that the "+A" is intended to output the line number + A, rather than just prepending 1.

Ahh yes, obvious now that its pointed out. Well that means that int will be better as a single letter function. Might save a byte or two.

re #9: RANGE(" ") is a range of characters from the double quote character \x22 to the space character \x20 and back.

re the jump: because Randall set 2 to 4 in line 11, 2 is now 4 and 12 is now 14. This also applies to line numbers.

You could save some bytes by using space, tab and tab + space for your indentation.

I believe RANGE(s) == (s, chr(ord(s)+1))*2 or similar.

list is shorter than T([]).

Python, 1110 bytes
Operator overloading isn't evil, right??
from re import*
class V(str):
 def __add__(s,r):return s[:-1]+chr(ord(s[-1])+r)
class S(str):
 def __str__(s):return "'"+s+"'"if '"'in s else'"'+s+'"'
 def __repr__(s):return str(s)
 def __add__(s,r):s=str(s)[1:-1];return S('['+s+']'if type(r)==L else '"+"' if(s,r)==('','')else s+r)
class I(int):
 def __add__(s,r):return type(r)(int(s)+int(r))if s!=r else V('DONE')
 def __div__(s,r):return N if r==0 else int(s)/int(r)
 def __pos__(s):return s+c*10
 def __mul__(s,r):return V('NaN.'+'0'*13+'13')if r==1 else int(s)*int(r)
class L(list):
 def __add__(s,r):return V(str(r==s[-1]+1).upper())
def RANGE(a,b=0):return 2*(a,S(chr(ord(a)+1)))if b==0 else tuple([a]+[b-1,a+2]*((b-a)/4)+[b-1,b])
def FLOOR(n):return V('|\n|\n|\n|___%s___'%n)
def colorsrgb(c):
 m={'blue':V('#0000FF')}
 return m.get(c,N)
def colorssort():return V('rainbow')
N=V('NaN')
c=1
while True:
 try:l=raw_input('[%d] >'%c)
 except:break
 l=sub(r'(?<!"|\.)(\d+)(?!\.|\d)',r'I(\1)',l)
 l=sub(r'"(.*?)"',r'S("\1")',l)
 l=sub(r'\[(.*?)\]',r'L([\1])',l)
 l=sub(r'/\(','*(',l)
 l=sub('s\.','s',l)
 for x in str(eval(l)).split('\n'):print ' =',x
 c+=1

My goal wasn't as much winning (obviously) as it is making it as generic as possible. Very little is hardcoded. Try stuff like RANGE(10), 9*1, and RANGE("A"), (2/0)+14, and "123" for fun results!
Here's a sample session:
ryan@DevPC-LX:~/golf/xktp$ python xktp.py
[1] >ryan@DevPC-LX:~/golf/xktp$ python xktp.py
[1] >1+1
 = DONE
[2] >2+"2"
 = "4"
[3] >"2"+2
Traceback (most recent call last):
  File "xktp.py", line 31, in <module>
    for x in str(eval(l)).split('\n'):print ' =',x
  File "<string>", line 1, in <module>
  File "xktp.py", line 7, in __add__
    def __add__(s,r):s=str(s)[1:-1];return S('['+s+']'if type(r)==L else '"+"' if(s,r)==('','')else s+r)
TypeError: cannot concatenate 'str' and 'I' objects
ryan@DevPC-LX:~/golf/xktp$ python xktp.py
[1] >ryan@DevPC-LX:~/golf/xktp$
ryan@DevPC-LX:~/golf/xktp$
ryan@DevPC-LX:~/golf/xktp$
ryan@DevPC-LX:~/golf/xktp$ python xktp.py
[1] >2+"2"
 = "4"
[2] >"2"+[]
 = "[2]"
[3] >"2"+[1, 2, 3]
 = "[2]"
[4] >(2/0)
 = NaN
[5] >(2/0)+2
 = NaP
[6] >(2/0)+14
 = Na\
[7] >""+""
 = '"+"'
[8] >[1,2,3]+2
 = FALSE
[9] >[1,2,3]+4
 = TRUE
[10] >[1,2,3,4,5,6,7]+9
 = FALSE
[11] >[1,2,3,4,5,6,7]+8
 = TRUE
[12] >2/(2-(3/2+1/2))
 = NaN.000000000000013
[13] >9*1
 = NaN.000000000000013
[14] >RANGE(" ")
 = (" ", "!", " ", "!")
[15] >RANGE("2")
 = ("2", "3", "2", "3")
[16] >RANGE(2)
Traceback (most recent call last):
  File "xktp.py", line 31, in <module>
    for x in str(eval(l)).split('\n'):print ' =',x
  File "<string>", line 1, in <module>
  File "xktp.py", line 15, in RANGE
    def RANGE(a,b=0):return 2*(a,S(chr(ord(a)+1)))if b==0 else tuple([a]+[b-1,a+2]*((b-a)/4)+[b-1,b])
TypeError: ord() expected string of length 1, but I found
ryan@DevPC-LX:~/golf/xktp$ python xktp.py
[1] >ryan@DevPC-LX:~/golf/xktp$ # oops
ryan@DevPC-LX:~/golf/xktp$ python xktp.py
[1] >RANGE("2")
 = ("2", "3", "2", "3")
[2] >RANGE(2*1)
Traceback (most recent call last):
  File "xktp.py", line 31, in <module>
    for x in str(eval(l)).split('\n'):print ' =',x
  File "<string>", line 1, in <module>
  File "xktp.py", line 15, in RANGE
    def RANGE(a,b=0):return 2*(a,S(chr(ord(a)+1)))if b==0 else tuple([a]+[b-1,a+2]*((b-a)/4)+[b-1,b])
TypeError: ord() expected a character, but string of length 19 found
ryan@DevPC-LX:~/golf/xktp$ python xktp.py # oops again
[1] >RANGE(1,20)
 = (1, 19, 3, 19, 3, 19, 3, 19, 3, 19, 20)
[2] >RANGE(1,5)
 = (1, 4, 3, 4, 5)
[3] >RANGE(10,20)
 = (10, 19, 12, 19, 12, 19, 20)
[4] >RANGE(10,200)
 = (10, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 12, 199, 200)
[5] >+2
 = 52
[6] >+"99"
Traceback (most recent call last):
  File "xktp.py", line 31, in <module>
    for x in str(eval(l)).split('\n'):print ' =',x
  File "<string>", line 1, in <module>
TypeError: bad operand type for unary +: 'S'
ryan@DevPC-LX:~/golf/xktp$ python xktp.py # oops again and again!
[1] >FLOOR(200)
 = |
 = |
 = |
 = |___200___
[2] >2+2
 = DONE
[3] >3+#
Traceback (most recent call last):
  File "xktp.py", line 31, in <module>
    for x in str(eval(l)).split('\n'):print ' =',x
  File "<string>", line 1
    I(3)+#
         ^
SyntaxError: unexpected EOF while parsing
ryan@DevPC-LX:~/golf/xktp$ python xktp.py
[1] >3+3
 = DONE
[2] >ryan@DevPC-LX:~/golf/xktp$

C, 412 bytes
This is basically hardcoded, but all the other answers so far were missing something...
i;char b[99];main(){for(;;){printf("[%d]>",abs(++i));gets(b);i-=b[2]==50?26:0;printf("=>");puts(*b==82?b[6]==34?"('\"',\"!\",\" \",\"!\",'\"')":"(1,4,3,4,5)":*b==70?"|\n=>|\n=>|\n=>|___10.5___":*b==43?"12":*b==91?b[8]==50?"FALSE":"TRUE":*b==34?b[1]==34?"'\"+\"'":"\"[2]\"":*b==40?b[5]==43?"NaP":"NaN":*b==99?b[7]=='s'?"rainbow":b[12]==98?"#0000FF":"NaN":b[1]==43?b[2]==34?"\"4\"":"DONE":"NaN.000000000000013");}}

Output:
[1]>2+"2"
=>"4"
[2]>"2"+[]
=>"[2]"
[3]>(2/0)
=>NaN
[4]>(2/0)+2
=>NaP
[5]>""+""
=>'"+"'
[6]>[1,2,3]+2
=>FALSE
[7]>[1,2,3]+4
=>TRUE
[8]>2/(2-(3/2+1/2))
=>NaN.000000000000013
[9]>RANGE(" ")
=>('"',"!"," ","!",'"')
[10]>+2
=>12
[11]>2+2
=>DONE
[14]>RANGE(1,5)
=>(1,4,3,4,5)
[13]>FLOOR(10.5)
=>|
=>|
=>|
=>|___10.5___

Python 3, 298
Everything is hardcoded, but the input is turned into a number that is then converted to a string and looked up in a large string that contains all these numbers followed by their answers.
B="""53"#0000FF"~62DONE~43NaN.000000000000013~25(1,4,3,4,5)~26"rainbow"~49"4"~21"[2]"~29FALSE~15|*|*|*|___10.5___~17'"+"'~1212~60('"',"!"," ","!",'"')~24NaN~31TRUE~64NaN~76NaP"""
i=0
while 1:i+=1;s=input("[%s]>"%i);print("=>"+B[B.find(str(sum(map(ord,s))%81))+2:].split("~")[0].replace("*","\n=>"))

Python 3, 542 484 bytes
Since there was no mention of absolute hardcoding here's my solution.
a={'2+"2"':'"4"','"2"+[]':'"[2]"',"(2/0)":"NaN","(2/0)+2":"NaP",'""+""':"'\"+\"'","[1,2,3]+2":"FALSE","[1,2,3]+4":"TRUE","2/(2-(3/2+1/2))":"NaN.000000000000013",'RANGE(" ")':'(\'"\',"!"," ","!",\'"\')',"+2":"12","2+2":"DONE","RANGE(1,5)":"(1,4,3,4,5)","FLOOR(10.5)":"|\n|\n|\n|___10.5___",'colors.rgb("blue")':'"#0000FF"','colors.rgb("yellowish blue")':"NaN","colors.sort()":'"rainbow"'}
i=1
while 1:b=a[input("[%i]>"%i).replace("\t","")].split("\n");print("=> "+"\n=> ".join(b));i+=1

Hardcoding is fine, but I think the loopholes that are forbidden by default are forbidden by default. :P

@ThomasKwa I don't see anything here that is a forbidden loophole. Is there?

Everything looks compliant to me. I earlier assumed you were exploiting a loophole because you said there was "no mention of [...] standard loopholes".

I think it's creative, but not an answer. The question clearly talks about input and output: "create a program that accepts all the given input and displays the appropriate output"

You can save a good amount by using both quotes. "2+\"2\"" becomes '2+"2"'. Importing count could also be removed if you add a counter variable.

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


text:
ASCII Dragon's Curve
Introduction
The Dragon's Curve is a fractal curve that notably appears on section title pages of the Jurassic Park novel.
It can very simply be described as a process of folding a paper strip, as explained in the Wikipedia article about this curve.
The first few iterations of the generation of this curve look like this (credits to Wikipedia for the image):

The challenge
Write a program or function that, given an integer n as input, outputs the n-th iteration of the dragon curve as ASCII art using only the symbols _ and |

You have to output the figure using only |, _ and spaces. You may not output the curve as a plot or anything else.
You can take the input as a program argument, in STDIN or as a function parameter.
Inputs will always be an integer >= 0. Your program should work for reasonable values of inputs, 12 being the highest in the test cases offered.
The first iterations shall look like this

Iteration 0 is
_

Iteration 1 is
_|

Iteration 2 is
|_
 _|

One trailing line at the end is ok. No trailing spaces allowed besides filling the line up to the rightmost character in the curve
No standard loopholes abuse as usual

Test Cases

Input 0

Output
_

Input 3

Output
   _
|_| |_
     _|

Input 5

Output
     _   _
    |_|_| |_
 _   _|    _|
|_|_|_
  |_|_|
    |_
     _|
  |_|

Input 10

Output
           _       _
         _|_|    _|_|
        |_|_   _|_|_   _
         _|_|_| |_| |_|_|
   _    |_|_|_        |_
 _|_|    _| |_|        _|
|_|_   _|_          |_|
 _|_|_|_|_|_
|_| |_|_|_|_|_
     _|_|_| |_|
    |_| |_
         _|_   _   _           _   _           _   _
   _    |_|_|_|_|_|_|_        |_|_|_|_        |_|_|_|_
 _|_|    _|_|_|_|_| |_|    _   _|_| |_|    _   _|_| |_|
|_|_   _|_|_|_|_|_        |_|_|_|_        |_|_|_|_
 _|_|_|_|_|_|_|_|_|_   _   _|_|_|_|_   _   _|_|_|_|_   _   _
|_| |_|_|_| |_|_|_| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
     _|_|    _|_|    _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|
    |_|     |_|     |_| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
                         _|_|_|_|_|_|_|_|_|_|_| |_| |_|_|_|_
                   _    |_|_|_|_|_|_|_|_|_|_|_        |_|_|_|_
                 _|_|    _|_|_|_|_|_|_|_|_| |_|    _   _|_| |_|
                |_|_   _|_|_|_|_|_|_|_|_|_        |_|_|_|_
                 _|_|_|_|_|_|_|_|_|_|_|_|_|_        |_| |_|
                |_| |_|_|_| |_|_|_| |_|_|_|_|_
                     _|_|    _|_|    _|_|_| |_|
                    |_|     |_|     |_| |_
                                         _|_   _   _
                                   _    |_|_|_|_|_|_|_
                                 _|_|    _|_|_|_|_| |_|
                                |_|_   _|_|_|_|_|_
                                 _|_|_|_|_|_|_|_|_|_   _   _
                                |_| |_|_|_|_|_|_|_|_|_|_|_|_|_
                                     _|_|_|_|_|_|_|_|_|_|_| |_|
                                    |_| |_|_|_|_|_|_|_|_|_
               _   _                     _|_|_| |_| |_|_|_|_
              |_|_| |_             _    |_|_|_        |_|_|_|_
           _   _|    _|          _|_|    _| |_|    _   _|_| |_|
          |_|_|_                |_|_   _|_        |_|_|_|_
            |_|_|                _|_|_|_|_|_        |_| |_|
              |_   _       _    |_|_|_|_|_|_|_
           _   _|_|_|    _|_|    _|_|_|_|_| |_|
          |_|_|_|_|_   _|_|_   _|_|_|_|_|_
            |_| |_| |_|_|_|_|_| |_| |_|_|_|_
                      |_|_|_|_        |_|_|_|_
                   _   _|_| |_|    _   _|_| |_|
                  |_|_|_|_        |_|_|_|_
                    |_| |_|         |_| |_|

Input 12

Output
                                                               _   _           _   _                                           _   _           _   _
                                                              |_|_|_|_        |_|_|_|_                                        |_|_|_|_        |_|_|_|_
                                                           _   _|_| |_|    _   _|_| |_|                                    _   _|_| |_|    _   _|_| |_|
                                                          |_|_|_|_        |_|_|_|_                                        |_|_|_|_        |_|_|_|_
                                                            |_|_|_|_   _   _|_|_|_|_   _   _                                |_|_|_|_   _   _|_|_|_|_   _   _
                                                              |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_                                |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
                                                           _   _|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|                            _   _|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|
                                                          |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_                                |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
                                               _   _        |_|_|_|_|_|_|_|_|_| |_| |_|_|_|_                   _   _        |_|_|_|_|_|_|_|_|_| |_| |_|_|_|_
                                              |_|_|_|_        |_|_|_|_|_|_|_|_        |_|_|_|_                |_|_|_|_        |_|_|_|_|_|_|_|_        |_|_|_|_
                                           _   _|_| |_|    _   _|_|_|_|_|_| |_|    _   _|_| |_|            _   _|_| |_|    _   _|_|_|_|_|_| |_|    _   _|_| |_|
                                          |_|_|_|_        |_|_|_|_|_|_|_|_        |_|_|_|_                |_|_|_|_        |_|_|_|_|_|_|_|_        |_|_|_|_
                                            |_|_|_|_   _   _|_|_|_|_|_|_|_|_        |_| |_|                 |_|_|_|_   _   _|_|_|_|_|_|_|_|_        |_| |_|
                                              |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_                                |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
                                           _   _|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|                            _   _|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|
                                          |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_                                |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
                                            |_| |_| |_|_|_|_|_|_|_|_|_|_|_|_   _   _           _   _        |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_   _   _           _   _           _   _
                                                      |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_        |_|_|_|_        |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_        |_|_|_|_        |_|_|_|_
                                                   _   _|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|    _   _|_| |_|    _   _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|    _   _|_| |_|    _   _|_| |_|
                                                  |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_        |_|_|_|_        |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_        |_|_|_|_        |_|_|_|_
                                                    |_| |_| |_|_|_|_|_|_|_|_|_|_|_|_   _   _|_|_|_|_   _   _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_   _   _|_|_|_|_   _   _|_|_|_|_   _   _
                                                              |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|_|_| |_|_|_|_|_|_|_|_|_|_|_| |_|_|_| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
                                                           _   _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|    _|_|    _|_|_|_|_|_|_|_|_|_|    _|_|    _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|
                                                          |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_    |_|     |_| |_|_|_|_|_|_|_|_    |_|     |_| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_
                                               _   _        |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|                _|_|_|_|_|_|_|_|                _|_|_|_|_|_|_|_|_|_|_| |_| |_|_|_|_
                                              |_|_|_|_        |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|_           _    |_|_|_|_|_| |_|_           _    |_|_|_|_|_|_|_|_|_|_|_        |_|_|_|_
                                           _   _|_| |_|    _   _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|    _|_|        _|_|    _|_|_|_|    _|_|        _|_|    _|_|_|_|_|_|_|_|_| |_|    _   _|_| |_|
                                          |_|_|_|_        |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_    |_|         |_|_   _|_|_|_|_    |_|         |_|_   _|_|_|_|_|_|_|_|_|_        |_|_|_|_
                                            |_|_|_|_   _   _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|                _|_|_|_|_|_|_|_|                _|_|_|_|_|_|_|_|_|_|_|_|_|_        |_| |_|
                                              |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_   _            |_| |_|_|_| |_|_                |_| |_|_|_| |_|_|_| |_|_|_|_|_
                                           _   _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|                _|_|    _|_|                    _|_|    _|_|    _|_|_| |_|
                                          |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_   _            |_|     |_|                     |_|     |_|     |_| |_
                                            |_| |_| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|                                                                _|_   _   _
                                                      |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| |_|_                                                           _    |_|_|_|_|_|_|_
                                                   _   _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|    _|_|                                                        _|_|    _|_|_|_|_| |_|
                                                  |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_    |_|                                                         |_|_   _|_|_|_|_|_
                                                    |_| |_| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|                                                                _|_|_|_|_|_|_|_|_|_   _   _
           _       _                                          |_|_|_|_|_|_| |_|_|_| |_|_|_|_|_|_   _                                                            |_| |_|_|_|_|_|_|_|_|_|_|_|_|_
         _|_|    _|_|                                      _   _|_|_|_|_|    _|_|    _|_|_|_|_|_|_|_|                                                                _|_|_|_|_|_|_|_|_|_|_| |_|
        |_|_   _|_|_   _                                  |_|_|_|_|_|_|_    |_|     |_| |_|_|_|_|_|_   _                                                            |_| |_|_|_|_|_|_|_|_|_
         _|_|_| |_| |_|_|                      _   _        |_|_|_|_|_|_|                _|_|_|_|_|_|_|_|                                      _   _                     _|_|_| |_| |_|_|_|_
   _    |_|_|_        |_                      |_|_|_|_        |_|_| |_|_           _    |_|_|_|_|_| |_|_                                      |_|_| |_             _    |_|_|_        |_|_|_|_
 _|_|    _| |_|        _|                  _   _|_| |_|    _   _|    _|_|        _|_|    _|_|_|_|    _|_|                                  _   _|    _|          _|_|    _| |_|    _   _|_| |_|
|_|_   _|_          |_|                   |_|_|_|_        |_|_|_    |_|         |_|_   _|_|_|_|_    |_|                                   |_|_|_                |_|_   _|_        |_|_|_|_
 _|_|_|_|_|_                                |_|_|_|_   _   _|_|_|                _|_|_|_|_|_|_|_|                                           |_|_|                _|_|_|_|_|_        |_| |_|
|_| |_|_|_|_|_                                |_|_|_|_|_|_|_|_|_   _            |_| |_|_|_| |_|_                                              |_   _       _    |_|_|_|_|_|_|_
     _|_|_| |_|                            _   _|_|_|_|_|_|_|_|_|_|_|                _|_|    _|_|                                          _   _|_|_|    _|_|    _|_|_|_|_| |_|
    |_| |_                                |_|_|_|_|_|_|_|_|_|_|_|_|_   _            |_|     |_|                                           |_|_|_|_|_   _|_|_   _|_|_|_|_|_
         _|_   _   _           _   _        |_|_|_|_|_|_|_|_|_|_|_|_|_|_|                                                                   |_| |_| |_|_|_|_|_| |_| |_|_|_|_
   _    |_|_|_|_|_|_|_        |_|_|_|_        |_|_|_|_|_|_|_|_|_|_| |_|_                                                                              |_|_|_|_        |_|_|_|_
 _|_|    _|_|_|_|_| |_|    _   _|_| |_|    _   _|_|_|_|_|_|_|_|_|    _|_|                                                                          _   _|_| |_|    _   _|_| |_|
|_|_   _|_|_|_|_|_        |_|_|_|_        |_|_|_|_|_|_|_|_|_|_|_    |_|                                                                           |_|_|_|_        |_|_|_|_
 _|_|_|_|_|_|_|_|_|_   _   _|_|_|_|_   _   _|_|_|_|_|_|_|_|_|_|_|                                                                                |_| |_|         |_| |_|
|_| |_|_|_| |_|_|_| |_|_|_|_|_|_|_|_|_|_|_| |_|_|_| |_|_|_|_|_|_   _
     _|_|    _|_|    _|_|_|_|_|_|_|_|_|_|    _|_|    _|_|_|_|_|_|_|_|
    |_|     |_|     |_| |_|_|_|_|_|_|_|_    |_|     |_| |_|_|_|_|_|_   _
                         _|_|_|_|_|_|_|_|                _|_|_|_|_|_|_|_|
                   _    |_|_|_|_|_| |_|_           _    |_|_|_|_|_| |_|_
                 _|_|    _|_|_|_|    _|_|        _|_|    _|_|_|_|    _|_|
                |_|_   _|_|_|_|_    |_|         |_|_   _|_|_|_|_    |_|
                 _|_|_|_|_|_|_|_|                _|_|_|_|_|_|_|_|
                |_| |_|_|_| |_|_                |_| |_|_|_| |_|_
                     _|_|    _|_|                    _|_|    _|_|
                    |_|     |_|                     |_|     |_|

Scoring
This is code-golf, so the shortest program in bytes wins.

I'm sure someone will complain about the vagueness of a 'huge amount of spaces', so how about an asymptotic bound?

@feersum Well I disallowed trailing spaces altogether, so nobody will complain now!

I'm complaining... now you're being a whitespace Nazi!

@feersum and you are a horizontal ellipsis Nazi!

This is the best fractal question ever, I hope I have time to participate! Is it ok to rotate the curve through 90,180,270 degrees or does it have to be displayed per the examples?

@steveverrill I based the expected orientation off of the Wikipedia gif. I wouldn't mind seeing rotated curves but that would make fair scoring difficult, so sorry but it has to be outputted exactly like the examples

Does it need to be ASCII? I made an [SVG] answer only to find that it says it needs to be ASCII :/

@vihan1086 Yes it needs to be ASCII. The whole idea for this challenge, is that this fractal is printable with only 2 ASCII characters

Ruby, 239 201 bytes
This is a lambda function which should be called in the same manner as the one in the ungolfed version.
Golfing improvements include: assignment of 8<<n/2 to a variable for re-use; upto loop instead of each loop; ternary operator instead of if..else..end; use of [y,y+=d].max to calculate where to print the |; use of ?_ and ?| instead of the equivalent '|'and '_'; and elimination of redundant %4 (thanks Sp3000.)
->n{a=Array.new(m=8<<n/2){" "*m}
p=q=1+x=y=m/2
r=3
1.upto(1<<n){|i|d=(r&2)-1
r%2>0?(a[y][x+=d]=?_
x+=d):(a[[y,y+=d].max][x]=?|
p=x<p ?x:p
q=x>q ?x:q)
r+=i/(i&-i)}
a.delete(a[0])
puts a.map{|e|e[p..q]}}

It relies on the following formula from Wikipedia:

First, express n in the form k*(2^m) where k is an odd number. The direction of the nth turn is determined by k mod 4 i.e. the remainder left when k is divided by 4. If k mod 4 is 1 then the nth turn is R; if k mod 4 is 3 then the nth turn is L.

Wikipedia gives the following code:

There is a simple one line non-recursive method of implementing the above k mod 4 method of finding the turn direction in code. Treating turn n as a binary number, calculate the following boolean value:
bool turn = (((n & −n) << 1) & n) != 0

I improved this to i/(i&-i)%4 which uses the same technique of using the expression i&-i to find the least significant digit but my expression gives 1 (for left turn)or 3 (for right turn) directly, which is handy as I track direction as a number 0..3 (in order north, west, south, east for golfing reasons.)
Ungolfed original in test program
f=->n{
  a=Array.new(8<<n/2){" "*(8<<n/2)}  #Make an array of strings of spaces of appropriate size
  p=q=1+x=y=4<<n/2                   #set x&y to the middle of the array, p&q to the place where the underscore for n=0 will be printed.
  r=3                                #direction pointer, headed East
  (1..1<<n).each{|i|                 #all elements, starting at 1
    d=(r&2)-1                          #d is +1 for East and South, -1 for West and North
    if r%2>0                           #if horizontal
      a[y][x+=d]='_'                     #move cursor 1 position in direction d, print underscore,
      x+=d                               #and move again.
    else                               #else vertical
      a[(y+([d,0].max))][x]='|'          #draw | on the same line if d negative, line below if d positive
      y+=d                               #move cursor
      p=x<p ?x:p                         #update minimum and maximum x values for whitespace truncation later
      q=x>q ?x:q                         #(must be done for vertical bars, to avoid unnecesary space in n=0 case)
    end
    r=(r+i/(i&-i))%4                   #update direction
  }
  a.delete(a[0])                     #first line of a is blank. delete all blank lines.
  puts a.map!{|e|e[p..q]}                 #use p and q to truncate all strings to avoid unnecessary whitespace to left and right.
}

f.call(0)
f.call(2)
f.call(3)
f.call(11)

@Fatalize both functions are (currently) identical (except for the comments and whitespace.) I've added printing to stdout instead of returning a value (+5 bytes) and deleted the f= at the beginning as this is not normally counted for an anonymous function definition (-2 bytes.) More golfing tomorrow. Note that you will still have to execute the golfed function, by assigning it to a variable f=->n{.....} and calling it using f.call(n) as in the test program example.

@Fatalize  BTW I think the fractal looks absolutely awesome in my console. Thanks for the challenge.

@Sp3000 indeed %4 is not necessary, as r is only used in the expressions r%2 and r&2. Thanks for the tip. I'm now down to 202.

Python 2, 270 222 bytes
y=X=Y=0
i=m=x=1
D={}
k=2**input()
while~k+i:j=Y+(y>0);s={2*X+x};D[j]=D.get(j,s)|s;m=min(m,*s);Y+=y;X+=x;exec i/(i&-i)*"x,y=y,-x;";i+=1
for r in sorted(D):print"".join(" | _"[(n in D[r])+n%2*2]for n in range(m,max(D[r])+1))

Now using the formula for the nth turn. I saw the (((n & −n) << 1) & n) formula on Wikipedia, but didn't realise how useful it was until I saw it in @steveverrill's answer. I actually drop the %4 as well, so there's a lot of rotating going on, making larger inputs take a while.

Side remark: This isn't graphical output, but here's some golfed turtle code:
from turtle import*
for i in range(1,2**input()+1):fd(5);lt(i/(i&-i)*90)

As long as it doesn't take an hour to run, it's fine by me

If I understand correctly, your second code could be changed very slightly to become an answer to this challenge.

C#, 337 bytes
There's a bit of rules abuse here.  There's no restriction on leading space.  Unfortunately, the canvas is finite, so there is an upper limit for n.
Indented for clarity:
using C=System.Console;
class P{
    static void Main(string[]a){
        int n=int.Parse(a[0]),d=2,x=250,y=500;
        var f="0D";
        while(n-->0)
            f=f.Replace("D","d3t03").Replace("T","10d1t").ToUpper();
        C.SetBufferSize(999,999);
        foreach(var c in f){
            n=c&7;
            d=(d+n)%4;
            if(n<1){
                var b=d%2<1;
                x+=n=b?1-d:0;
                y+=b?0:2-d;
                C.SetCursorPosition(x*2-n,y+d/3);
                C.Write(b?'_':'|');
            }
        }
    }
}

APL (Dyalog Unicode), 65 64 bytesSBCS
('_|'⍴⍨≢a)@a⍴∘''⊃1+⌈/a←(⊢-⌊/)⌈2+/÷∘¯2 1¨11 9∘○¨+\0,(⊢,0j1×⌽)⍣⎕,1

Try it online!
(⊢,0j1×⌽)⍣⎕,1 generates a list of steps as complex numbers. It starts from 1 and repeatedly appends (,) a reversed (⌽) copy of the list multiplied by 0j1=sqrt(-1).
+\0, prepend 0 and compute prefix sums
11 9∘○¨ decompose complex into (real;imaginary) pairs
÷∘¯2 1¨ divide the real parts by -2
2+/ sums of adjacent pairs
⌈ ceiling
(⊢-⌊/) subtract the minima from all, so that coords are non-negative
a← assign to a
⍴∘''⊃1+⌈/ create an empty char matrix such that the max coords can fit
('_|'⍴⍨≢a)@a put alternating _ and | at the coordinates from a

JavaScript (ES6), 220
Using the wikipedia formula for left and right turns.
n=>(d=>{for(i=x=y=d;i<1<<n;d+=++i/(i&-i))z=d&2,(w=d&1)?y+=z/2:x+=1-z,g=x<0?g.map(r=>[,,...r],x=1):g,g=y<0?[y=0,...g]:g,r=g[y]=g[y]||[],r[x]='_|'[w],w?y-=!z:x+=1-z})(0,g=[])||g.map(r=>[...r].map(c=>c||' ').join``).join`
`

Less golfed
n=>{
  g=[];
  for(i=x=y=d=0;i<1<<n;d+=++i/(i&-i))
    z=d&2,
    (w=d&1)?y+=z/2:x+=1-z,
    g=x<0?g.map(r=>[,,...r],x=1):g,
    g=y<0?[y=0,...g]:g,
    r=g[y]=g[y]||[],
    r[x]='_|'[w],
    w?y-=!z:x+=1-z
  return g.map(r=>[...r].map(c=>c||' ').join``).join`\n`
}

F=
n=>(d=>{for(i=x=y=d;i<1<<n;d+=++i/(i&-i))z=d&2,(w=d&1)?y+=z/2:x+=1-z,g=x<0?g.map(r=>[,,...r],x=1):g,g=y<0?[y=0,...g]:g,r=g[y]=g[y]||[],r[x]='_|'[w],w?y-=!z:x+=1-z})(0,g=[])||g.map(r=>[...r].map(c=>c||' ').join``).join`
`

function update() {
  var n=+I.value
  O.textContent=F(n)
}

update()
pre { font-size: 8px }
<input id=I value=5 type=number oninput='update()'><pre id=O></pre>


text:
Hexadecimal Counter

Hexadecimal is a base 16 counting system that goes from 0 to f. Your job is to make a counter that will display these numbers.
Example:
$ python counter.py
1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30

Rules:

The numbers may be separated by spaces, tabs, or new lines.
The minimum number you must go to is 30 (48 in decimal).

You may also make the program print numbers forever until it is stopped.

Letters may be in uppercase or lowercase (A or a).
No built in functions allowed (that directly affect hexadecimal conversions/counting).
Leading zeros are allowed
It may start from 1 or 0
Shortest code wins!

@Sp3000 How built in are they? Converting decimal to hex?

@Sp3000 No built in functions allowed!

@manatwork uppercase is fine

How about general base conversion functions then?

@Sp3000 Sure (ignore this, 15 character limit)

If the program prints things repeatedly, but breaks at some point beyond 30, (say, at FF) is that okay?

@BrainSteel Yes, as long as it gets to 30

A couple of questions I'd rather have answered now than later: 1. Can the count start from zero? 2. Are leading zeroes allowed?

@Dennis Yes and yes!

Is it OK if my solution prints an exta newline between 0F and 10, and 1F and 20, ...?

@Mauris yes . . .

Cool! What about tab-separated output?

@Mauris Yes! That sure is going to be interesting...

Can I use a format string that converts parameters to hex inside a string? It's not a function.

@mbomb007 Do you mean Regex? There's Retina for that.

No, a Python format string containing %x.

So if a language has a built-in that only converts to hex it isn't allowed, but a general one such as 5.base(16) is allowed?

@BradGilbertb2gills That isn't allowed either.

I was looking at the previous comments and it looked like you agreed to general base conversion functions when Sp3000 asked. Also does that include printf type functions?

Pyth - 12 bytes
Uses cartesian product, and sorts at the end to get in correct order, then joins by spaces. Prints 00-ff inclusive.
jdS^s+<G6UT2

Try it online here.
jd             Join by spaces
 S             Sort lexiographically
  ^    2       Cartesian product repeat twice
   s+          Append then concatenate entire list
    <G6        First six of alphabet
    UT         Range 0-9

Pure Bash, 26
Counts from 0x0 to 0x3F:
echo {0..3}{{0..9},{A..F}}

Try it online!

CJam, 21 14 bytes
A,_6,'Af++m*S*

Prints the numbers 00 to 9F.
Try it online in the CJam interpreter.
How it works
A,             e# Push [0 ... 9].
  _            e# Push a copy.
   6,          e# Push [0 ... 5].
     'Af+      e# Add 'A' to each. This pushes "ABCDEF".
         +     e# Concatenate. This pushes [0 ... 9 'A' ... 'F'].
          m*   e# Cartesian product. This pushes [[0 0] ... [9 'F'].
            S* e# Join, separating by spaces.

Python 2, 52
a=0
for b in'0123456789ABCDEF'*4:print`a`+b;a+=b>'E'

Prints 00 to 3F. Takes advantage of the fact that the first digit a is always a number in this range. Loops through four cycles of the second digit b, incrementing a whenever the second digit is F.
This is one char shorter than the more direct
for a in'0123':
 for b in'0123456789ABCDEF':print a+b

n ='0123' should save some chars

@Caridorc How exactly?

by writing thing in n + restofstring

@Caricord Not sure what you mean, it's longer to do n='0123' for a in n:  for b in n+'456789ABCDEF':print a+b

sorry I had to do some more precise counting :)

@Caridorc A metal shortcut I use is that saving to a variable costs 4 chars, so it needs >4 chars of saving to compensate, so saving 4 chars for 0123 for something else isn't enough.

JavaScript (ES6), 57 bytes
Same approach as the Python ones I suppose.
for(i of c='0123456789ABCDEF')for(j of c)console.log(i+j)

TI-Basic, 63 bytes
:For(I,0,4,16⁻¹
:Disp sub(" 0123456789ABCDEF",1+16fPart(I),2
:Output(7,1,int(I
:End

This is 63 bytes, according to the memory management screen on my calculator, a TI-84+. Make sure to start the program with a partially filled home screen!

Did you remember to subtract the length of the 9-byte header and the program name from the code length?

Befunge-93, 57 bytes
<_v#-*44:+1,*84,g2:\,g2:\
^ >$1+:9-!#@_0
0123456789ABCDEF

Prints numbers from 00to 8F. If you prefer your programs to run forever, the version below is non-terminating and will continually output all numbers from 00 to FF.
<_v#-*44:+1,*84,g2:\,g2:\
^ >$1+:35*`!*0
0123456789ABCDEF

You can save a couple bytes in -98 with <_v#-f:+1, ',g2:,g2:. Can't see many improvements beyond that.

0123456789ABCDEF01g::88+/2-0g,88+%0g,9,1+01p

That's 44 bytes. It loops forever, like your second solution, and prints wrong results past the second 1F. It requires an implementation (such as the reference implementation bef.c) that silently ignores unknown commands (ABCDEF).

(The OP mentions it's okay for a solution to "break" somewhere past hitting 30 -- this one will slowly overflow the stack, so I suppose there's some point of termination. Also, output is tab-separated; the OP said this was fine.) Oh, the Befunge implementation you use should also initialize the whole 80x25 torus with spaces (ASCII 0x20).

@Mauris Regarding your comment about the implementation needing to instantiate the entire torus with spaces, would this affect the byte count for my code presented? I only counted the necessary characters rather than filling in the corners with spaces.

@Jacob In -98 doesn't the f command push 15? If so, the loop would break on 14, i.e. once it has printed E, though I suppose that could be fixed by changing the minus for a backtick...

@Sok Well, I was talking about my solution; I don't know if yours relies on that. The reference implementation does this, so it should be pretty standard behavior. I don't think you should count the corners you didn't fill in!

@Sok you're right. I was thinking it pushed 16 for some reason...

CJam, 22 bytes
1{_GbA,6,'af++f=oNo)}h

This runs forever, and thus is probably one of the rare times where it's a good idea not to include a permalink.

oNo is the same as n in TIO.

C, 78 75 bytes
x(y){return y+48+y/10*7;}f(j){for(j=0;printf("%c%c ",x(j/16),x(15&j++)););}

We define a function f() to be called with no arguments for printing, and a helper function x(int). This breaks at FF.
Amazingly, this is one byte shorter than the more obvious:
char*s="0123456789ABCDEF";h(j){for(j=0;printf("%c%c ",s[j/16],s[15&j++]););}

Warning: it is not recommended to run this code outside of a debug environment...
Testing:
int main(int argc, char** argv) {
    f();
    return 0;
}

Output:
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 (...)

Of course, the more robust (and cheat-y) approach is this 34-byte function:
g(i){for(i=0;printf("%x ",i++););}

Started trying this but my answer was too similar.  You can save several bytes by making the first %c into %d and omitting the function.  It's only valid up to 9F then though.

return y+ could possibly be y+=.

Pyth, 17 bytes
VJs++kUT<G6FYJ+NY

Try it here
How it works:
         <G6         # "abcdef"
       UT            # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
      k              # an empty string (so + means concatenation, not addition)
   s++               # join them all ("0123456789abcdef")
  J                  # call this J
 V                   # for each N in J...
            FYJ      # for each Y in J...
               +NY   # print N and Y

jb^+jkUT<G6 2 uses the cartesian product to do the same thing, still seems golfable...

Javascript ES6, 67 62 bytes
(x=''.replace.bind('0123456789ABCDEF',/./g))(n=>x(o=>' '+n+o))

J, 22 bytes
>{;~'0123456789abcdef'

Counts to ff. Prints an extra newline between each block of 0x10 numbers, like so:
...
0d
0e
0f

10
11
...

Mumps - 65 bytes
S Q="0123456789ABCDEF" F I=1:1:16 F J=1:1:16 W $E(Q,I),$E(Q,J),!

Nope... Mumps ain't dead yet! :-)

TheC64Mini and Commodore BASIC (C64/128, PET, VIC-20, C16/+4) - 164 BASIC and Tokenized bytes used
 0 fOd=.to255:n=d:fOi=1to.stE-1:h%(i)=n/(16^i):n=n-(h%(i)*(16^i)):nEi:h$=""
 1 fOi=1to.stE-1:ifh%(i)<10tHh$=h$+cH(48+h%(i))
 2 ifh%(i)>9tHh$=h$+cH(55+h%(i))
 3 nEi:?h$"  ";:nEd

Prints a double-space after the hex number to nicely align the printing at 40/80 columns as well as the 22 columns on the VIC-20.

Malbolge, 900 bytes
To be improved...
D'``@"\7}|X9E1gwuR21=p(:9%IZYEg}eA/ya>O_)([Zvotm3qponmfN+Lbg`ed]\"CB^W\Uy<;WVONSLp3ONMLEDhH*)?>b%A@?87[;:9876/S3,P0/.-&J$)"'~D|{"y?}|utyr8potmrqpi/mfN+Lbg`e^$bDZ_^]VzZSXQVUTSLp3ONMLEDhH*)EDCB;@?8\6|:32V6v.32+O)o'&J*)i'&%|Bcb~w|u;yxwvutVrkj0nmfN+iKg`_%cE[`Y}@V[ZYXWPtT6LKJImM/KJIBAe(D=<A:98\[;{32V6v.-,P0).',%I)"!E%|#"y?w_{ts9Zvutsrkpi/mfNjihg`e^$b[Z~X]\[ZYRv98TSLKoO10FKDh+GFE>CB;_?>=}|49870/.R2+*Non&%I#"!&%${A!~}_u;yxqpo5mrqpoh.lkdibgf_%]\[!_XW{[ZYXQPt7SRQPOHGkKJIHAF?cC<;@?8\6;492V6v.-,P*p.'K+$j"'~D|#"y~wv<]yxqvutsrk1onmfN+cba`&d]#DZ_^]VzTSXQVOs65QJINGkE-IBAe(D=<A:98\654981Uv.32+*)M-,%k#(!E}$#"!x>v{t:xwputm3kpoh.fN+Lbg`ed]\"!Y^]VzZYXQVOsS54JImMFKJIHAe?>C<`@?87[;{32V05.-2+O)o-,+$H('&}Cdzy~wv<]sxqvonm3k1oQmf,jihgfeG]#a`_X|V[TxXQPUTMLp3ONMLEDhH*)ED=a;@?>76;4X816/43,P*).',%I#i!&}|Bcb~w|u;yxwputm3qSong-kjihgfH%]\a`_XW{UTYXQuUTMRKPOHlFKDhBAe?>=B;_9>=6Z:981Uv.32+*)M-,%k#(!E%$#c!x>|u;yxZpo5srqSi/z

Try it online!

brainfuck, 2902 bytes
Easy to outgolf, but worth giving a shot
+>+[<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<<[-]++++++++++++++++++++++++++++++++++++++++++++++++>[-]<[>+<<+>-]<[>+<-]<]>+<<+<<[>>->+<<<-]>>>[<<<+>>>-]<[->+<<[>>>-<<+<-]>[<+>-]>>[<->[-]]<[<<<+>>>-]<]>>[-]<<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>.>.>>>++++++++++++++++++++++++++++++++.[-]<<[-]<<[>>+<<<+>-]<[>+<-]>>>>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<[<<<<+>>>>-]+>>[<<<<<<-<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[>>>>-<<<<[-]]>>>>>>[-]++<<[<<<<<+>+>>>>-]<<<<<[>>>>>+<<<<<-]>[<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[-]]>>>>>>[-]<<<<<<]<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>[-]<[>+<<<+>>-]<<[>>+<<-]>>>>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<[<<<<+>>>>-]+>>[<<<<<<-<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[>>>>-<<<<[-]]>>>>>>[-]+++<<[<<<<<+>+>>>>-]<<<<<[>>>>>+<<<<<-]>[<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[-]]>>>>>>[-]<<<<<<]<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>[-]<<[>>+<<<+>-]<[>+<-]>>>[<<<<+>>>>-]+>[<<<<<-<+>>>>>>-]<<<<<<[>>>>>>+<<<<<<-]>[>>>>-<<<<[-]]>>>>>>+++++<<[<<<<<+>+>>>>-]<<<<<[>>>>>+<<<<<-]>[<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[-]]>>>>>>[-]<<<<<<]>++++++<<+<<[>>->+<<<-]>>>[<<<+>>>-]<[->+<<[>>>-<<+<-]>[<+>-]>>[<->[-]]<[<<<+>>>-]<]>>[-]<<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>[-]<[>+<<<+>>-]<<[>>+<<-]>>>[<<<<+>>>>-]+>[<<<<<-<+>>>>>>-]<<<<<<[>>>>>>+<<<<<<-]>[>>>>-<<<<[-]]>>>>>>++++<<[<<<<<+>+>>>>-]<<<<<[>>>>>+<<<<<-]>[<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[-]]>>>>>>[-]<<<<<<]<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>+>>>+<<<<<<<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>>>[-]<<<<<<]>++<<+<<[>>->+<<<-]>>>[<<<+>>>-]<[->+<<[>>>-<<+<-]>[<+>-]>>[<->[-]]<[<<<+>>>-]<]>>[-]<<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>>-----<<<[-]>>>[<<<+<+>>>>-]<<<<[>>>>+<<<<-]>>>>+++++>+<<<<<<<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>>>[-]<<<<<<]>+++<<+<<[>>->+<<<-]>>>[<<<+>>>-]<[->+<<[>>>-<<+<-]>[<+>-]>>[<->[-]]<[<<<+>>>-]<]>>[-]<<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>>-----<<[-]>>[<<+<<+>>>>-]<<<<[>>>>+<<<<-]>>>>+++++>+<<<<<<<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>>>[-]<<<<<<]>++++<<+<<[>>->+<<<-]>>>[<<<+>>>-]<[->+<<[>>>-<<+<-]>[<+>-]>>[<->[-]]<[<<<+>>>-]<]>>[-]<<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>+>[-]++++++++++++++++++++++++++++++++++++++++++++++++>>>+<<<<<<<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>>>>>>[-]<<<<<<]>+++++<<+<<[>>->+<<<-]>>>[<<<+>>>-]<[->+<<[>>>-<<+<-]>[<+>-]>>[<->[-]]<[<<<+>>>-]<]>>[-]<<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>[-]<[>+<<<+>>-]<<[>>+<<-]>>>[<<<<+>>>>-]+>[<<<<<-<+>>>>>>-]<<<<<<[>>>>>>+<<<<<<-]>[>>>>-<<<<[-]]>>>>>>++++++<<<<<<+>>>>[<<<<[-]<+>>>>>-]<<<<<[>>>>>+<<<<<-]>[<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[-]]>>>>>>[-]<<<<<<]<<<[>>+>+<<<-]>>[<<+>>-]>[[-]<<<[-]>[-]>>]<<]

Try it online!

This would be shorter if you just generated the characters 0-F and then hardcoded the printing. How did you manage to make it so long?

@JoKing possibly, but I just wanted to have fun

PowerShell 6, 40 bytes
($l=0..9+'A'..'F')|%{$1=$_;$l|%{"$1$_"}}

Try it online!
Starts at 00 and counts up to FF.

MUMPS, 57 bytes
f i=1:1:48 w $tr(i\16,0),$e("0123456789abcdef",i#16+1),!

Output
>d ^xmsdgolf
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
10
11
..
28
29
2a
2b
2c
2d
2e
2f
30

Explanation
f i=1:1:48                     ; loop from 1 to 48
w $tr(i\16,0)                  ; print i div 16, and ditch any zeros
$e("0123456789abcdef",i#16+1)  ; extract the nth character from the string, where n is i mod 16 + 1
!                              ; crlf

Python 2, 66 55 Bytes
This should really have been the most obvious approach to me..
a='0123456789ABCDEF'
for x in a:
 for y in a:print x+y

Old (66 Bytes): Technically this causes an error after FF, but it does reach 30.
n=1;a='0123456789ABCDEF'
while 1:print a[n/16]*(n>15)+a[n%16];n+=1

I assumed string formatting wasn't allowed since I'm pretty sure it would go through base conversion, but if it was allowed, this would be 29 bytes:
n=1
while 1:print"%x"%n;n+=1

Java, 104 bytes
char t[]="0123456789abcdef".toCharArray(),i;void f(){for(;i<99;)System.out.println(""+t[i/16]+t[i++%16]);}

If the i<99 is removed, it still reaches 30, but eventually crashes. I'm not sure if that's acceptable.

J, 47 bytes
'0123456789abcdef'{~([:|:2 256$(]#i.),256$i.)16

prints 00 to ff

A much shorter way: >{;~'0123456789abcdef'

Wow, that's very good! But why didn't you post it as an answer, it's only 22 bytes!

JavaScript 74 72 65 60

//for(i=0,a="0123456789ABCDEF";i++<49;)console.log(a[i>>4]+a[i%16])
for(i=0;i++<48;)console.log((i>>4)+"0123456789ABCDEF"[i%16])

jq 1.5: 65 59 characters
(56 characters code + 3 characters command line option.)
[range(10)]+"a b c d e f"/" "|{a:.[],b:.}|"\(.a)\(.b[])"

Sample run:
bash-4.3$ jq -n -r '[range(10)]+"a b c d e f"/" "|{a:.[],b:.}|"\(.a)\(.b[])"' | head
00
01
02
03
04
05
06
07
08
09

On-line test (Passing -r through URL is not supported – check Raw Output yourself.)
jq 1.5: 56 characters
(53 characters code + 3 characters command line option.)
[[range(10)]+"a b c d e f"/" "|"\(.[])\(.[])"]|sort[]

This produces correct output, however is not exactly a counter: it not generates the values in order, just sorts them after.
On-line test (Passing -r through URL is not supported – check Raw Output yourself.)

your link for jq doesn't work, and when I fixed it it says there isn't an index file on github :P

Oops. Thank you @Phase. I was too concentrated on the character count.

Ruby, 64 bytes
h='0123456789abcdef'.split //;h.each{|i|h.each{|j|print i,j,?\s}}

Explanation:
h = '0123456789abcdef'.split // # Split string of hex chars at
                                # matches of //, returns array
                                # splits array by characters
h.each { |i|                    # loop 1
  h.each { |j|                  # loop 2
    print i,j,?\s               # print() can take multiple params,
                                # and it is the same as printing
                                # each one using a separate print().
                                # ?x is the same as 'x', so ?\s is
                                # the same as "\s", which is " ".
  }
}

Dyalog APL, 12 bytes
       ∘.,⍨16↑⎕D,⎕A
 00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F
 10  11  12  13  14  15  16  17  18  19  1A  1B  1C  1D  1E  1F
 20  21  22  23  24  25  26  27  28  29  2A  2B  2C  2D  2E  2F
 30  31  32  33  34  35  36  37  38  39  3A  3B  3C  3D  3E  3F
 40  41  42  43  44  45  46  47  48  49  4A  4B  4C  4D  4E  4F
 50  51  52  53  54  55  56  57  58  59  5A  5B  5C  5D  5E  5F
 60  61  62  63  64  65  66  67  68  69  6A  6B  6C  6D  6E  6F
 70  71  72  73  74  75  76  77  78  79  7A  7B  7C  7D  7E  7F
 80  81  82  83  84  85  86  87  88  89  8A  8B  8C  8D  8E  8F
 90  91  92  93  94  95  96  97  98  99  9A  9B  9C  9D  9E  9F
 A0  A1  A2  A3  A4  A5  A6  A7  A8  A9  AA  AB  AC  AD  AE  AF
 B0  B1  B2  B3  B4  B5  B6  B7  B8  B9  BA  BB  BC  BD  BE  BF
 C0  C1  C2  C3  C4  C5  C6  C7  C8  C9  CA  CB  CC  CD  CE  CF
 D0  D1  D2  D3  D4  D5  D6  D7  D8  D9  DA  DB  DC  DD  DE  DF
 E0  E1  E2  E3  E4  E5  E6  E7  E8  E9  EA  EB  EC  ED  EE  EF
 F0  F1  F2  F3  F4  F5  F6  F7  F8  F9  FA  FB  FC  FD  FE  FF

For once, APL matches Pyth.

Perl 6, 34 bytes
The shortest that I can come up with that doesn't use any sort of conversion is:
put [X~] (|(0..9),|('A'..'F'))xx 2 # 34 bytes

prints 00 ... FF space separated in order.
If you want more you can swap 2 for a larger number.
(don't use a number bigger than 4 as it concatenates the values together before outputting anything, so it would use a significant amount of RAM )

Shortest that will never stop writing hex values
put [R~] (|(0..9),|('A'..'F'))[.polymod: 16 xx*]for 0..* # 56 bytes

If printf were allowed
printf "%X ",$_ for 0..* # 24 bytes

If a base conversion function were allowed
put .base(16)for 0..* # 21 bytes

Matlab: 47 bytes
q=[48:57,97:102,''];fliplr(char(combvec(q,q)'))

I don't know if it would be considered as counter. The code generates vector of hex numbers from 00 to ff. q is a string '0123456789abcdef' in double format. Combvec generates all possible pairs between q and q. Char converts it to string format and fliplr flips the columns to get:
00
01
...
08
09
0a
0b
0c
0d
0e
0f
10
11
...
fd
fe
ff

C++14 - 135
#include<string>
#include<iostream>
void f(){std::string a="0123",b="0123456789ABCDEF";for(char c:a)for(char d:b)std::cout<<c<<d<<" ";}

No, it's fine like it is. What compiler are you using? I get 'string' is not a member of 'std' with mine.

@Dennis That's a good point. I always forget that it requires including string as it's own. Fixed.

I'm getting the same error for cout as well. I guess you need iostream too. 2. It prints the numbers without separation. The challenge requires spaces, tabs or newlines. 3. You should mention the required version of C++.

GFortran, 93 83 bytes
Prints 00 through ff. Saved 10 bytes using print loops instead of do.. enddo.
Try it Online!
character(16)H;H='0123456789abcdef'
print*,((H(i:i)//H(j:j),' ',j=1,16),i=1,16)
end

Old version: 93 bytes

Zsh, 44 29 bytes
-15, via GammaFunction   try it online!
h=({0..9} {a..f});echo $^h$^h

Original (44 bytes):
g=0123456789abcdef;h=(${(s::)g});echo $^h$^h

Instead of converting to array, you can start there: h=({0..9} {a..f}). 29 bytes

Thanks! zsh is very golfable :)

Ahead, 42 bytes
Prints hex numbers starting at 0 forever. Will eventually overflow, though.
>t>:16;r
Cvn:/61\<
 >$>:10/7*v
^oNndo++0'<

Try it online!

Scala, 84 bytes
val l=(0 to 9)++"A,B,C,D,E,F".split(",")
l.foreach(x=>l.foreach(y=>println(x+""+y)))

Slightly better built version, using what you could call a cartesian product. Try it online! Output goes with leading 0s and a trailing newline. Starts at 00 and counts up to FF (255 in base 10).
Scala, 89 bytes
for(x<-1 to 48)println(if(x%16>9)x/16+"a,b,c,d,e,f".split(",")(x%16-10)else x/16+""+x%16)

First answer, because why not, I like its hacks. Try it online! Output goes with leading 0s and a trailing newline. Starts at 01 and counts up to 30 (48 in base 10).

8088 Assembly, IBM PC DOS, 34 bytes
Bytes xxd:
00000000: 43e8 0900 e806 00b0 20cd 10eb f3b1 04d2  C....... .......
00000010: c38a c324 0f3c 0a7c 0204 0704 30b4 0ecd  ...$.<.|....0...
00000020: 10c3

Unassembled:
        BYTE_LOOP:
43          INC  BX             ; increment counter
E8 0009     CALL HB             ; display high byte
E8 0006     CALL HB             ; display low byte
B0 20       MOV  AL, ' '        ; display space delimiter
CD 10       INT  10H            ; call BIOS, write char to console
EB F3       JMP  BYTE_LOOP      ; keep looping forever
        HB PROC
B1 04       MOV  CL, 4          ; set up bitshift for 4 bits
D2 C3       ROL  BL, CL         ; shift counter left 4 bits
8A C3       MOV  AL, BL         ; put counter into AL
24 0F       AND  AL, 0FH        ; isolate nibble
3C 0A       CMP  AL, 0AH        ; is nibble A-F?
7C 02       JL   NOT_ALPHA      ; if not, skip adjustment
04 07       ADD  AL, 'A'-'9'-1  ; adjust ASCII value to A-F
        NOT_ALPHA:
04 30       ADD  AL, '0'        ; decimal to binary convert
B4 0E       MOV  AH, 0EH        ; BIOS tty function
CD 10       INT  10H            ; call BIOS, write char to console
C3          RET                 ; return to program
        HB ENDP

Standalone PC DOS exactable, output is to console and will keep displaying until program is stopped.  Just a scratch ASCII manipulating program here.  There are just no built-ins or convenience methods in x86 or DOS/BIOS APIs to convert binary values to strings for output.
Output:

Pip -s, 8 bytes
_TB16M,h

Try it online!
Explanation
_TB16M,h
      ,h range 0...99
     M   map using lambda:
_TB16    convert to hexadecimal
         join with spaces(-s flag)

Perl 5, 35 bytes
//,map{say$',$_}@,for@,=(0..9,a..f)

Try it online!

Julia - 58 bytes
a="0123456789abcdef"
for i in a
        for j in a
                print(i*j*" ")
        end
end

Thunno 2 Ṡ, 4 bytes
kfDṖ

Try it online!
Explanation
kfDṖ  # Implicit input
kf    # Push "0123456789ABCDEF"
  DṖ  # Cartesian product with itself
      # Join on spaces
      # Implicit output

Haskell, 52 bytes
a="0123456789abcdef";main=mapM putStrLn$mapM id[a,a]

Python 2 - 57 bytes
h='0123456789ABCDEF'
' '.join([i+j for i in h for j in h])

This outputs 00 to FF, with spaces between.

Python 3, 157 bytes
As far as I can tell, this is the only submission so far that can keep counting upwards forever. (Of course, I can't read Haskell or Mumps, but they all seem to be doing a two-character loop...) EDIT: Okay, not the only one, but perhaps the only one in a non-golfy language?
n=bytearray(b'0')
while 1:
 print(repr(n)[12:-2]);p,o=len(n),1
 while o:
  p-=1;m=n[p];n[p]={57:65,70:48}.get(m,m+1);o=m==70
  if o and p==0:p=1;n[:0]+=b'0'

Proof of correctness (wraps the above in a function, changing only print to yield, and then loops as high as you like):
def golfed_code():
 n=bytearray(b'0')
 while 1:
  yield(repr(n)[12:-2]);p,o=len(n),1
  while o:
   p-=1;m=n[p];n[p]={57:65,70:48}.get(m,m+1);o=m==70
   if o and p==0:p=1;n[:0]+=b'0'

TEST_LIMIT = 100000

for n, h in enumerate(golfed_code()):
 assert hex(n).upper()=='0X'+h,'{} != {}'.format(hex(n).upper(),'0X'+h)
 if n == TEST_LIMIT:
  break

(Thanks to Sp3000 for saving me 3 bytes.)

@Sp3000: Not that I could find (though that doesn't mean one doesn't exist). Everything I tried took more characters, usually because I was constructing a new bytearray (and that's a big word). Also: fine, it's the only endless counter in a non-golfy language. ;-)

@Sp3000: I missed that first one (everything else I tried with b'' literals left me with a bytes, not a bytearray). But the second one means a is modified right along with n.

Right, thought they were immutable for some reason. I'm not sure why you're using bytearrays though, surely division/modulo + string building is shorter?

@Sp3000: Because their string representation automatically ASCIIfies them. I think if I found an approach other than bytearray, I'd make it a new answer anyway; it'd be too much like "chuck it out and start over" to edit into this one.

It's now not the only example of an endless counter from a non-golf language put [R~] (|(0..9),|('A'..'F'))[.polymod: 16 xx*]for 0..* in Perl 6


text:
Check over hand values for single-suited Mahjong
Mahjong is a tile game that is immensely popular in Asia. It is typically played with four players, and the goal of the game is to be the first person to complete a valid hand using the tiles. In mahjong there are three tile suits plus honour tiles — for this challenge we will only consider hands formed using tiles from a single suit.
Tiles are numbered from 1 to 9, and there are exactly four copies of each tile. A valid hand consists of four sets of three and a pair, for a total of fourteen tiles.
A set of three can be either:

A triplet, three of the same tile (e.g. 444), or
A sequence of three consecutive tiles (e.g. 123 or 678 but not 357). Sequences do not wrap (so 912 is invalid).

A pair is simply two identical tiles (e.g. 55).
The challenge
Given a valid hand of fourteen tiles, determine its score based on the following criteria:
Condition                Description                                 Point/s
-------------------------------------------------------------------------------
Straight                 Contains the sequences 123 456 789          1
Identical sequences      Contains two identical sequences            1
All simples              Only 2-8, no 1s or 9s                       1
All sequences            All sets of three are sequences             1
All triplets             All sets of three are triplets              2
Flush                    Single-suit hand (always applies)           5

(Scoring here is based off Japanese mahjong rules, but heavily simplified to make the spec less messy.)
The score of a hand is the sum of points for the conditions it satisfies. If a hand can be decomposed in more than one way, take the highest scoring decomposition.
The input hand is guaranteed to be valid, i.e. fourteen tiles from 1 to 9 and each tile appearing at most four times, and may be assumed to be already sorted. Input is a list of digits (as a string or a single flat list of integers) via STDIN, function argument or command line. Output may be to STDOUT or return value.
Test cases
22233355777888  ->  8  # 222 333 55 777 888, flush + all simp. + all trip.
11112345678999  ->  6  # 111 123 456 789 99, flush + straight
11123456788999  ->  5  # 111 234 567 88 999, flush only (no straight)
23344455566788  ->  7  # 234 345 456 567 88, flush + all simp. + all seq.
33334444555566  ->  8  # 33 345 345 456 456, flush + all simp. + all seq. + identical seq.
11122233377799  ->  7  # 111 222 333 777 99, flush + all trip. (no identical seq.)
12344556678889  ->  8  # 123 456 456 789 88, flush + all seq. + straight + identical seq.
11344556678999  ->  5  # 11 345 456 678 999, flush only (no identical seq.)
22233344455566  ->  8  # 222 333 444 555 66, flush + all simp. + all trip.
11112233344555  ->  5  # 111 123 234 345 55, flush only

For the fifth example, despite having two pairs of identical sequences, only one needs to be present to attain the point. The decomposition 345 345 345 345 66 would score the same, while 333 345 444 555 66 scores worse.
Scoring
This is code-golf, so the solution in the fewest bytes wins. Standard loopholes apply.

Related challenge: What are you waiting for? (A mahjong solver)

J (241 byes)
You need the latest version of J installed.
i=:>:@i.9
q=:,/^:4>@:{(i.9);(i.;i.;i.;i.)16
s=:3 :'(>./((5+([:(*./)(3*i.3)&e.)+(-.@:(-:~.))+((*./)@:(6&>:))+2*((*./)@:(6&<)))"1(}."1(y(-:/:~"1)"1((([:{&(i,.i){.),[:,/[:{&(((>:@i.7)+"0 1(i.3)),|:3 9$i)}.)"1 q))#q)))+([:(*./)[:-.((1 9)&e.))y'

Call the function s with a list of integers. For example, the following example script verifies the test cases above:
#!/usr/bin/jconsole
i=:>:@i.9
q=:,/^:4>@:{(i.9);(i.;i.;i.;i.)16
s=:3 :'(>./((5+([:(*./)(3*i.3)&e.)+(-.@:(-:~.))+((*./)@:(6&>:))+2*((*./)@:(6&<)))"1(}."1(y(-:/:~"1)"1((([:{&(i,.i){.),[:,/[:{&(((>:@i.7)+"0 1(i.3)),|:3 9$i)}.)"1 q))#q)))+([:(*./)[:-.((1 9)&e.))y'

echo (s 2 2 2 3 3 3 5 5 7 7 7 8 8 8)=8
echo (s 1 1 1 1 2 3 4 5 6 7 8 9 9 9)=6
echo (s 1 1 1 2 3 4 5 6 7 8 8 9 9 9)=5
echo (s 2 3 3 4 4 4 5 5 5 6 6 7 8 8)=7
echo (s 3 3 3 3 4 4 4 4 5 5 5 5 6 6)=8
echo (s 1 1 1 2 2 2 3 3 3 7 7 7 9 9)=7
echo (s 1 2 3 4 4 5 5 6 6 7 8 8 8 9)=8
echo (s 1 1 3 4 4 5 5 6 6 7 8 9 9 9)=5
echo (s 2 2 2 3 3 3 4 4 4 5 5 5 6 6)=8
echo (s 1 1 1 1 2 2 3 3 3 4 4 5 5 5)=5

exit''