Pitch dark (Earth Hour remembrance)

Assembly (bootloader) 131 chars / 512 bytes compiled (actually smaller, but bootsector must be 512 bytes long.)

It is a simple boot loader. When computer starts, BIOS will load it from disk (floppy). Then it enters into graphics mode and just hangs. When user presses the power button, program will end and computer will enter to mode where is was before running program.

Tested with VirtualBox.

It will compile with nasm:

nasm -f bin file.asm -o start.img

Source code:

[BITS 16]
[ORG 0x7C00]
cli
mov AX,0x0
mov SS,AX
mov SP,0x9000
sti
mov AH,0x0
mov AL,0x13
int 0x10
times 510 - ($-$$) db 0
dw 0xAA55

Bash, 28 or 12

Assuming default installation of Ubuntu 12.04 LTS.

gnome-screensaver-command -a

Automatically starts the screensaver, which is a black screen by default.

Edit: As suggested by @Glenn Randers-Pehrson, here's one with 12 bytes

/*/*/gn*d -a

Note that this may not work if you have another file on your system that satisfies this name, say /tmp/1/gnd. But it's code-golf, who cares?


Check out my other bash answer if you don't use Gnome screensaver!


QBASIC (31)

SCREEN 7
WHILE INKEY$=""
WEND

Tags:

Code Golf