text:
Shortest code to produce non-deterministic output
You need to produce output that is non-deterministic.
In this case, this will be defined to mean that the output will not always be the same result.
Rules:

A pseudo-random number generator that always has the same seed does not count.
You can rely on the program being run at a different (unknown) time each execution.
Your code's process id (if it's not fixed by the interpreter) can be assumed to be non-deterministic.
You may rely on web-based randomness.
Your code may not take non-empty input. Related meta post.
The program is not required to halt, but the output must be displayed.

Leaderboard

function answersUrl(a){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+a+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(a,b){return"https://api.stackexchange.com/2.2/answers/"+b.join(";")+"/comments?page="+a+"&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(a){answers.push.apply(answers,a.items),answers_hash=[],answer_ids=[],a.items.forEach(function(a){a.comments=[];var b=+a.share_link.match(/\d+/);answer_ids.push(b),answers_hash[b]=a}),a.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(a){a.items.forEach(function(a){a.owner.user_id===OVERRIDE_USER&&answers_hash[a.post_id].comments.push(a)}),a.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(a){return a.owner.display_name}function process(){var a=[];answers.forEach(function(b){var c=b.body;b.comments.forEach(function(a){OVERRIDE_REG.test(a.body)&&(c="
"+a.body.replace(OVERRIDE_REG,"")+"
")});var d=c.match(SCORE_REG);d?a.push({user:getAuthorName(b),size:+d[2],language:d[1],link:b.share_link}):console.log(c)}),a.sort(function(a,b){var c=a.size,d=b.size;return c-d});var b={},c=1,d=null,e=1;a.forEach(function(a){a.size!=d&&(e=c),d=a.size,++c;var f=jQuery("#answer-template").html();f=f.replace("{{PLACE}}",e+".").replace("{{NAME}}",a.user).replace("{{LANGUAGE}}",a.language).replace("{{SIZE}}",a.size).replace("{{LINK}}",a.link),f=jQuery(f),jQuery("#answers").append(f);var g=a.language;g=jQuery(""+g+"").text(),b[g]=b[g]||{lang:a.language,lang_raw:g,user:a.user,size:a.size,link:a.link}});var f=[];for(var g in b)b.hasOwnProperty(g)&&f.push(b[g]);f.sort(function(a,b){return a.lang_raw.toLowerCase()>b.lang_raw.toLowerCase()?1:a.lang_raw.toLowerCase()<b.lang_raw.toLowerCase()?-1:0});for(var h=0;h<f.length;++h){var i=jQuery("#language-template").html(),g=f[h];i=i.replace("{{LANGUAGE}}",g.lang).replace("{{NAME}}",g.user).replace("{{SIZE}}",g.size).replace("{{LINK}}",g.link),i=jQuery(i),jQuery("#languages").append(i)}}var QUESTION_ID=101638,ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",OVERRIDE_USER=34718,answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\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:400px;float:left}table thead{font-weight:800}table td{padding:5px}
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

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

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

What about undefined behaviour?

@MartinEnder Undefined based on the implementation, or based on where it's run?

@mbomb007 In C there are many things that are simply "undefined" behaviour. Any given interpreter is allowed to do whatever it wants in any situation. For all we know, gcc might order you a pizza if you try to overflow a signed integer on a rainy Tuesday, but will make a trout jump out of your screen on all other days. So you wouldn't really ever know if it's actually deterministic or not in any given implementation.

@MartinEnder I'm not sure if that matters.  We define languages here by their implementation, not by the specification (as languages without an implementation is not allowed)

@MartinEnder Yeah, I agree with Nathan.

@NathanMerrill My point was that for undefined behaviour we can't really tell to what degree it's non-deterministic unless we reverse engineer the implementation. Undefined behaviour is basically the definition of non-deterministic, but any given implementation may for any given set of circumstances decide to always to the same thing when you run the code.

That's true.  Non-deterministic is defined in the specification, not the implementation (because you can't detect determinism in a black box).

@MartinEnder Any non-determinism defined (or not defined?) in the spec is not referring to a single implementation, but to all of them. It's simply trying to say don't rely on it. But for an answer, I'd say you would need to look at the implementation and prove that the answer is not always the same, especially if I were to run it and it's always the same for my implementation I'm running that's the same as yours.

@mbomb007 Undefined behaviour is not the same as implementation defined behaviour. Undefined behaviour does allow to do anything under any circumstances (and is often the cause of irreproducible bugs). And always returning the same thing is not a reliable measure of randomness.

@MartinEnder If I can run it and see different results for the same implementation, I'll allow it.

Note that undefined behaviour in C often leads to crashes, and crashes on UNIX and Linux lead to core files which contain the process ID inside them. That would seem to comply with the question as currently worded.

@ais523 Stderr is not valid by consensus. Consensus requires something like 3/4 upvotes out of total votes. Also, you can't say "often". It has to be in the code, guaranteed to output the required non-deterministic result.

Consensus says that output to a file is valid. The crash dump is a file, with the filename core.

@ais523 If I can't validate the answer, it's not valid.

So if the seed of the random generator is set to a different (random) value each time by default, can a random number generator be used?

@LuisMendo Yes, if the randomness that determines the seed is not deterministic.

Unless I misunderstood, the question did not ask for code that takes advantage of undefined behavior.  It asks for code that takes advantage of defined behavior to guarantee non-determinism.

What do you mean by "Your code may not take non-empty input."? Surely a program that doesn't input anything anywhere can't be nondeterministic.

@Angs http://meta.codegolf.stackexchange.com/a/7172/34718

@MartinEnder damn, missed my free GCC pizza yesterday.

Now that there are a bunch of function answers, I'd just like to clarify: Are function entries allowed?

@ETHproductions My earlier comment appears to have been deleted. Yes, I was intentionally vague in order to allow the default (full program or function).

For C with undefined behaviour, main=0; would produce a non-deterministic core-file in 7-bytes.

You say that the program does bot need to halt.  Would a program that either halts or loops forever with a 50% chance of each be non-deterministic?

@WW I don't think that would count as "output". The not needing to halt means that output should happen in either case. The output could be empty string for one of them.

Can we use environment variables as a source of non-determinism?

@EsolangingFruit No, because those are generally either defaults or set by the user. They don't really change, and consecutive runs of your program would always output the same result.

huh?, 0 bytes

An empty program still produces output. The last lines of the Python interpreter that are executed:
print "..."
f = open('Notes.txt', 'w')
f.write(time.strftime("%c") + " - The user tried to give me commands again. I still have no idea what they are talking about...\n")

At the end of a program, the Python interpreter will print ..., then it will create/open a text file called Notes.txt and write a string which contains the current time in front.

Of all the things I thought people would use on my GitHub, I didn't think a joke language interpreter would be one :P

@Kade I was actually going to use it to answer another question as well (shortest code to play a sound, with only a single byte) -- but the question is now closed.

WinDbg, 1 byte
#

Wow! Never expected a 1 byte solution from WinDbg!
# searches for a disassembly pattern, but since there's no parameters, it looks to just return the next assembly instruction in whatever dump/process you're attached to. Not sure the logic for setting the initial address, but it does.
Sample output:
0:000> #
Search address set to 75959556
user32!NtUserGetMessage+0xc
75959556 c21000          ret     10h

0:000> #
user32!NtUserGetMessage+0xf
75959559 90              nop

0:000> #
user32!NtUserMessageCall
7595955a 90              nop

0:000> #
user32!NtUserMessageCall+0x1
7595955b 90              nop

0:000> #
user32!NtUserMessageCall+0x2
7595955c 90              nop

0:000> #
user32!NtUserMessageCall+0x3
7595955d 90              nop

0:000> #
user32!GetMessageW
7595955e 8bff            mov     edi,edi

0:000> #
user32!GetMessageW+0x2
75959560 55              push    ebp

0:000> #
user32!GetMessageW+0x3
75959561 8bec            mov     ebp,esp

0:000> #
user32!GetMessageW+0x5
75959563 8b5510          mov     edx,dword ptr [ebp+10h]

One of the cooler answers here, this should win over a "Current Date" solution in my opinion.

that above it seems the disassebly, step by step of the begin of some function in 386 intel cpu assembly

MATLAB, 3 bytes
why

why provides answers to almost any question. A few examples:
why
The programmer suggested it.

why
To fool the tall good and smart system manager.

why
You insisted on it.

why
How should I know?

This is shorter than any rand function I can think of.

MATLAB has a builtin for this? Why?

@ETHproductions The programmer suggested it

Java 7, 33 30 27 bytes
int a(){return hashCode();}

Because Java.

Because Java. Probably the best explanation of Java ever.

toString() also works, right? Outputs a random memory address if not overridden.

@carusocomputing I had toString in a previous version but then the return type is String which is longer than int. Save the bytes! :]

@Poke HA! I wondered what I over-looked there. Good catch.

Is this valid as a function? hashCode() is an abbreviation here for this.hashCode(), so it'd only work as an instance method, not a static method. In that case, you'd need additional code to create an object in the caller. That's relevant here because it's the code to create an object that's responsible for the nondeterminism.

@ais523 If I wanted it to be a static method I likely would have defined it as such. From what I've seen in the past a function is an acceptable answer for languages like java unless otherwise specified in the question. It is assumed to be part of a class and will run with the given definition in any class it's a part of.

It won't be nondeterministic if the class overrides hashCode; many do. I guess we have to assume that the method belongs to a class that extends Object directly and has no other code, and that we create an object of that class to run the code on…

@ais523 I think this meta post and comment should be relevant.

In Java 8: ()->hashCode() for 14 bytes. Just sayin' ;)

@OlivierGrégoire Yeah yeah but I'm still stuck in my ways :P

This snippet doesn't compile as Java code (t.java:1: class, interface, or enum expected). So it can't possibly produce an output. So it can't possibly produce nondeterministic output.

@pts I'm going based off of the meta post discussing the default submit structure for posts. Functions are allowed by default unless the challenge specifies that a full program is required.

