Shortest code to produce non-deterministic output
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]
Java 7, 33 30 27 bytes
int a(){return hashCode();}
Because Java.
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.