Linked Questions

196 votes
416 answers
76k views

1, 2, Fizz, 4, Buzz

Introduction In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other ...
Beta Decay's user avatar
  • 23.4k
53 votes
51 answers
8k views

Tips for golfing in PowerShell

What general tips do you have for golfing in Windows PowerShell? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to PowerShell (e.g. "...
Joey's user avatar
  • 13.1k
104 votes
30 answers
7k views

Does the code terminate?

This is a code golf challenge I thought of with a mathematical bent. The challenge is to write the shortest code possible such that it is an open question whether or not the code terminates. An ...
Bolton Bailey's user avatar
25 votes
70 answers
6k views

Return 1 - Popularity Contest [closed]

The Task Create a function/subroutine which returns 1. You can make it as elaborate as you like, as long as it returns 1. The Rules The entry with the most upvote wins - just like any popularity ...
LazySloth13's user avatar
41 votes
26 answers
4k views

Tips for golfing in Rust

While Rust is very, very rarely competitive in code golfing competitions (Java is often shorter), it can still be fun to golf in. What are some tricks for making Rust code shorter? Please post only ...
Doorknob's user avatar
  • 71.5k
29 votes
8 answers
3k views

Tips for golfing in Julia

What general tips do you have for golfing in Julia? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Julia (e.g. "remove comments" is ...
Jonathan Van Matre's user avatar
28 votes
13 answers
3k views

Collatz's ice cream cone factory

The Collatz sequence Given a positive integer \$a_1\$, the Collatz sequence with starting value \$a_1\$ is defined as \begin{equation} a_{n+1} = \begin{cases} a_n/2 & \mathrm{if}\ a_n\ \mathrm{is}\...
Luis Mendo's user avatar
  • 105k
21 votes
16 answers
3k views

Recursive Collatz Conjecture

The Collatz conjecture postulates that if you take any positive integer, then repeat the following algorithm enough times: ...
DonielF's user avatar
  • 773
12 votes
12 answers
3k views

Hitting 495 (Kaprekar) [duplicate]

Input: A three digit number from stdin or as an argument not all digits are the same may start with one or two zero's Process Order the input-digits ascending and descending to form two new ...
steenslag's user avatar
  • 2,170
35 votes
2 answers
4k views

Tribute to John Conway: Collatz in FRACTRAN

John Horton Conway was a brilliant mathematician. Among his contributions were three Turing-complete esolangs: Game of Life (esolangs wiki), FRACTRAN (esolangs wiki), and Collatz function (esolangs ...
Bubbler's user avatar
  • 77k
7 votes
16 answers
635 views

Extract and Divide

Challenge For a given positive integer \$n\$: Repeat the following until \$n < 10\$ (until \$n\$ contains one digit). Extract the last digit. If the extracted digit is even (including 0) multiply ...
DimChtz's user avatar
  • 967
23 votes
8 answers
1k views

Print the Super Collatz numbers

The Collatz Sequence (also called the 3x + 1 problem) is where you start with any positive integer, for this example we will use 10, and apply this set of steps to it: ...
DJMcMayhem's user avatar
  • 59.3k
38 votes
3 answers
1k views

Build a golfing language with me

A lot of PPCG users helped with the creation of this challenge, both in chat and the Sandbox, specifically Martin Ender, AdmBorkBork, Emigna and user202729 Our community has found it necessary to ...
caird coinheringaahin g's user avatar
8 votes
10 answers
411 views

Count the reviews!

Introduction and Credit Imagine you're Amazon. Imagine you have a large number of products for which a lot of people have written reviews scoring 1-5 stars. Now you need to give your customers a ...
SEJPM's user avatar
  • 3,393
7 votes
3 answers
908 views

Find a set of 10 numbers such that all pairs have a different GCF

The set of ten numbers below: ...
Joe Z.'s user avatar
  • 35k

15 30 50 per page