Linked Questions

135
votes
78answers
40k views

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 ...
81
votes
35answers
8k views

Tips for golfing in <all languages>

The aim of this post is to gather all the golfing tips that can be easily applied to <all languages> rather than a specific one. Only post answers that its ...
41
votes
68answers
6k views

Is it a leap year?

This challenge is quite simple. You will take an input which will be a year from 1801 to 2400, and output if it is a leap year or not. Your input will have no newlines or trailing spaces: ...
51
votes
29answers
5k views

Encode the date in Christmas Eve format

The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be ...
51
votes
24answers
7k views

Minecraft Mirrored

This is Calvin. Just trying to get 20 rep so this user can chat in the PPCG Minecraft Server chatroom. Write a program or function that takes in a positive integer. If the integer is even (2, 4, 6, ....
36
votes
14answers
2k views

Today is the Center

Given a date as input in any convenient format, output a calendar with that date as the exact center of a five-week window. The header of the calendar must include the two-letter abbreviations for the ...
15
votes
24answers
2k views

Next Friday the 13th

What is the shortest program that can predict the next time Friday will fall on the 13th day of the month? Must be an complete functioning program (not just a function/subroutine) Must print out date ...
16
votes
14answers
1k views

Permutations in Disguise

Given a \$n\$-dimensional vector \$v\$ with real entries, find a closest permutation \$p\$ of \$(1,2,...,n)\$ with respect to the \$l_1\$-distance. Details If it is more convenient, you can use ...
11
votes
9answers
1k views

Everyone Ought to Have a Friend

An isolated character is a character (other than a newline) that doesn't have an adjacent character of the same type. Adjacent characters can be to the left, the right above or below, but not ...
15
votes
9answers
1k views

Finding Gaps in Date Ranges

Given a list of date ranges r as input, output or return any ranges not found in r. For the sake of this example, input will be ...
11
votes
5answers
788 views

ASCII Calendar Planner

Given a list of activities and their start time/date, output an ASCII-art calendar showing the activities on the appropriate days. All activities are guaranteed to be in the same month, no two ...
8
votes
7answers
740 views

Output the date in the Mel calendar

The Mel calendar is used in the fictional world of Kaldia. Your goal is to convert dates into the Mel calendar. This calendar has 13 months of 28 days each, plus 1 or 2 extra days after the last ...