Linked Questions

453
votes
806answers
145k views

“Hello, World!”

So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most ...
523
votes
235answers
119k views

Showcase of Languages

Notes This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not ...
214
votes
309answers
51k views

Is this number a prime?

Believe it or not, we do not yet have a code golf challenge for a simple primality test. While it may not be the most interesting challenge, particularly for "usual" languages, it can be nontrivial in ...
153
votes
398answers
29k views

Implement a Truth-Machine

A truth-machine (credits goes to this guy for coming up with it) is a very simple program designed to demonstrate the I/O and control flow of a language. Here's what a truth-machine does: Gets a ...
90
votes
275answers
18k views

Simple cat program

One of the most common standard tasks (especially when showcasing esoteric programming languages) is to implement a "cat program": read all of STDIN and print it to STDOUT. While this is named after ...
69
votes
230answers
22k views

Is this even or odd?

Note: There is not been a vanilla parity test challenge yet (There is a C/C++ one but that disallows the ability to use languages other than C/C++, and other non-vanilla ones are mostly closed too), ...
75
votes
184answers
14k views

Count up forever

Write a program that counts up forever, starting from one. Rules: Your program must log to STDOUT or an acceptable alternative, if ...
74
votes
158answers
8k views

Output the sign

Given a number N, output the sign of N: If N is positive, output 1 If N is negative, output -1 If N is 0, output 0 N will be an integer within the representable range of integers in your chosen ...
85
votes
105answers
11k views

N(e(s(t))) a string

To "function nest" a string, you must: Treat the first character as a function, and the following characters as the arguments to that function. For example, if the input string was ...
83
votes
54answers
11k views

Can you outgolf me? (Cops section)

Cops section The robbers section can be found here. Thanks to FryAmTheEggman, Peter Taylor, Nathan Merrill, xnor, Dennis, Laikoni and Mego for their contributions. Challenge Your task is to write 2 ...
36
votes
88answers
5k views

Code ladder, Cops

Note: This challenge is finished. Submissions are still welcome but can not win. This is the cops' thread. The robbers' thread goes here. Write a code that outputs the integer ...
41
votes
51answers
7k views

Cops: Make a regex - Make a snake

This is the cop's thread. The robber's thread is here. Write a code that takes an input n and creates a n-by-n "snake matrix". A snake matrix is a matrix that ...
37
votes
17answers
3k views

Overlapping Polyglots

Unlike many C&R challenges, this does not require a separate robbers post; the goal of the robbers is to crack the previous answer and then post a new one as a cop. As answerers, you will write a ...
20
votes
25answers
1k views

Exploded Suffixes

Given an ASCII string, output the exploded suffixes of it. For example, if the string was abcde, there are 5 suffixes, ordered longest to shortest: ...
27
votes
8answers
3k views

Create a programming language that only appears to be unusable (Robbers' thread)

See the cop thread for more information. Each answer to this question should crack an answer there. That is to say, it should be code to find the third-largest integer in the input when run in the ...

15 30 50 per page