48 questions linked to/from Tips for golfing in x86/x64 machine code
74k 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 ...
• 23.3k
18k views

Input: Two integers. Preferably decimal integers, but other forms of numbers can be used. These can be given to the code in standard input, as arguments to the program or function, or as a list. ...
• 6,332
10k views

### Stay away from zero

Task Given a non-negative integer n, output 1 if n is 0,...
• 49.6k
18k views

### Is this number evil?

Introduction In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number ...
• 1,604
8k views

### Is it a Cyclops number? "Nobody" knows!

Task: Given an integer input, figure out whether or not it is a Cyclops Number. What is a Cyclops number, you may ask? Well, it's a number whose binary representation only has one ...
• 2,603
4k views

### Type uniqchars!

Given a string consisting of printable ASCII chars, produce an output consisting of its unique chars in the original order. In other words, the output is the same as the input except that a char is ...
• 104k
8k views

### Greatest Common Divisor

Your task is to compute the greatest common divisor (GCD) of two given integers in as few bytes of code as possible. You may write a program or function, taking input and returning output via any of ...
• 717
6k views

### The shortest way to find one unique value when all other values are the same

In this question at Code Review they tried to find the fastest way to return the unique element in an array where all the elements are the same except one. But what is the shortest code that ...
• 12.8k
8k views

### The Luhn algorithm for verifying credit card numbers, etc

Challenge Write the shortest program or function to calculate the Luhn Algorithm for verifying (credit card) numbers. Luhn algorithm explained From RosettaCode, this algorithm for the purposes of ...
5k views

### Print random integers until 0

You are to write a program which generates random integers between $0$ and $99$ inclusive, outputting each integer in turn, until $0$ is generated. You may choose which single-order random ...
• 49.5k
12k views

### Print the phrase "And she said, 'But that's his.'" using only the alphabet

Print the phrase And she said, 'But that's his.' using only the following characters: ...
5k views

### User Appreciation Challenge #1: Dennis ♦

I got the spontaneous idea of making a series of challenges of users that have helped and continue to help the PPCG community be an enjoyable place for everyone, or maybe just specifically for me. :P ...
• 41.3k
5k views

### How many steps does it take from n to 1 by subtracting the greatest divisor?

Inspired by this question over at Mathematics. The Problem Let n be a natural number ≥ 2. Take the biggest divisor of ...
• 4,729
4k views

### Swap the parity

Task Given a positive integer n, output n+1 if n is odd, and output ...
• 49.6k