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 63033

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

1 vote

Shortest auto-destructive loop

Euphoria - 53 bytes atom i i=1 while 1 do puts(i,i) i-=1 end while Did it in a different way so we dont get full of "division by 0" errors. Explanation: "puts" first argument is the device to out …
Offtkp's user avatar
  • 3,072
0 votes

Shortest infinite loop producing no output

PKod - 1 byte Version 1.1 was released very recently as I still update this, which implements this new function/command < Explanation: Jumps back to first byte in code. So it jumps back to itself. N …
Offtkp's user avatar
  • 3,072
1 vote
2 answers
286 views

Create an application that restarts itself after n-seconds once [closed]

In your favorite programming language, create an application that restarts itself once, after n seconds. You need to find a way to restart after exiting the program. EG: run cmd to do it for you. Mak …
Offtkp's user avatar
  • 3,072
1 vote

Add two numbers

Euphoria, 64 bytes Code: include get.e print(1,prompt_number("",{})+prompt_number("",{}))
Offtkp's user avatar
  • 3,072
2 votes

Three-Three-Three!

Batch ~ 9 bytes bc bc bc Two random chars, followed by a new line, makes 3 chars that are shown 3 times. Hex dump: 62 63 0A 62 63 0A 62 63 0A Output: C:\Users\4story\Desktop>bc 'bc' is not recogn …
Offtkp's user avatar
  • 3,072
0 votes

Create output twice the length of the code

PKod - 6 bytes Code: =0+ni6 Explanation: =0 - Set variable as 0 (ascii code of 0 is 48, thus 48 is stored in the variable) +n - Add 1 to variable (making it 49 on first iteration) and print asci …
Offtkp's user avatar
  • 3,072
9 votes

Three-Three-Three!

PKod, 9 bytes sonsonson Outputs: 111222333 Explanation: Background: PKod has only one variable that you mess with, with the code This variable starts with default value of 0 s - Add next cha …
Offtkp's user avatar
  • 3,072
88 votes
61 answers
23k views

Shut down the computer!

Challenge: In the programming language of your choice, shut down the machine that your code was executed on. Rules No shutting down by resource exhaustion (e.g.: forkbomb to force shutdown) You ar …
Offtkp's user avatar
  • 3,072
8 votes
18 answers
910 views

Is it a new highscore?

Challenge: In the language of your choice, write a program that generates a leaderboard with random scores and outputs it, then take a new score as input and check if it can be placed in the leaderbo …
Offtkp's user avatar
  • 3,072
20 votes
14 answers
1k views

Output N in base -10

Challenge: In the programming language of your choice, accept an integer as input in base 10, and output it in the negadecimal notation, which is also known as base -10 Example algorithm: This is …
Offtkp's user avatar
  • 3,072
17 votes
11 answers
784 views

One 1, Two 1's, One 2 One 1

Challenge: Create a program that takes input of a positive non-zero integer and outputs the 4 next numbers in the sequence described below. Note: Checking if the input is actually a positive non-zer …
Offtkp's user avatar
  • 3,072
17 votes
34 answers
6k views

The program that will find the next prime number

Intro: You accidentally corrupted the flow of time with a device you made for fun, that turned out to be a time machine. As a result, you got pushed to the far future. You realized that computing, …
Offtkp's user avatar
  • 3,072
29 votes
18 answers
8k views

XOR two monochrome images

Challenge: Take input of two black and white (monochrome) images and xor each pixel of the first, with each pixel of the second, add them to a new image and output the new image. Some clarifications …
Offtkp's user avatar
  • 3,072
1 vote

Loading... Forever

PKod , 48 bytes ~ Non-Competing Possibly the only way I can do this, as PKod only has one write-able variable lL=oo=ao=do=io=no=go=.ooo =|oyw=/oyw=-oyw=\oywl< Explanation: l - Clear screen and since i …
Offtkp's user avatar
  • 3,072
1 vote

Blinking twelve

PKod, 26 bytes PKod is an esoteric language that only has one accessible variable Code: l12=:o00yyl=-oo=:o=-ooyy< Explanation: l - if first char in code, print any NOP chars found 12 - two NOP c …
Offtkp's user avatar
  • 3,072

15 30 50 per page