Linked Questions

167 votes
91 answers

Tips for golfing in JavaScript

What general tips do you have for golfing in JavaScript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to JavaScript (e.g. "remove ...
user avatar
  • 5,982
118 votes
97 answers

Loading... Forever

Your challenge is to make an infinite loading screen, that looks like this: Or, to be more specific: Take no input. Output Loading..., with a trailing space, but ...
user avatar
  • 13.9k
87 votes
111 answers

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 ...
user avatar
  • 57.4k
52 votes
95 answers

Alphabet triangle

You are to print this exact text: ...
user avatar
  • 48.6k
54 votes
90 answers

Find the smallest number that doesn't divide N

This challenge is simple enough that it's basically all in the title: you're given a positive integer N and you should return the smallest positive integer which is not a divisor of N. An example: the ...
user avatar
44 votes
92 answers

Draw an ASCII chess board!

Here is a simple challenge for you: You must produce this ASCII representation of a chess board. White is represented by uppercase characters, and black is represented by lowercase. Empty tiles are ...
user avatar
  • 57.4k
53 votes
73 answers

Output the alphabet, the ALPHABET, or just a character

The challenge is simple: Write a function or program that takes an input x, and outputs the lower case alphabet if x is part of ...
user avatar
45 votes
66 answers

Can this number be written in (3^x) - 1 format?

Challenge: Create a program that accepts a positive integer and checks if it can be written in the form of (3^x)-1, where X is another positive integer. If it can, output X If it can't, output -1 ...
user avatar
  • 2,942
41 votes
53 answers

Don't give me five!

Question : You will be given the starting and ending integers of a sequence and should return the number of integers within it which do not contain the digit 5. The ...
user avatar
  • 433
30 votes
66 answers

Count the divisors of a number

Introduction This is a very simple challenge: simply count the divisors of a number. We've had a similar but more complicated challenge before, but I'm intending this one to be entry-level. The ...
user avatar
  • 2,202
36 votes
59 answers

Is my barcode valid?

An EAN-8 barcode includes 7 digits of information and an 8th checksum digit. The checksum is calculated by multiplying the digits by 3 and 1 alternately, adding the results, and subtracting from the ...
user avatar
  • 13.9k
23 votes
67 answers

Display numbers lacking 2's

Display numbers from one to one-hundred (in increasing order), but number 2 shouldn’t appear anywhere in the sequence. So, for example, the numbers two (2) or ...
user avatar
  • 1,109
32 votes
66 answers

Cat goes "Meow"

cat goes "Meow" We are all familiar with the concept of a cat program. The user types something in, it is echoed back to the ...
user avatar
40 votes
43 answers

Is it a balanced number?

A number is balanced if the sum of the digits on each half of the number is equal, so: 1423 is balanced because 1+4 = 2+3, so is:...
user avatar
48 votes
30 answers

Element names above 118

IUPAC in their insufferable wisdom have created a systematic element name for any newly created element. This is the temporary name of an element until they finally make up their minds about an actual ...
user avatar
  • 1,035

15 30 50 per page
2 3 4 5