Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 62670

Code-golf is a competition to solve a particular problem in the fewest bytes of source code.

18 votes

Shortest program that continuously allocates memory

><> (Fish), 1 byte 0 Try it here! 0 can actually be substituted for any hexadecimal number 1-f. Explanation 0 in ><> simply makes a 1x1 codebox for the fish to swim in. It constantly adds a 0 on …
redstarcoder's user avatar
  • 1,811
3 votes

Dump core on Linux

NASM, 3 bytes ret I guess it tries to jump to whatever is on the default stack and immediately segfaults :). Built with: nasm -f elf64 golf.asm && ld golf.o -o golf
redstarcoder's user avatar
  • 1,811
0 votes

Display a Digital Clock

*><> (Starfish), 22 bytes " ::"s@hm@donononooo Try it here! Ungolfed >s":"m":"hnonon" "ooo1S\ \ ;?+1iod/ Explanation d push \r to the stack " ::" …
redstarcoder's user avatar
  • 1,811
1 vote

Print the ASCII table

><>, 14 bytes 0:o1+:r:@=?;$! Try it here! Explanation 0 push 0 to the stack [n, 0] : duplicate the top value [n, 0, 0] o output it …
redstarcoder's user avatar
  • 1,811
4 votes

Shortest auto-destructive loop

><>, 3 bytes !]! Try it here! Explanation ! skip next instruction ] close stack (crash) ! skip next instruction (jumping to close stack)
redstarcoder's user avatar
  • 1,811
23 votes
41 answers
5k views

Display a Digital Clock

Display a Digital Clock (I see there are many clock challenges, I have tried to read them all, I'm pretty sure this is unique) Write some code that continuously updates a digital clock displayed in …
redstarcoder's user avatar
  • 1,811
1 vote

C.U.S.R.S - The Completely Useless String Refactoring System!

Python 3 (164 194 186 181 168 165 bytes) p=0 w,*x=input().split() for i in x: if '-'>i:w,p=w[:p]+i[1:]+w[p:],0 else: try:p=w.index(i[1:],p) except:p=len(w) w=w[:p]+w[p:].replace(i[1:],'',1) p …
redstarcoder's user avatar
  • 1,811
0 votes

Count up folks!

><> (Fish), 16 bytes Solution 1 01+:{:?!;1-rnao! Try it here! Solution 2 01+::{:{(?;rnao! Solution 3 0\ o>1+::{:{(?;rna Wow can't believe I don't see any ><> submissions, have 3! All the so …
redstarcoder's user avatar
  • 1,811
4 votes

3... 2... 1... Crash off!

*><>, 20 18 bytes a1Fi:0(?b1-:?:1Fn; This actually works on Linux (and whatever supports files named \n I guess). It creates a file named \n on first run and outputs 10. It proceeds to output one l …
redstarcoder's user avatar
  • 1,811
1 vote

Draw an asterisk triangle

><>, 47 bytes <v[1:$-1;!?:$+10 0\:& $>:@=?v1+&:&"*"o 0f]oa~<. Try it here! This was fun to write, though a bit more bytes than I expected.
redstarcoder's user avatar
  • 1,811
1 vote

A "cheating" quine

SmileBASIC, 69 68 bytes LOAD"PRG1:"+PRGNAME$(0),FALSE PRGEDIT 1 FOR I=0 TO 3?PRGGET$(); NEXT Load the program into slot 0 (the default slot), and run! Explanation LOAD"PRG1:"+PRGNAME$(0),FALSE l …
redstarcoder's user avatar
  • 1,811
26 votes
16 answers
4k views

bROKEN cAPSLOCK kEY fIASCO

Some of your employees have broken capslock keys and you're too cheap to replace them. Help them out by creating the shortest program possible to correct their work! Simply convert each character in a …
redstarcoder's user avatar
  • 1,811
3 votes

Display a chain of little mountains with an odd number on the top of it!

><> (Fish) 52 63 62 bytes <v!?:-1:!?-1%2: >~la}}" "72. v!?-2lno<o" " o >:?!;"\ /"ooo1- Try it online! To use simply place n on the stack and away you go! Much of this is taken from @Teal-Pelica …
redstarcoder's user avatar
  • 1,811
1 vote

Depalindromize this string!

><>, 7 15 bytes l1+2,[v ;!?lo< Try it here! This is a full program. To use it simply place the palindrome on the stack, and the result will be outputted to stdout! Explanation l get the s …
redstarcoder's user avatar
  • 1,811
1 vote

How to randomize letters in a word

><>, 40 bytes _5l)?vl1-[&r02. } .32< x{|$! /r]& >l?!;o Try it here!
redstarcoder's user avatar
  • 1,811

15 30 50 per page