I tried to put this into a class and added a main method which calls this method: package codegolf.nondet101638;public class Test{int a(){return hashCode();}public static void main(String[]x){System.out.println(new Test().a());}}. Running it always outputs (on my OpenJDK 1.8)  1808253012. Doesn't seem too nondeterministic?

@PaŭloEbermann From the docs. "Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application."  Also for future reference please note that my answer is for Java 7 and you tested with Java 8. It shouldn't matter this time

@Poke just for curiosity, could you compile this program on your Java 7 implementation and run it several times? Does it output different results?

@PaŭloEbermann Eclipse with Java 7

Thanks. So it looks like this determinism was added with Java 8, or with the Linux version.

R, 1 byte
t

Outputs the function's source code and a memory pointer address which changes with every (re-)start of R.

Minecraft, 5 4 bytes
op 8

Used by typing into a server's console or a command block and giving it power. Can be run from the chat interface by prepending a /.
Usually this does nothing, but if there's a player with the username "8" on the server, they will be given operator permissions. Note that while Minecraft normally requires usernames to be 3 characters long, some accounts with shorter name lengths were created before this restriction.
The version that can be demonstrated to be non-deterministic without one of these usernames or risk of giving a user operator permissions is here:
me @r

Displays a message to everyone, the message being the username of a random player. The op command only takes a string literal, not any script that returns a string.
The me command wouldn't really work for the first example, it would display "<your-username> 8". When run from a command block, it wouldn't be deterministic since all command blocks have the same "username" but running it from the chat interface would require the / for one extra byte.

So / is not included in the byte count?

@Challenger5 The slash is optional in command blocks, not allowed in the server console, and mandatory in the chat interface.

op @r does not actually work.  Variable expansion is explicitly disabled in the op command.  Instead that command ops a player with an (invalid) name of @r.

Try me @r instead, as /me does support variable expansion if you're OP (iirc) and thus you'll get a real random name.

@Pokechu22 thanks! Io change it when it get on a computer.

Actually, it should be 4 bytes + 2 blocks (Command block and redstone source), or 6 blytes

@RudolphJelinek You can run it from the console without command blocks.

@Pavel but thenn it's non-repetible (eg. you have to retype it every time, no memory), so it doesn't fit the rules.

