17
votes
Lossy or Lossless?
Jelly, 7 5 bytes
ƈƈeØA
Lossy formats return 0, lossless formats return 1.
Try it online! (permalinks in Gist)
Background
The formats we have to support have ...
13
votes
Accepted
Shortest Konami Code
05AB1E, 33 bytes (Fine on Empty Input)
Dg0Qiq}•ï“뙵yê!•36BQi7ç“+30™‹“J,
Try it online!
05AB1E, 30 26 bytes (Fails on Empty Input)
-4 thanks to Adnan
...
12
votes
11
votes
Accepted
Play the Final Fantasy Prelude
MATL (1 language), 78 77 bytes
0'!4XC@nRAxt~&'F5:ZaKeK1X"tP[AaABOlHN]0Y(_&vhYs"1875:YPE*76/@12/W*Y,E]&h1e4Y#
This uses equal temperament, ...
10
votes
9
votes
Shortest Konami Code
JavaScript (ES6), 202 200 198 bytes
Tested only on Chrome and Firefox. Uses UDLR rather than the arrow keys. Please make sure that CapsLock is off.
...
9
votes
9
votes
Accepted
Play the sound of Pi
Mathematica, 107 87 bytes
Thanks to Martin Ender for saving 20 bytes!
"t.au"~Export~Sound[SoundNote[⌊12Mod[#,10,1]/7⌋-1,.5]&/@#&@@RealDigits[Pi,10,1000]]
...
9
votes
Lossy or Lossless?
C, 82 80 32 bytes
Inspired by @Dennis' answer, this can be reduced much further:
main(){return getchar()&200^64;}
Pipe the file data to stdin. Returns 0 for ...
8
votes
Shortest Konami Code
Python 3, 55 53 bytes
-1 byte thanks to isaacg (use bitwise not to replace -10 with ~9).
-1 byte thanks to ...
8
votes
8
votes
Play the Final Fantasy Prelude
CP-1610 machine code, 125 DECLEs1=156.25 bytes
1. CP-1610 instructions are encoded with 10-bit values (0x000 to 0x3FF), known as DECLEs. Although the Intellivision is also able to work on 16-bit data, ...
7
votes
Twinkle Twinkle Little Star
Desmos, 148 116 bytes
The viewport has been manually changed to x=0 to 20, and y=0 to 12, because the audio trace feature in Desmos is affected by the viewport (the song will become distorted if the ...
7
votes
Play the Final Fantasy Prelude
JavaScript, 320 bytes
I don't golf with JavaScript much so I'm sure there's a lot of opportunities for golfing here. Should work on most browsers.
...
6
votes
Twinkle Twinkle Little Star
bash + say + gunzip, 136 bytes
say, of course, being the OS X text-to-speech command. This is... dorky. Yeah, let's go with dorky.
...
6
votes
6
votes
Play the sound of Pi
Scratch, 530 bytes
Inspired by BookOwl's answer.
Online Demonstration. Playback will begin immediately, press space to stop and reset. Click the cat to start again.
Edit: golfed down slightly. I ...
6
votes
Lossy or Lossless?
GS2, 3 bytes
◄5ì
Lossy formats return 0, lossless formats return 1.
Try it online! (permalinks in Gist)
Background
The formats we have to support have the ...
6
votes
6
votes
5
votes
Shortest Konami Code
Jelly, 33 30 29 27 bytes
ɠ⁻“UUDDLRLRBA”$¿ṛ7Ọ“¡}ʠƈ[ỵ»
Turns out, the append (ṭ) is not needed, strings are automatically ...
5
votes
5
votes
4
votes
Twinkle Twinkle Little Star
JavaScript, 194 177 176
Now that WebAudio is a thing, I thought it would be fun to write this. (Yes, I know ES6 and WebAudio came out after the challenge was posted.) Tested on Microsoft Edge.
<...
4
votes
Shortest Konami Code
><>, 132 69 64 62 bytes *><>, 84 bytes
i:1+?\0[
:1+?!\i
BA"a~/"UUDDLRLR
{v!?l/!?=
7/"+30 lives"
o<;!?l
Try it here!
This relys on the bell chime (ascii ...
4
votes
Play some of Pachelbel's Canon
Befunge, 242 bytes
The tune is written to stdout in the format of a MIDI file. You'll need to redirect that output to a .mid file in order to play the excerpt.
...
3
votes
Shortest Konami Code
AutoHotkey, 63 bytes
Input,K,L10
if(K="UUDDLRLRBA"){
MsgBox,"+30 lives"
SoundBeep
}
After running this script, it will check if the next 10 ...
3
votes
Shortest Konami Code
Petit Computer BASIC, 91 bytes
@L
WAIT 1S$=S$+CHR$(B)*!!B
B=BTRIG()IF B<1024GOTO@L
IF"xxxxxxxxxx"==S$THEN BEEP?"+30 lives
Finally a solution that ...
3
votes
Shortest Konami Code
Stacked, 41 bytes
['+30 lives'BEL+out]prompt'UUDDLRLRBA'=if
Reads input from keyboard.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
audio × 26code-golf × 23
music × 11
kolmogorov-complexity × 5
popularity-contest × 2
classification × 2
morse × 2
code-challenge × 1
decision-problem × 1
random × 1
parsing × 1
pi × 1
keyboard × 1
test-battery × 1
encoding × 1