Another non-deterministic option would be help in a command block, which is 4 bytes (and doesn't require pirated games).

@ГригорийПерельман But then it needs a slash.

If you count error output, anything (even nothing maybe?) in a command block would work, because it prints the current time at the beginning.

Labyrinth, 5 bytes
v
!
@

Either prints 0 or nothing (50% chance each).
Try it online!
There is a very specific case in which Labyrinth exhibits random behaviour:

There must be a wall in front of the instruction pointer and behind it.
There must be a non-wall left and right of the instruction pointer.
The current top of the stack must be zero.

If all of those conditions are met, the direction the IP moves in is chosen (uniformly) randomly. The cherry on top is that those three conditions are impossible to meet in regular control flow, which means unless you modify the source code at runtime.
(This may seem a bit arbitrary, but it's actually the most consistent behaviour I could find for these conditions, since normally the direction of the IP always depends on the previous direction, its neighbours, and the sign of the top of the stack, and this seemed like an elegant way to include a source of randomness in the language.)
With the help of the source code rotation instructions (<^>v) it's possible to bring the IP into this situation. One such example is seen at the top. The IP initially points east and starts at the top. The v rotates the current column so that we get:
@
v
!

The IP moves along with this rotation so that it's still on the v, pointing east. All the conditions are fulfilled now, so the IP will either go up or down randomly. If it goes up, the program terminates immediately. If it goes down, it prints a zero, rotates the column again, and then terminates.
There are three other programs making use of this (one which also prints 0, one which prints 00 and one which prints 000):
v
@
!

"
>@!

"
>!@

(Actually there are a lot more than three other programs, because you could also use . instead of ! to print null bytes, or replace that " with a large variety of commands, but I believe they all work essentially the same.)

Befunge (-93 and -98), 3 bytes
?.@

The ? sends execution in a random direction. If it goes up or down, it loops back to the ? and rerolls. If it goes left, the program wraps round to the @ and thus exits without printing anything. If it goes right, it prints 0  (the output produced by . when the stack is empty) and then exits on the @.

This isn't guaranteed to terminate, but I was going to post this exactly so +1

You may want to change the comma to a period to output 0 as a number instead of a null character (ASCII value 0). +1

It was . in the program I was using for testing, but somehow became a , when I copied it onto PPCG. Fixed.

@Dopapp it terminates almost surely though, with probability 1. I'd take that as a guarantee ;)

@JamesHolderness I think you can do it in 1. Not sure if this counts though...

sh + procps, 1 byte
w

This is the shortest solution I'm aware of that works via calling into external executables. procps is the responsible package for reporting information about the current system state (ps and friends), and is installed on most Linux distributions by default; w is the shortest-named command in it, and returns information about the logged-in users, but also some nondeterministic information like uptime.

Inform 7, 6 bytes
x is y

This isn't a valid Inform 7 program, since neither "x" nor "y" has been defined. So this throws an error.
However, some of Inform 7's error messages—including this one—are randomized. So the text it prints is technically non-deterministic.
A few possible outputs include:

Problem. The sentence 'x is y' appears to say two things are the same - I am reading 'x' and 'y' as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that 'Adams is Jefferson'. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance 'Virginia is a lighted room' says that something called Virginia exists and that it is a 'room', which is a kind I know about, combined with a property called 'lighted' which I also know about.
Problem. The sentence 'x is y' appears to say two things are the same - I am reading 'x' and 'y' as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that 'Adam is Eve'. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance 'Land of Nod is a lighted room' says that something called Land of Nod exists and that it is a 'room', which is a kind I know about, combined with a property called 'lighted' which I also know about.
Problem. The sentence 'x is y' appears to say two things are the same - I am reading 'x' and 'y' as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that 'Clark Kent is Lex Luthor'. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance 'Metropolis is a lighted room' says that something called Metropolis exists and that it is a 'room', which is a kind I know about, combined with a property called 'lighted' which I also know about.
Problem. The sentence 'x is y' appears to say two things are the same - I am reading 'x' and 'y' as two different things, and therefore it makes no sense to say that one is the other: it would be like saying that 'Aeschylus is Euripides'. It would be all right if the second thing were the name of a kind, perhaps with properties: for instance 'Underworld is a lighted room' says that something called Underworld exists and that it is a 'room', which is a kind I know about, combined with a property called 'lighted' which I also know about.

Even the error messages are verbose!

JavaScript, 4 bytes
Date

A function which returns the current date/time. I think this is the shortest it will get...
Explanation
Since this seems to be causing a lot of confusion as to why it's valid, I'll try to explain.
In JavaScript, a function entry is valid if it can be assigned to a variable and called like a function. For example, this function is a valid entry:
function(){return Date()}

Because it is a function that can be assigned to a variable like so:
f=function(){return Date()}

And then run with f() as many times as necessary. Each time, it returns the current date/time string, which has been ruled non-deterministic by the OP.
This ES6 arrow function is also valid:
_=>Date()

It can be assigned with f=_=>Date(), then run with f() like the other one.
Now, here's another valid entry:
Date

Why? Because just like the other two entries, it can be assigned with f=Date and then called with f(), returning exactly the same thing as the other two. Try it:

var f = Date
<button onclick="console.log(f())">Run</button>

Do you not need it to be Date() to invoke the function?

@milk Date is a function which, when called with no inputs, produces the current date/time. _=>Date() is a clearly valid entry which does exactly the same thing, so Date is a valid entry.

That makes sense.

Also, Date is a constructor and can be used as new Date().

If you know in advance that it will produce the current date, isn't that deterministic?

@WGroleau Sort of, but the OP has explicitly allowed date functions.

Typing Date to the JavaScript console of my browser produces deterministic output, it always produces this: function Date() { [native code] }. You probably mean Date(), 6 bytes.

@pts That would be a snippet, not a function or even a full program. This is a function entry, i.e. you call the function to run it. It's exactly the same as _=>Date().

if "date" above is ok than "malloc(8)" or "time(0)" would be ok in C too

@RosLuP Date in JavaScript returns a function, just like n=>n. I don't believe malloc(8) returns a function, so it's either a full program or a snippet.

yes they print the result and time(0) is just one number,...

You need to actually call Date to get non-deterministic output. One of the rules is "the output must be displayed". How is this a valid entry?

@RosLuP I've added an explanation which should clarify things.

@suriv This is a function entry, which have been allowed by the OP. See explanation for more info.

Haskell, 49 bytes
import Unsafe.Coerce
main=putStr[unsafeCoerce(+)]

Unfortunately this seems to always outputs the same thing on TIO (I don't quite know why, but I have some guesses), so if you want to try it you should run it locally.
I've only tested this on Linux and OSX.  I make no guarentees about Windows.  If you are having trouble getting it to work on Linux I would be interested to know.
Explanation
What is unsafeCoerce?
This answer relies on unsafeCoerce.  This function is a bit of magic, so first we are going to have to do a quick intro to Haskell's type system.
Haskell has something called type erasure.  This means that the compiler checks all the types to make sure that nothing in the program is called on the wrong type.  Once it is done with that there is no need to actually store type information any more, so Haskell erases it.  So at runtime all data is the same and just relies on the fact that we already checked all the types before hand so nothing goes horribly wrong.
unsafeCoerce is a function that lies to the type checker.  It tells it that it can take any input and produce any output;  it's type is
forall a. forall b. a -> b

But it does nothing, it gives back the input exactly as it got it.  So if you take a string like "abcd" and coerce it to an int using unsafeCoerce the result will be whatever the representation of "abcd" in memory is when interpreted as an integer.
How are functions represented in memory?
In Haskell, all complex objects including functions are internally represented as a pointer.  This is a number in binary that "points" to a specific location in memory.  This is because we want to pass these values by reference, since copying the whole thing is expensive, and since Haskell disallows mutation we can with no problem.
However simple objects like ints are passed by value since they are so small that copying them is about as expensive as copying a pointer would be.  So they are not represented as pointers but rather just whatever structure they are.
So if we use unsafeCoerce from a complex object, say a function, to a simple object, say an Int, what happens is that the pointer to the function gets converted to the simple object.  And the value of that simple object is dependent only on where the complex object is located not anything about what it is.
Address Space Layout Randomization
More reading
Many software vulnerabilities rely in part on being able to find particular functions in computer memory to access them.  For these techniques you create some malicious code somewhere in memory (this can be done a few ways) and then by hijacking the stack pointer convince a program to run your code. In order to combat these exploits many systems implement something called Address Space Layout Randomization or ASLR.  With ASLR key components are placed randomly so that their locations cannot be predicted.  This means even if you do get control of the stack pointer it is hard to find where your malicious code is placed.  ALSR is not the only technique used against these attacks but it is one we care about.
For Linux systems you can check of ASLR is on using
cat /proc/sys/kernel/randomize_va_space

Or since this is code-golf:
sysctl -anr "e_v"

There are three levels of security here 0 for off, and 1 and 2 for varying levels of on.  My computer has this set to 2 (and your computer probably does too).
You can also set this.  However do not do this unless you know what you are doing.  Please do not mess with your kernel (unless you know what you are doing).  For this reason I'm not going to include the command to do this, but you can look it up online or figure it out from the commands I already gave.
What this means for us is that the locations for objects allocated by Haskell at runtime is random or at least non-deterministic.  This means that when we take a complex object like a function and convert it to a simple object like an Int the value of that object is random too.
The program
So that's what our program does.  We coerce a function, (+) because it is short.  We wrap this in a list and print it using putStr. Since putStr expects a string the compiler infers that the output of unsafeCoerce(+) must be a Char, which is a simple type.
So we end up printing a random one character string.
A more normal solution, 44 bytes
import System.Random
main=randomIO>>=putChar

Try it online!
For completion sake this is the "normal" Haskell approach.  It is slightly shorter but far more boring.

Pyth, 2 bytes
O0

Explanation:
 0 0
O  Random float in [0, 1)

It's that, when O has 0 as its argument, it simply returns a random float between 0 and 1, exclusive.
Let's do it just for the heck of it!
Also, it seems that this can be sorta retro (thanks to 34718/mbomb007):

Pyth, 2 bytes
OT

Explanation:
 T 10
O  Random integer in [0, 10]

Try this boooooooooooooooring version instead >:(

http://dilbert.com/strip/1992-09-08

Python 2, 11 bytes
print id(1)

That's the one I found. I had id(0), though. :)

I beat you, technically, since I'm the OP and found it before I posted the question. I didn't want to post the question and immediately post my shortest answer.

Bash (procps-ng), 2 bytes
ps

$$ is also a solution.

If so, w is shorter and also comes from procps.

You edited this into a duplicate of my answer.

@ais523 oops, sorry.

Nice, my attempt was gzip.

Commodore 64 Basic, 4 bytes
1S|0

PETSCII substitution: | = SHIFT+Y
The zero page of a Commodore 64 is an area of 256 bytes of memory that can be accessed faster than the rest of RAM.  Consequently, programs (such as the BASIC interpreter) use it for frequently-accessed data, and the CPU itself stores some of its internal state here.  The contents are subject to change without notice.
The BASIC program above, ungolfed, is 1 SYS 0, ie. transfer execution to memory location 0.  This starts executing the zero page as code.  Normally, when the BASIC interpreter starts running a program, the first 16 bytes are
2F 37 00 AA  B1 91 B3 22
22 00 00 4C  00 00 00 00

so SYS 0 would execute the following
00: ROL-AND $37,A  - Undocumented opcode: rotate the value at memory location 0x37 left, and store the result in the accumulator
02: BRK            - Call the interrupt vector

The overall result is to output the BASIC READY. prompt and return control to the user.  However, memory location 0x00 is the CPU's I/O direction register, and memory location 0x01 is CPU's I/O address register.  If you've done something that changes these before running the program, the results can be unpredictable, ranging from outputting garbage to locking up the computer (the 0x22 usually contained in memory location 0x07, if executed as an instruction, is an undocumented HALT opcode).
Alternatively, a more reliably unpredictable program is the four-byte
1?TI

Prints the elapsed time, in jiffies (1/60 of a second), since system power-on.

PowerShell, 4 2 bytes
(crossed out 4 still looks like 4)
ps

This is the alias for Get-Process which will output the current process listing as a table, including handles, private memory, CPU time, etc.
Execute it via something like the following:
C:\Tools\Scripts\golfing>powershell.exe "ps"

I have to admit, I checked to see if it was actually crossed out. You really can't even tell.

@Carcigenicate I can tell if it is crossed without selecting the text (Ubuntu 16.04.1, Chrome 54.0.2840.100).

Visible on android as well, though not clearly :p

It looks fine in the iOS app.

I don't have the rep to do it myself, but you could do 04 and strike it out.

Notepad, 1 keystroke
F5
Pressing F5 inserts the time and date in the format (h)h:mm XM (m)m/(d)d/yyyy. For example: 12:00 AM 1/1/1970

Today I learned...

I tried F5 is Notepad++, and it asks to run a program, Win+R style.

Oh wow... never knew this

In my laptop I also had to press Fn

@UndoneStudios You can lock Fn with Fn+Esc first.

Wouldn't that count as it's necessary to make this work?

@UndoneStudios no. fn lock is on by default

Baby Language, 0 bytes

I didn't submit this originally because I thought it postdated the question. I was wrong; the language did have an interpreter created in time. It's also probably the least cheaty 0-byte solution I've seen (given that a 0-byte program is specified to do exactly what the program asks, and not for the purpose of cheating on golfing challenges).
Baby Language is specified to ignore the program it's given and do something at random. (The interpreter linked on the Esolang page generates a random legal BF program and runs it.) That seems like a perfect fit for this challenge.

Zsh, 5 bytes
<<<$$

Prints PID.

C, 25 21 bytes
Thanks to pseudonym117 for saving 4 bytes.
main(i){putchar(&i);}

Compiled with gcc -o test lol.c (yeah I'm quite original with my file's name...), and ran with ./test.
It does what it says: prints the character corresponding to the memory address of i, which is defined at runtime, so it should be non-deterministic.

Can you skip the & as the value of a variable on the stack isn't defined? 2. You have a constant number of things on the stack, so is the memory address if i constant?

you can change from printf to putchar and save a few bytes (because you dont need a format string)

@Riley If I skip the &, it will always print 1. It should be undefined behavior though, but on my computer it kept printing 1. The address is not constant, but I cant tell if it's due to the program being executed in a different memory location each time, or if it's due to undefined behavior as well (my C knowledge isn't too great)

@pseudonym117 If I were to put putchar(&i), it would output ? most of the times, because &i will not correspond to any char.

you said exactly the point of the challenge - MOST of the time. not all of the time.

Ah true, brainfarted. Thanks!

i becomes what's normally called argc, so you're right, it will always be 1 unless there are more arguments. I can't believe I didn't rememeber that. I'm still not sure why the location changes, but if it works it works.

It changes on modern operating systems due to ASLR, a security feature designed to make it harder for exploits to guess addresses. You'll get a consistent result on some older OSes.

You can save a little by replacing putchar with return

On modern compilers with warnings for not declaring the type of a parameter, you could do: main(){printf("%d");}

@ceilingcat exit(&i); < return &i;

What about main(){err();} where err() is available? It generates a output including 1-2 "random" bytes (not sure what determines them, but it is different from run to run).

BrainfuckX and small s.c.r.i.p.t. (etc) polyglot - 2 bytes
?.

?  - Randomize the value in the current cell
.  - Send current cell to stdout

05AB1E, 2 bytes
žd

Try it online!
Outputs current microseconds from the executing machine's internal clock.
Or you could do something like this...
05AB1E, 3 bytes
A.r

Try it online!
Outputs a randomly shuffled lower-case alphabet.
Or this also works:
A.R

Try it online!
Outputs a random letter from the alphabet.
Or this also works, and is cooler:
05AB1E, 9 bytes
"ž"A.RJ.V

Try it online!
Outputs randomly one of these:
ž 23  > ža           push current hours
        žb           push current minutes
        žc           push current seconds
        žd           push current microseconds
        že           push current day
        žf           push current month
        žg           push current year
        žh           push [0-9]
        ži           push [a-zA-Z]
        žj           push [a-zA-Z0-9_]
        žk           push [z-aZ-A]
        žl           push [z-aZ-A9-0_]
        žm           push [9-0]
        žn           push [A-Za-z]
        žo           push [Z-Az-a]
        žp           push [Z-A]
        žq           push pi
        žr           push e
        žs           pop a, push pi to a digits (max. 100000)
        žt           pop a, push e to a digits (max. 10000)
        žu           push ()<>[]{}
        žv           push 16
        žw           push 32
        žx           push 64
        žy           push 128
        žz           push 256

Perl, 5 bytes
say$$

Outputs the process ID and a newline.

Similarly: say[] and say{} output the reference address of an array or hash.

Python 2, 29 bytes
import os
print os.urandom(9)

Sadly not the first time writing code on a smartphone.

Pyke, 1 byte
C

Try it here![broken]
Try it Online!
Outputs the current time

I'm fairly certain this is deterministic.

@EasterlyIrk in a deleted comment mbomb said this was ok

Oh, okay. Seems deterministic to me, but OP rules.

In my edit history I had a 3 byte version with proper randomness

@EasterlyIrk If the current time is deterministic, then so are pseudo-random numbers, since that's what they're seeded with. The goal is not "randomness". The goal is non-determinism.

@mbomb007 oh, true. forgot about that.

Ruby, 3 bytes
p$$

Try it online!
Prints the process ID.

$. would also work
Nice approach though :)

Groovy, 9 bytes
{print{}}
Outputs:
Script1$_run_closure1@2c8ec01c
Because it outputs the memory address of the closure it is non-deterministic.

And I thought Kotlin was the way to the shortest possible JVM solution.

Trying to put this into a file and running groovy Script1.groovy, I get an error: Ambiguous expression could be either a parameterless closure expression or an isolated open code block;. How do I use this?

Assign it to a closure variable, then call it.

Emotinomicon, 15 bytes
⏬

Explanation:
⏬
      push 0. Stack: [0]
      push 1. Stack: [1]
      random[pop;pop]. Stack: [1 or 0]
      ⏬output

The language's name is Emotinomicon

@daHugLenny How did I missed that :)

This is 4 bytes. Emotinomicon uses its own code page, meaning each emoji used is one byte.

><>, 4 3 bytes
(crossed out 4 still looks like 4)
0nx

Try It Online!
Outputs some amount of 0's.
On an empty stack n throws an error and terminates the program. x chooses a random direction for the stack pointer. This means that for each 0 printed, there is a 50% chance for the program to exit.

Oh, 0xn didn't work because it pushes two zeros to begin with. Both 0nx and xn0 would work.

I realised that - if go left first time, end up with 0 printed and 0 on the stack. The same happens for right, meaning that that program was deterministicly infinitely 0 output

@BlueEyedBeast This is a nice one, my version differs a little bit but same bytes; "ox

Mathematica, 6 bytes
Date[]

Pretty self-explanatory. (This function was superseded by DateList[] in later versions, but Date[] still runs.)
For 8 bytes one can also use Random[] (itself a legacy function).

For 10 characters, you can us $ProcessID.

Aha, nice idea! The 7-byte $System is the shortest one I could find.

Shorter: Now.

MATL, 1 byte
r

Uniform random number generator between 0 and 1. The seed is randomly set for each execution of the program. Try it online!

Same exact solution and explanation works in Pip.

PHP, 12 bytes
<?=uniqid();

Outputs a unique ID 583f4da627ee3 based on the current time in microseconds. ↑

<?=time(); <-- 10 bytes.

@IsmaelMiguel uniqid() is 1'000'000  times more undetermined than time() ;)

I'm not saying the oposite. But proposing another answer. You're free to pick that one.

@IsmaelMiguel someone else gave the same answer already...

Borland C on Windows, 12 bytes
m(){puts();}

I rewrote it because they said it's possible to use one function.
The compiler doesn't check the argument so it compiles it; but puts sees an unknown address and begins to print what that address points to until it finds the byte 0x00. It would not work if that address was out of memory, but here it prints something.

This doesn't give nondeterministic output, it just segfaults every time.

Alternatively, if you get something other than a segfault, what compiler ??

@cat it is one Borland C compiler + Windows7 Os. In how I see: above code gets the address top of stack (where in this case there is the address to return in function main() )and read from that address inside main space code... So it depend to compiler output. But I don't know 100% ... It is possible code space is not readable in your Os and from this => seg fault

I've edited your answer to include more information about the environment

Thanks, for doing something better why not "main(){printf("%p");}" I count 20 characters; this would be portable and would print the top of the stack address (if I see right)

Yeah, that also seems to work with GCC although a byte longer

@RosLuP: It would just print whatever garbage was in stack memory (or in the second arg-passing register, for x86-64 and most RISC calling conventions that pass the first few args in registers).  It would not print the address of the stack.  In x86-64, it would be somewhat likely to print argv, since the compiler would probably call printf with main's second arg still in that register.  That's exactly what happens with gcc6.2 targeting Linux: See the source+asm on the Godbolt compiler explorer: main doesn't touch RSI before call printf.

@RosLuP: argv is on the stack, but not at the very top.  Its address is affected by stack ASLR, though, so that works.  This would work less well with -m32.  You'd probably always get zero, since main has to keep the stack aligned so the stack slot above the format string may be fresh stack memory that has never been touched (and is probably always zero, since the kernel avoids info leaks by zeroing pages instead of giving user-space pages full of old data).

C89 with GCC/Clang, 20 bytes
The other C solution just segfaults every time when built with GCC or Clang. This, though.
main(n){puts(&n+1);}

Which looks like:
$ for _ in `seq 1 50`; do ./test_89; done
���z�U
�VW��U
�F��U
�v�f2V
��FV
���*=V
�6���U
�20wU
��
�+V
�6
   �U
��V�uU
�v��V
���K�U
��7�qU
�6S�jU
�&�WU
��wV
��6l�U
���U
�F�ߨU
�f���U
���s7V
�f��?V
��;B�U
�;��U
��GV
�� ��U
�vKV
�V?]wU
�����U
��.�U
�v"�XU
��uhpU
��LD�U
�����U
�6X�U
��M�.V
�69��U
��ԤV
���U
����U
�vx4.V
�֝+xU
�F��U
�֤BQV
��#�U
���1^U
����sU
��4�U
��AݗU

Quite a lot of unprintable junk but it's nondeterministic!

why "main(n){puts(&n+1);}" and not "main(n){puts(&n);}"?

@RosLuP Your second option, which seems obvious to the casual observer, gives the byte at the value of n (when n is 1, putsing its address gives 1, and when n is 2, putsing its address gives 2). Adding 1 to the address of n, which should point to a 4-byte wide int, gives a junk address with a junk value stored there with a very certain number of bytes until the next NUL byte. This behaviour is reproducible between GCC and Clang and completely beyond me. I think I'll go ask on StackOverflow.

i read "puts(&n)" in this way: it give to puts the address of n, suppose that n=0x01020304  puts would print converted in chars 04 03 02 01 or reverse of that

Remember your n is still initialized with what's normally called argc which is 0 in your general test case, so with &n, puts gets a quite deterministic pointer to a '\0' byte resulting in an empty string (assuming pointer size == integer size and all that stuff). &n+1 however is the address of what's normally called argv (at least on ABIs that pass parameters on the stack in reverse order instead of registers, and with a stack that grows from high to low addresses), which, assuming ASLR, should be a different pointer every time.

@GuntramBlohm You're right and that's very interesting, although for me pointers are 8 bytes and ints are 4 bytes.

INTERCAL, 0 2 bytes (0+2 for command flag)

Try it online! (I don't know if the TiO compiler reproduces this functionality correctly)
This is not a valid INTERCAL program, so attempting to run it gives Error 778 - UNEXPLAINED COMPILER BUG. However, when INTERCAL is run without the -b command flag, there is a small chance that it doesn't run and throws Error 774 - RANDOM COMPILER BUG. So if errors count as output for this challenge, then INTERCAL might actually be good for something!
INTERCAL, 17 bytes
DO %9 READ OUT #5

Try it online!
This is a more standard approach. It has 9% chance of printing V before terminating (with an error, but it gives the output, so who cares?)

Compiler flags have to be included in the byte count. See meta post.

@mbomb007 It doesn't use any compiler flags--that's the whole point. The "RANDOM COMPILER BUG" occurs when a program is run without the -b flag.

Any difference from the standard flags counts. So if removing the flag is the difference, that's a one-byte difference.

@mbomb007, although any sensible person would run the INTERCAL compiler with the -b option, a sensible person wouldn't be using INTERCAL in the first place.

Knight, 2 bytes
`R

Try it online!
`   Run as a shell command:
R   A random integer

The non-deterministic output is to stderr. The C interpreter implicitly converts the number to string and tries to run it as a shell command. With very high chance (if not 100%), such a command or executable does not exist in PATH, and an error message that looks like sh: <some random number>: command not found is printed to stderr.
This is shorter than the straightforward O R which prints the random number to stdout.

Jelly, 2 bytes
9X

Idk if this works. I've never done anything in jelly before, and I'm on my phone right now.
Int from 0 to 9.

Prints 09 every time for me. 9X works though

@ETHproductions Thanks. That was my original answer, I edited because I thought it didn't work. :/ I can't test things on my phone, so I had to go with what looked right from never using the language before.

It's [1, 9], not [0, 9]. Also, you can do ⁹X to do [1, 256] for the same bytecount.

Japt, 1 byte
Ð

Test it online!
How it works
When Japt is compiled to JavaScript, it replaces Ð with new Date(. The close-paren is automatically added by the interpreter, and the result of the last expression is automatically printed, so this prints the current date/time.
An alternate solution would be Mr, which uses Math.random. Japt also has the variable K set to Date (no clue why I did that, it's almost entirely useless), which I guess makes K a valid function entry.

C#, 36 22 bytes
a=()=>a.GetHashCode();

Yay.

Why the braces and the return? Just make it ()=>Environment.TickCount;

@Dennis_E Yeah I didn't know you could do it like that for one liners, thanks!

You beat the javas :[ Have an upvote. (verbose language users like us gotta stick together)

@Poke :D I'm trying to figure out if there's an even shorter way, but so far most of the other things for the function don't return different things each run.  Although doing a.Target returns nondeterministic+<>c__DisplayClass0_0 which has 0_0 in it, which is cool.

Wouldn't DateTime.Now also fit the requirements? It produces different output at different times and is shorter than Environment.TickCOunt() or a.GetHashCode().

@Snowfire ()=>System.DateTime.Now; is 2 bytes longer unfortunately, but yes it would work if you didn't have to include System.

@Yodle Oh yes, of course. I didn't think about that, my fault.

Java2K, 9 bytes
I don't recommend trying to write an approximation of a deterministic program in this language.
11 6/*/_\

This function has a 90% chance to return 1, otherwise it will return a random number. 11 6 is the name of the division function. A function is called like <name>/<arg0>/<arg1>\. Basicaly every function returns the "correct" result 90% of the time, or else a random number.

The token * is replaced by a random number, say 203. The _ token is replaced by the previous argument, i.e. 203. So, this function will divide 203 by 203 which has (see below) a 90% chance of returning 1.

C++, 26 19 Bytes
std::cout<<new int;

Returns a different memory address each time it's run

What does the * do?

@Pavel int* means a pointer to an integer.

Isn't this just a snippet? A program would need a main function...

Minecraft, 2 bytes
/r

Must be written into chat when playing on multiplayer servers. Will throw an error if you hadn't messaged (/tell) anybody recently. Otherwise, shows both players a random message.
Note: I'm not really sure if this is a legit solution :)
Minecraft, 4 bytes (+2 blocks)
help

Ties with another Minecraft answer from @Pavel
This is based on Minecraft's Easter egg:

When you type help or /help in a Command block, a random message starting with "Searge says:" is displayed, for example "Searge says: Ask for help on twitter". Here is a full list of messages.

/r is not a Minecraft command. It only exists on servers which implement it, usually with Bukkit/Spigot/Paper plugins.

C, 5 bytes
main;

Try it online!

Julia, 4 bytes
rand

Try it online!
time

Try it online!

Cubix, 3 bytes (non-competing)
@OD

Outputs a random positive number of zeroes. Non-competing because I added D just a few minutes ago. Before it was added, there was absolutely no way to randomize anything in Cubix.
Test it online!
How it works
Before the code is run, it's padded with no-ops . and formed into a cube net. Here's what the net for this particular program looks like:
  @
O D . .
  .

Now the code is run, starting on the left-most face and heading to the right.
First, O outputs the top item on the stack as a number. At the beginning of the program, the stack is an infinite fount of zeroes, so this prints 0.
Next, D sends the IP (instruction pointer) in a random direction: possibly up to the @ which ends the program, and possibly back to the O which prints another 0. This continues until whenever the IP hits the @.
@DO and OD@ also work, each printing zero or more zeroes.

Kotlin script (.kts), 12 bytes
print(Any())
Any is a compile-time time wrapper for Object, default toString() of any object is class name@hashcode. Probably the shortest solution that runs on the JVM.
If .kts is cheating:
18 bytes: fun a()="${Any()}" (forgot functions are a valid answer)
38 bytes: fun main(a:Array<String>)=print(Any())

Trying this on my OpenJDK JRE with a freshly downloaded kotlinc 1.0.5-2 repeatably outputs java.lang.Object@5bc1903. Doesn't seem too nondeterministic?

Hm, didn't think of that - is it still a valid answer if it's different on every machine? Default hashcode impl. uses the internal memory address of the object IIRC.

Just out of curiosity, what does it output on your machine?

java.lang.Object@21471ca8 but it seems to vary between IDE restarts and even how I name the source file. Makes sense, as the hashcode is literally just the memory address of the object.

x86/amd64 machine language (Pentium or higher), 3 bytes
0:       0f 31                   rdtsc
2:       c3                      retq

This uses the RDTSC instruction that may not be available on older processors. To test, try the following C program on Linux x86/amd64
#include <stdio.h>
int main(){
  for( int i = 0; i < 10; i++ ) {
    printf( "%d\n", ((int(*)())"\x0f\x31\xc3")() );
  }
}

Or try it on Ideone.

To clarify how the value is returned; RDTSC loads the most significant 32 bits into edx, and the least significant 32 bits into eax. The convention for returns in this matchine code is that an int-sized return value is stored in eax, so the function's return value is suitably nondeterministic.

PHP, 10 Byte
<?=time();

This prints the current Unix time which – of course – isn't random but changes when you call the program several times. The output I just got is 1480548602.

Welcome to PPCG! Nice answer, by the way.

APL, 2 bytes
?9

This uses APL's roll (?) operator. The program prints a pseudo-random number between 1 and 9.

Also works in J.

Looks deterministic to me, except if ⎕RL≡⍬2 or after executing ⎕RL←0. A safer bet is ⎕TS or ⎕AI.

Update: Your code has now become non-deterministic, as the default has become to ask the OS for a random number. Try it online!

PHP 10 bytes
<?=rand();

Prints a random number between 0 and getrandmax(). Which may vary based on what computer it's run on.

Lua, 9 bytes
print({})

Outputs the internal address of the Lua table object:
table: 0x2370ab0

If you're running from the interactive interpreter, you can use just 3 bytes:
> ={}
table: 0x23719c0

C, 19
f(a,b){putchar(b);}

In C the second declared variable in a function's arguments is random based on memory. Assuming the arguments were not actually declared, i.e. you just called f();.
So this function can be simply called with no input-arguments. That is, just: f(); and the output will be a random character.
Try it online! (Note: output might be an unprintable character, run the program a few times to see variation, you should get more printable characters than non-printable characters)

C (gcc), 18 bytes
f(){printf("%d");}

This one may be difficult to test since TIO will give you a cache hit. Just add some whitespace and try it again.
Try it online!

Taxi, 222 220 218 bytes
Go to Heisenberg's:w 1 r, 3 r, 1 l.Pickup a passenger going to The Babelfishery.Go to The Babelfishery:s 1 r, 1 l.Pickup a passenger going to Post Office.Go to Post Office:n, 1 l, 1 r.Go to Taxi Garage:n 1 r, 1 l, 1 r.

Prints a random number. The spec does not give any details on what number should be. The last statement can be omitted (producing 184 bytes) if you don't mind the code giving an error after printing the output.
Try it online!

Can you link to the language, since this is not a well-known one?

Retina, 3 bytes
?&`

Try it online!
Yay, Retina can finally compete in challenges that require randomness! \o/
Explanation
?& is a compound stage which executes its child stage with a 50% probability. That child stage is itself a Count stage, which counts the number of empty matches in the empty input (1). So if the child stage is run, the result is 1, if it isn't, then the empty input remains unchanged and we get an empty string.
A fun alternative for the same byte count would be:
?+`

Try it online!
This one uses a random loop (which uses a coin toss before each iteration to decide whether to continue). This one has a 50% chance of printing an empty string, 25% of printing 1 (one iteration) and a 25% chance of printing 2 (two or more iterations).

Wumpus, 4 bytes
UFO@

Try it online!
Outputs a uniformly random choice of 2, 5 or 8.
Explanation
Apart from a regular stack, Wumpus also has 20 registers which are arranged around the faces of an icosahedron. You can imagine the icosahedron as a d20 resting on a table: the face touching the table is the "active" face (i.e. the register that can currently be interacted with). Also, every face has an index from 1 to 20. Initially, the active face is 1 and the three adjacent faces are 2, 5 and 8 (see the README in the Wumpus repo for the full net).
U   Randomly tip the icosahedron onto one of the three adjacent faces, i.e.
    change the active faces to either 2, 5 or 8.
F   Push the index of the currently active face.
O   Output as a decimal integer.
@   Terminate the program.

Alternatively:
DFO@

This one completely randomises the orientation of the icosahedron, so it prints a random number from 1 to 20, inclusive.

Little-known fact: This works in Mathematica too! The code reads as UFO at and so it grabs the location of the nearest UFO and prints it, something which is obviously non-deterministic.

Lost, 7 bytes
@%"
///

Try it online!
Since Lost starts the pointer in a random place facing a random direction, it's refreshing not making the output deterministic for once. I think this is the optimal solution since you need the @ and % in order to end the program, the " to push stuff to the stack at random, and the /// to avoid infinite loops.

The challenge does not require the program to halt.  Thus @% alone will work.  This either loops forever outputting nothing or halts and outputs a newline.

Intercept 1.1, 37 bytes

Prints newlines to the terminal. You'll probably have to leave this one overnight, as there is a delay of 5-15 minutes (it's random!) between each newline. Note that while you can determine what is being printed, you can't determine how often it's being printed.

Input is marked with a >>. The command prompt is the empty >>.

Assuming a system with only TZ_INFECT installed...

>> malware bm bitminer
creating bm (bitminer)
... wait a minute ...

finished creating bm (bitminer)
>> software install 1
Success
bm installed

...wait...
(newlines)

>>

Note that I'm using a custom client that prefixes [BROADCAST] to all broadcast events.
How???
TZ_INFECT is Intercept's malware generator. We can generate a bitminer by running malware <name> bitminer. This will create a new piece of software with the given name of type bitminer

We then install the bitminer: software install <index>, where index is the 0-based index of the software as given by software list. This is why I made sure the only piece of software on the system was the malware generator. This places our new bitminer at index 1.

There is a bug in the implementation of bitminer that results in an empty broadcast event to be sent to the client whenever bits are generated. Since bits are generated at random intervals, the broadcasts are sent at random intervals. Voilia, non-deterministic output!
Note: the newlines are harder to detect using the official game client, but you can see them by running a command and watching the newlines slowly push the resulting output off the screen.
Screenshots coming in a few hours while I wait for the output.
After 20 minutes (the [BROADCAST] is a newline):

After 2 days:

PARI/GP, 2 bytes
\s
Attempt This Online!
\s prints the state of the PARI stack and heap, which is non-deterministic.
Example output:
 Top : 7fadf82bd000   Bottom : 7fadf7b1be00   Current stack : 7fadf82bcfb8
 Used :                         9  long words  (0 K)
 Available :                    999991  long words  (7808 K)
 Occupation of the PARI stack :   0.00 percent
 1 objects on heap occupy 9 long words

 10 variable names used (10 user + 0 private) out of 65535

JavaScript (full program), 12 bytes
throw  is much smaller than console.log() or process.stdout.write(), it does halt execution, but that's not an issue.
throw Date()

eval(Date()) another fun 12 byter, but idk if its valid :P

Brachylog, 3 bytes
9$?

Try it online!
Explanation
$? is the random number predicate. When given an integer as input (here, 9), its output will be unified with an integer between 0 and 9 uniformely at random.

Randwork, 11 bytes
Uses the Randwork+ instruction set, because that's the only specification with an existing interpreter.
Do anything

This statement executes a random instruction from the instruction set. There is a 7/28 (25%) chance of non-empty output. I calculated the probability by viewing the source code of the interpreter. The instructions that can produce output are:
Write the ASCII equivalence of a random byte
Beep
Write the ASCII equivalence of byte 1
Write the ASCII equivalence of byte 2
Write the ASCII equivalence of byte 3
Write the ASCII equivalence of byte 4
Display the Hello World message

Bytes 1-4 have not been set, so output of any of them will be a NUL byte. The 7 possibilities of non-empty output are (in corresponding order):
\x?? - a random byte
\x07 - the bell character (beep)
\x00 - NUL
\x00
\x00
\x00
Hello world

TI-83 Hex Assembly, 4 bytes
PROGRAM:ND
:AsmPrgm
:EF0A45
:C9

Run it with Asm(PrgmND). Calls the _PutS system library call (0x450a), but because it doesn't set HL it will print whatever HL pointed to last, usually a lot of garbage text.
I count this as 4 bytes, because each pair of hex digits is one byte.

CJam, 2 bytes
et

You can rely on the program being run at a different (unknown) time each execution.

Yeah, that one. et is a single built-in that returns the array [YYYY M D h m s ms W Z], printed as YYYYMDhmsmsWZ.

Ruby, 14 bytes
p ?..object_id

Returns object id of the string '.'

TI-Basic, 2 bytes
Very similar to this answer. The getTime token is two bytes and is located at EF 0A.
getTime

rand is 1 byte.

@bb94 "A pseudo-random number generator that always has the same seed does not count."

C#, 72 bytes
It's alot longer than the other C# answer but hey, different approach and fully functioning console application. Why not?
Golfed
using System;class P{static void Main(){Console.Write(Guid.NewGuid());}}

Ungolfed
using System;
class P
{
    static void Main()
    {
        Console.Write(Guid.NewGuid()); //Create a new random GUID and print it
    }
}

Braingolf, 2 bytes
2r

Pushes 2 to the stack, then pushes a random number between 0 and the last item on the stack (2), ie randomly selects either 0 or 1. Implicitly prints the last item on the stack (the random number)

BrainFlump, 5 bytes
:+:;.

Try it online!
Outputs either a NUL or SOH character
Explanation
BrainFlump is the latest iteration of BrainFl* languages having different memory models (BrainFlak is a stack, BrainFlueue is a queue, etc)
In BrainFlump, memory consists of a Cell and a Dump.
The Cell is a single numerical value, and the Dump is an unordered collection of numerical values.
When the program starts, the Dump is empty, and the Cell is 0.
:      Push the Cell's value to the Dump
 +     Increment the Cell
  :    Push the Cell's value to the Dump
   ;   Pop a value from the Dump (randomly) to the Cell
    .  Print the Cell's value as an ASCII character
       The Cell's value will either be 0 or 1, and as it's printed as an
       ASCII character, this results in NUL or SOH

Rust, 28 bytes
fn main(){print!("{:p}",&1)}

Try it online!
Takes a reference to a temporary 1 and prints the address.

Rust, 17 bytes
fn main(){0-1u8;}

Try it online! (requires the -A const_err compiler flag)
This is a bit sketchier, and I'm not sure whether it counts. The non-deterministic output is to STDERR, and the non-determinism arises only based on the value of an environment variable.
This program attempts to compute 0 - 1, where both integers have type u8 (the default is i32, which won't cause an overflow because it's signed). By default, Rust compiles the file in debug mode, in which arithmetic overflow causes a panic instead of wrapping. When a program panics, it will print a stack trace if the environment variable RUST_BACKTRACE is set to 1, hence the non-determinism.

Keg, 1 byte
~

This pushes a random number onto the stack and then outputs that number by default.

Polyglots with Volatile

Volatile doesn't have implicit output.

><> (Fish), 4 bytes
1n0x

Try it
Prints 1, then prints 0 or 1 randomly, as the x will cause the instruction pointer to move either left or right.

3 bytes. Prints 1 a random number of times. This might not be right, never used ><> before.

@noodleman Note that your code smells fishy when run.

C (gcc), 24 bytes
main(){printf("%s",.0);}

My favourite, since the warning messages in stderr also get corrupted slightly.
Try it online!

Uiua, 1 byte
⚂

Try it!
Prints a random float from 0 to 1 each time the program is run.

I like the language's glyphs. Very nice! It's also really cool how you can hover over a glyph for more information.

Python, 11 bytes
1/(id(2)%3)

Attempt This Online!
Sometimes it outputs nothing, sometimes it outputs a ZeroDivisionError message.
Matches @Blue's print id(1), but that needs parentheses in Python 3, making it 12 bytes there.

Wirefunge - 2 bytes
¿>

¿ - Randomized output every iteration
> - When it rises, puts 1-8 on stdout

Clojure, 4 bytes
rand

The obvious answer. rand is a core function that returns a floating-point number between 0 and 1 (exclusive) when called without any arguments.
I don't think it gets any shorter than this in Clojure.

Perl 6, 13 bytes
put Bool.pick

Marbelous, 5 bytes
FF
??

Prints a single random byte. FF creates a marble with value 255. That marble falls through the random number generator ?? which replaces the marble's value with a random value between 0 and 255 inclusive. When the marble falls off the bottom of the board, it gets printed to STDOUT as a byte.

R, 7 bytes
The Student t Distribution
rt(1,1)

The Exponential Distribution
rexp(1)

Two options how to generate a random number with the shortest code.

ForceLang, 11 bytes
random.rand

A function that, when called with no arguments, produces a random rational of the form n/2^80, where n is an integer on [0,2^80-1].
(If you give it a positive integer argument m [which must be strictly less than 65536, not that you'll ever reasonably need to go nearly that high] it will produce a random rational of the form n/2^m, where n is an integer on[0,2^m-1])

Thue, 17 bytes
a::=
a::=~1
::=
a

Randomly prints either nothing, or the digit 1.

T-SQL 15 bytes
print getdate()

Minkolang v1.5, 4 bytes
lhN.

l pushes 10. h pushes a random integer from 0 to 10, N outputs it and . ends program. Simple, eh?
Try it online!

Shell, 2 bytes
ps
Explain: the PIDs returned are not going to be the same each time.

SmileBASIC, 6 bytes
?TIME$

Prints the current time.

tcl, 3
Must be run on an interactive shell
pwd

Gets the current working directory.
Or alternatively
pid

Gets the current process identifier
Demo:
Go to https://www.tutorialspoint.com/execute_tcl_online.php and in the green area, type
tclsh

Then type
pwd

and
pid

Alice, 4 bytes
2Uo@

Try it online!
Prints a single byte, either 0x00 or 0x01, with 50% probability each.
2    Push 2.
U    Get a random integer in [0,1].
o    Output that integer as a byte.
@    Terminate the program.

Fourier, 3 bytes
9ro

Outputs a random number from 0 to 9.
Try it online!

Add++, 6 bytes
The most random I could get for 6 bytes
+9  Set the accumulator to 9
R   Set the accumulator to a random integer between 0 and 9
O   Output the result

I could change R to R-9 to double the randomness for 2 extra bytes.

Chip, 2 + 3 = 5 bytes
+3 bytes for -w
g?

Gives infinite-length output. Each byte of output is independent, and is either NUL \x00 or '@' \x40.
There are eight equivalent Chip programs that are like this, from a? (which prints \x00 or \x01) to h? (which prints \x00 or \x80). g? is just the most visible option.
For each of these programs, the letter a through h defines the index of a bit of the output, and ? produces a random value to set it to. The two elements may be provided in any order; they must only touch each other on a 2D plane.
Try it online! The TIO includes the -cN flag. This flag is not necessary, but cuts off the program after N bytes. Try without the cutoff if you wish, but TIO's limit is at 128KiB.

Flobnar, 5 4 bytes
-1 byte thanks to @JoKing
0?.@

Try it online!

Ink, 5 bytes
{~a|}

Try it online!
Either outputs "a" or nothing.

Perl 6, 7 bytes
say now

about now

Japt, 1 byte
K

Try it online!

Welcome to Japt! :) (and the site) If you weren't aware, there's an open bounty running for Japt solutions.

Trigger, 14 bytes
ABAAA AAB    B

Try it online!
A                NOT the value of the A trigger, making it one
 B               NOT B
  AAA            Print "A"
      AAB        Go to the nearest B in the program. If it is the same distance, it picks it randomly. This can go to the NOT B command or go to the next B command, running the print A or ending the program, respectively.

Pxem (Filename: 5 bytes; Contents: 0 byte)

Filename: x.r.n
File content is empty.

Explaination

x pushes an ascii code of the character (120) as a signed integer.
.r pops 120 to push back one of 0-119.
.n pops the integer to output as a decimal.

C (gcc), 63 54 bytes
main(){int a;for(char*b;a=3;b++)for(;a;a--)printf(b);}

Try it online!
I can't even remember how this one works.
Down to 54 bytes by 2x-1.
Puts instead of printf creates triangle patterns instead, but I think they're boring.

54 bytes

.mmo (MMIX executable), 128 120 bytes
(xxd --jelly)
00000000: 98090100 98010001 00000100 e3ff0130  Ƭµ¢¡Ƭ¢¡¢¡¡¢¡ẉ”¢0
00000010: 00000103 e3ff0140 00000303 e3ff0140  ¡¡¢¤ẉ”¢@¡¡¤¤ẉ”¢@
00000020: e0012000 87000100 ef00a0a0 eb004040  ṭ¢ ¡⁷¡¢¡ṁ¡ɦɦḟ¡@@
00000030: a7000100 00000601 98020008 00000150  ʂ¡¢¡¡¡©¢Ƭ£¡®¡¡¢P
00000040: 00000000 00000002 20000000 98020008  ¡¡¡¡¡¡¡£ ¡¡¡Ƭ£¡®
00000050: 00000002 2f646576 2f72616e 646f6d00  ¡¡¡£/dev/random¡
00000060: 980a00ff 00000000 00000100 980b0000  Ƭ½¡”¡¡¡¡¡¡¢¡Ƭ¿¡¡
00000070: 00000000 980c0001                    ¡¡¡¡Ƭ€¡¢

Outputs two random characters in range @-_ to stdout.
Explanation
98090100 lop_pre 1,0                    (preamble, mmo v1, 0 tetras)
98010001 lop_loc 0,1                    (next tetra says where to load)
00000100 (256)
E3FF0130  SETL  $255,random
00000103  TRAP  0,Fopen,3               (open fd 3 for bin read from /dev/random)
E3FF0140  SETL  $255,data
00000303  TRAP  0,Fread,3               (read two bytes of data)
E3FF0140  SETL  $255,data               (set up $255 for writing it back out)
E0012000  SETH  $1,#2000                (we know where the data is)
87000100  LDWU  $0,$1,0                 (read those bytes from memory)
EF00A0A0  ANDNL $0,#A0A0                (ensure C0 control or @-_)
EB004040  ORL   $0,#4040                (ensure @-_)
A7000100  STWU  $0,$1,0                 (write them back to memory)
00000601  TRAP  0,Fwrite,StdOut         (write two bytes out)
98020008 lop_skip 8                     (encodes the next two tetras)
          TRAP  0,Halt,0                (halt)
         random OCTA fname              (argument 1 of fopen: ptr to filename)
00000150  (cont)
00000000  OCTA BinaryRead               (argument 2: mode)
00000002  (cont)
20000000 data OCTA Data_Segment         (argument 1 of fread/fwrite: buffer addr)
98020008 lop_skip 8                     (encodes cont + start of next)
          OCTA 2                        (argument 2: amount)
00000002  (cont)
2F646576 fname BYTE "/dev"
2F72616E  BYTE "/ran"
646F6D00  BYTE "dom\0"
980A00FF lop_post 255                   (one global register)
00000000
00000100                                (start at 0x100)
980B0000 lop_stab                       (symbol table)
00000000                                (no symbols)
980C0001 lop_end 1                      (one symtab tetra)

Basically, this reads two characters from /dev/random, then, after a bit of munging to ensure they're printable, dumps them to stdout.
I also used lop_skip to cut two tetras from the code.

EmojiCoder, 44 bytes

✋

Try it online!
Push some random integer between 0 to 65 (chosen randomly) and output top of stack.

Barrel, 2 bytes
|n

Gets a random integer with | and prints it as a number with n.

SNOBOL4 (CSNOBOL4), 19 bytes
 output =date()
end

Are there any other ways to obtain a random value in this language?
Try it online!

APOL, 1 byte
≀
This is just the random float instruction, the result of which is implicitly printed.

Knight, 3 bytes
O R

Try it online!
Not a complicated answer.

SNOBOL4 (CSNOBOL4), 15 14 bytes
I got a hint from user62131's sh + procps answer.
 exit('w')
end

Try it online!

Vyxal, 2 bytes
9℅

Try it online!
Outputs a random integer from 0 to 9.

use the H flag for -1

Fortran (GFortran), 12 bytes
print*,i
end

Try it online!  Fortran has a bunch of "random" functions, ironically all deterministic, like RAND, needing all kinds of complicated seeds to make a mathematically pure random distribution. But in this code I just grab an uninitialized integer i, and print whatever is in that memory location.

Swift, 8 bytes
[][0]

Try it online!
Literally all this does is create an empty array (which the compiler miraculously infers to be of type [Any]) and attempts to access its first element, which obviously does not exist because the array is empty. Unlike some other languages I can name, Swift actually makes sure you don't try to use things that don't exist, and so this subscript calls fatalError(_:file:line:), which (among other, more useful things) prints out memory addresses, thereby meeting the criteria for non-determinism.

Shellscript (as implemented by ttyrec), 0 bytes
OK, here's a version of this idea that uses an interpreter that can actually be programmed with.
The ttyrec command by default just passes everything it sees on standard input to a shell, and thus obeys our definition of a programming language (it's Turing-complete, because bash is; it's basically just an alternate front-end to bash, and so is basically a shellscript interpreter that  can be used to program with). However, it also creates a file ttyrecord containing a recording of the shell's output, and that file starts with the current time, in binary (and is also affected in some ways by the system's CPU and swapping load, as it tries to separate the output into frames). Thus, it produces a file with nondeterministic content as output.

I'm not using any commands. Shellscript is Turing-complete. At least one implementation of it produces nondeterministic output in addition to running the program given, thus you get the output you want even with no commands. Languages are defined by the interpreter here.

(the above was in reply to a since-deleted comment that this wasn't valid due to not using commands)

JavaScript, 8 bytes
Date.now

This evaluates to a function whose return value is nondeterministic, and conveniently doesn't actually need to be bound to anything specific to work.

Basically, this is the same as the Date answer.

@IsmaelMiguel I did have the idea of returning a builtin first; I just returned the wrong builtin.

Batch, 6 4 bytes
time

Needs to be run with <nul which is apparently permissible.

This is what I was referring to: http://meta.codegolf.stackexchange.com/a/7172/34718

@mbomb007 Thanks, I wasn't aware of that.

Swift 3, 13 bytes
print(Date())

QBIC, 4 bytes
?_r|

This generates and prints a random number between 0 and 10. QBIC uses the classical RANDOMIZE TIMER at the start of execution to set the RNG.

Actually, 1 byte
G

Try it online!
Good old rand(). In Python 3, 2500 random bits from the system's cryptographically-secure randomness source (getrandom() for Linux, /dev/urandom for *NIX, or CryptGenRandom for Windows) are used for the seed, falling back on the current UNIX time (as precisely as possible for the given platform - at minimum, 1-second precision) if such a source of randomness is not available.

Microscript II, 1 byte
R

Produces a random 64-bit float on [0,1).
Another one-byte solution would be C, which produces a new continuation object, whose timestamp (which the reference implementation includes in its string representation) will be nondeterministic.

Microscript, 2 bytes
r9
Produces a random integer on [0,8]

Mouse2002, 7 bytes
&RAND !

ASP VBScript, 43 bytes
<%=createobject("scriptlet.typelib").guid%>

Outputs a unique ID like {52076580-3151-4EE7-AAFD-D975CD141EE4} based on current date/time. ↑

HSPAL, 18 bytes
26FFFF
400000
120000

Prints a random 16-bit integer.

Math++, 5 bytes
$rand

Produces a random 64-bit float

C, 22 bytes
f(){putchar(time(0));}

OP indicates in the comments that a full program is not needed and a function will suffice. Might I suggest replacing main with f to save 3 bytes?

yes i replace main with f... thank you and a good day

Ceylon (on JVM), 22 bytes
()=>system.nanoseconds

This turned out surprisingly difficult.
At first I thought I cold use the .hash attribute of all objects (corresponds to Java's .hashCode() when running in the JVM), but it turns out that most objects I can write in a literal way have their .hash attribute overridden, returning a deterministic value.
For example, [] (the empty tuple) or {} (the empty iterable) are both the same object, and which inherits List.hash, which returns 1 in this case. For strings (like ""), characters (c) or numbers (like 3 or 2.5) of course the hash needs to be deterministic, same for true and false (0, 99, 3, 1074003968, 1231, 1237, respectively).
The base class Basic, which has the Java-like hash code implementation (assumedly based on the memory address?) is abstract, so I can't use Basic().hash (nor Object().hash – also abstract, and here even the method is not implemented). So let's create a new class, create an instance and take its hash code?
class E() {}
function f() => E().hash;
shared void run() {
    print(f());
}

This always outputs 1116094714 whenever I execute this program. (Adding other statements which allocate memory before the print line changes the result – still deterministically, though.)
Ceylon also supports anonymous classes as object expressions. Those can extend classes or implement interfaces and have own code, but the most minimal variant is just object{}:
shared void run() {
    function f() => object{}.hash;
    print(f());
}

Still the same result 1116094714, though.
Another idea was to use the hash code of a class or function reference. (Those are normal objects, I thought.) But trying to use run.hash (or f.hash) gives a compiler error:

error: direct function references do not have members

We can work around this by assigning this function reference first to a value, which will create an object of a (hidden) anonymous class:
shared void run() {
    value x = run;
    value y = run;
    print([x.hash, y.hash]);
}

This prints two different values, but the same ones ([762384154, 690052870]) each time I run the program. Still deterministic.
So, using any hash code will not bring us forward (and I suppose that the other JVM answers here with .hashCode() would have the same problem on my JVM implementation). Same with printing an object with the default .string implementation based on .hash.
There is no random number facility in ceylon.language, so using either ceylon.random or Java's java.util.Random (or java.lang.Math.random()) needs an import, which increases the size more than I want to tolerate for a codegolf answer. Here is an example:
import ceylon.random { ... }
shared void run() {
    print(randomize{1,2});
}

So let's look at what we have in ceylon.language. There are four top-level objects which allow access to the environment:

operatingSystem – name, version, path/file separator, newline.
process – command line arguments, system properties, environment variables, input/output.
runtime – whether we are on JVM/JS/Dart, version info, and stuff like bit sizes. Nothing which will change between runs of the same program in the same VM.
system  – ah, here we go. Beside locale, character encoding and time zone offset we also have:

milliseconds
nanoseconds

Both will change with each call of a program, and the latter one is shorter.
So here we have an anonymous function returning different values:
() => system.nanoseconds

If we want a named function, its definition can look like this:
Object n()=>system.nanoseconds;

(It actually returns Integer, but that is one character longer than Object.)

Chip-8, 4 bytes
0xCFFF 'RND vF,FF
0xFF18 'LD ST,vF

This plays a sound for between 0 and 4.25 seconds.
The seed always starts at 0, but it updates during the display interrupt which has a tiny chance of happening before the randomizer call, I hope.

Pyt, 1 byte
ɽ

Returns a random 32-bit integer.
Also 1 byte: ɹ, ṛ.

Gol><>, 3 bytes
x1h

The 'x' is a randomizer for the direction of the pointer, the 1 pushes a 1, and the h outputs and halts.
Try it online!

You can also do Sxh to print a random float between 0 and 1

@JoKing I didn't think of that, thanks for pointing that out. that works as well. Though I don't think there is a smaller version of this

ThumbGolf, 4 bytes
Machine code:
de78 de20

Assembly:
        // Include ThumbGolf wrapper macros
        .include "thumbgolf.inc"
        .globl main
        .thumb_func
main:
        // Read random integer into r0
        rand    r0 // udf #0170
        // Print to stdout in base 10
        puti    r0 // udf #0040
        // Not required to exit, so just crash

Internally, ThumbGolf uses /dev/urandom, so this is guaranteed to be nondeterministic.
Alternative version, 2 bytes
Machine code:
de21

Assembly:
        // Include ThumbGolf wrapper macros
        .include "thumbgolf.inc"
        .globl main
        .thumb_func
main:
        // print address of argv
        // printf("%i", (int)argv)
        puti    r1 // udf #0041
        // exit by crash

Prints the memory address of argv which is almost guaranteed to be dynamically allocated, and therefore, nondeterministic.
However, it is context sensitive unlike the 4 byte solution.

Non-competing status shouldn't be used nowadays. Answers in languages newer than the question are allowed, obviously considering that you don't hardcode the answer to the challenge into the language's interpreter and submit a 0-byter (or similar). That is already a standard loophole.

Also just realized; your two-byter is Þ! in Unicode. :P

05AB1E, 2 bytes
Any program matching /^[ATт₁-₆]Ω|ž[a-g]$/ will give nondeterministic output. There are, of course, infinitely many programs that can do this, but these are all the two-byters. Unfortunately, I could not find a one-byter... :(
Try them online!
Explanation
The ones starting with ž are constants. The ones used here are time constants - ža, žb, žc, žd, že, žf, and žg are hours, minutes, seconds, microseconds, day, month, and year, respectively. The ones ending in Ω pick a random element (for lists), character (for strings), or digit (for integers) from top of stack. The one-byte commands that I could find that push something with more than one distinct element/character/digit were A, T, т, ₁, ₂, ₃, ₄, ₅, and ₆, which push abcdefghijklmnopqrstuvwxyz, 10, 100, 256, 26, 95, 1000, 255, and 36, respectively.

Phooey, TIO version, 4 bytes
<2$i

Try it online!
Abuses a bug to print the frame pointer.
This is because the tape does not wrap, so the tape just underflows to the stack.
<2 moves the pointer 16 bytes back, $i prints as an integer.
Very dependent on the version of the binary.
Phooey, proper version, 5 4 bytes
~t$i

Try it online!
~t stores the Unix time to the tape, and I already explained $i.

CSASM v2.2.1.2, 39 bytes
func main:
extern Random.Next
print
ret
end

CSASM has a built-in System.Random object that gets initialized to new System.Random() when CSASM.Core.Sandbox.Main(System.Reflection.MethodInfo, int, string[]) is called.
The default System.Random constructor initializes the seed to Environment.TickCount, which is different every time the executable runs.
extern Random.Next calls Random.Next() on the aforementioned object, which returns a positive int value.

Thunno, \$ 4 \log_{256}(96) \approx \$ 3 bytes
(actually 3.29 bytes but that doesn't show up on the leaderboard)
9RZw

Attempt This Online!
Outputs a random integer from 0 to 8:

9R gets range(0, 9) (i.e. [0, 1, ..., 8])
Zw gets a random element of that list

This looks like 4 bytes to me. How do you get 3.29 bytes? You realize that coded in binary, it would have to be representable in whole bits at the very least.

There is a consensus that fractional byte counts are allowed. Since Thunno uses the 96 printable ASCII characters as its codepage, the character count of every Thunno program can be multiplied by 0.82

Pip, 3 bytes
RR9

Attempt This Online!
Prints a random integer from 0 to 9

r works too ;)

Thunno 2, 2 bytes
9ɼ

Attempt This Online!
Outputs a random integer from 1 to 9.

Tamsin (Compiler), 16 bytes
main=any@'\xf0'.

Explanation
main=             # output
     any          #   read 1 utf-8 char
        @         #   from
         '\xf0'.  #   '\xf0'

The Tamsin compiler produces C code that omits out-of-bounds checks during the reading of UTF-8 characters. Consequently, upon encountering \xf0, it proceeds to read an additional three bytes beyond the string's limit which are also output.
The Tamsin interpreter (used by TIO) does not suffer from this issue (it simply throws an assertion error).

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


text:
Shortest self-avoiding path given a sequence of turns
Write a program or function which, given a non-empty sequence of right or left turns, outputs the length of the shortest self-avoiding path on a 2D lattice with those turns.
The input should be taken as a string, with each character being R or L for a right or left turn respectively.
The output should be an integer, the length of the shortest path with the given turns.
This is a gode golf - shortest code wins.
Example
Given the input
LLLLLLLLLLRRL

The shortest path is the following (starting at #):
+-+-+-+-+-+-+
|           |
+ . + +-+-+ +
|   | |   | |
+ +-+ + #-+ +
| |   |     |
+ +-+ +-+-+-+
|   |
+-+-+ . . . .

And the total length of this path is 29 (counting the -s and |s, not the +s).
Test Cases
L 2
RRRRRRRRRR 23
LRRLRLRRRRL 15
LLRRLRRRRLLL 17
LLRRRRRRLLLL 21
LLLLRLLRRLLRL 16
LRLRLRLLRLRRL 14
RLLRRRRLLRRLRL 17
RRRRLLRLLLRLRL 20
LLLLRRLRLRRRLRL 19
RRRLRRRLRRLRLRL 20

Self-avoiding even at corners (e.g., walking south on Main toward Elm and turning east onto Elm and later walking north on Main toward Elm and turning west onto Elm is a no-no)?

@msh210 yes, it can't visit the same point twice, even on a corner.

Prolog, 284 bytes
e(S,[0|X]):-e(S,X).
e([A|S],[A|X]):-S=X;e(S,X).
v(X/Y,76,Y/Z):-Z is -X.
v(X/Y,82,Z/X):-Z is -Y.
v(D,0,D).
c([],0/0-0/1,[0/0]).
c([H|T],K/L-D/E,[K/L|C]):-c(T,I/J-X/Y,C),v(X/Y,H,D/E),K is I+X,L is J+Y,\+member(K/L,C).
n(X):-X=0;n(Y),X#=Y+1.
p(S,L):-n(L),length(X,L),e([0|S],X),c(X,_,_).

This is a pretty straightforward statement of the algorithm, and fairly inefficient (not all the test cases ran in reasonable time, although most did). It works via generating all possible lengths for the output from 1 upwards (n); generating all possible sequences of left/forward/right of that length which are consistent with the input (implemented in e; the new path is called X); then checking for the first such path that's valid (c, which calls into v to handle the effects of left and right turns on the x and y deltas). The return length is the first output seen in L. (+2 penalty if you want to prevent the function returning other possible outputs for the length if you backtrack into it; it's never quite clear how Prolog's idiosyncratic function returns should be counted.)
There isn't much in the way of golfing tricks here, but there is some. n was implemented with a constraint solver because it allows more whitespace to be removed without confusing the parser; this might require GNU Prolog to be used, not sure on that. (I couldn't do the same in c as it needs to handle negative numbers.) The implementation of e is considerably less efficient than it needs to be, via matching a list in multiple ways; the more efficient e([],[]). would be six bytes longer (it'd allow the S=X; on line 2 to be removed, but that's only a gain of four compared to a loss of ten). To allow me to match coordinates and directions as a whole, or just part, I represent them as X/Y (i.e. an unevaluated AST, which can be matched on), allowing me to use infix notation.
Prolog, 256 bytes, too inefficient to easily test
Of course, because this is Prolog, many of the functions are reversible, e.g. c can be used to generate all paths from the origin to a particular coordinate pair. Additionally, c naturally generates from shortest to longest. This means that instead of asking for a minimum length explicitly, we can just get c to generate all paths that go anywhere, then look for the first one that's consistent with the input:
e(S,[0|X]):-e(S,X).
e([A|S],[A|X]):-S=X;e(S,X).
v(X/Y,76,Y/Z):-Z is -X.
v(X/Y,82,Z/X):-Z is -Y.
v(D,0,D).
c([],0/0-0/1,[0/0]).
c([H|T],K/L-D/E,[K/L|C]):-c(T,I/J-X/Y,C),v(X/Y,H,D/E),K is I+X,L is J+Y,\+member(K/L,C).
p(S,L):-c(X,_,_),length(X,L),e([0|S],X).

This has exponential performance (O(3n), where n is the output). However, I did manage to verify it on some of the smaller tests (it takes around 7 seconds to output 14, and around 20 to output 15, on my computer).

I couldn't get this to work on TIO, but I might be doing something silly.

@PeterKagey I don't know much prolog, but I think this works. For input "LRRLRLRRRRL"

Pyth, 36 bytes
ff{I.u+NYY0f>r8YlQ.C+1*M._m^.j)hCdQT

Try it online!
This is pretty slow, but it works, and it's fast enough for short inputs.
The program works by representing directions as complex units (1,-1,i,-i), and points as complex numbers. First I convert the list of turns into a list of directions, then generate all list of n steps, filter for those with at least one step between each turn, and convert the directions into a list of points visited, and check if that list is unique. I increment n in a loop until I succeed.
Map to complex numbers:
m^.j)hCdQ
m       Q    Map over the input
      Cd     Convert to ASCII codepoint
     h       Increment
 ^.j)        Raise i to that power.

Since L has ASCII codepoint 76 and R has ASCII codepoint 82, this maps L to i and R to -i.
Map to absolute directions:
+1*M._ ...
    ._      Form all prefixes
  *M        Map each to its product
+1          Add the first direction, before any turns

Form lists of n steps with at least 1 step between each turn
f>r8YlQ.C ... T
       .C     T    Form all list of T steps
f                  Filter for lists where
  r8Y              Run length encoding of list
 >   lQ            With the first len(input) removed
                   is nonempty

There should be one more movement than there are turns in the input. Each movement is in a different direction, so the run length encoding should be longer than the input.
Map to points visited:
.u+NYY0  ...
.u   Y0   Reduce the following function over
          the list of steps, starting at 0.
          Return all intermediates.
  +NY     Add the new step to the current position.

Filter on non-self-intersecting:
f{I ...
f     Filter on
  I   Invariant under
 {    Deduplication

Find the first T where this succeeds: f.

source: Stack Exchange

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

sort: votes