Programming Puzzles & Code Golf newsletter

Top new questions this week:

2048-like array shift

Assume we want to shift an array like it is done in the 2048 game: if we have two equal consecutive elements in array, merge them into twice the value element. Shift must return a new array, where ...

code-golf array-manipulation  
asked by greenwolf 58 votes
answered by Jonathan Allan 19 votes

Find the Swirling Words!

Don't ask me how or why but while coding on a project I noticed that the characters of a couple of words had a particular pattern referred to the alphabet, I connected each character of the words with ...

code-golf string  
asked by Mario 40 votes
answered by Luis Mendo 11 votes

Folding Numbers

Given a number determine if it is a folding number. A folding number is a number such that if you take it binary representation and "fold" it in half, That is take the result of XNOR multiplication ...

code-golf number base-conversion binary bitwise  
asked by Wheat Wizard 35 votes
answered by Dennis 10 votes

pssssssssssssst

Introduction This is one is pretty straightforward. We will be drawing a snake in ascii. This was inspired by that old snake game where you have to collect the fruit and you continuously grow. ...

code-golf ascii-art  
asked by jacksonecac 30 votes
answered by Luis Mendo 9 votes

Simulate keystrokes

Your job is to simulate a couple of keystrokes that a user types in. Input A string array or string with a delimiter of your choice (outside the range 32-126) containing at least one 'keystroke'. ...

code-golf string  
asked by Dopapp 26 votes
answered by DJMcMayhem 26 votes

Let's do the Wave!

Input: A string (the wave-snippet) with a length >= 2. A positive integer n >= 1. Output: We output a single-line wave. We do this by repeating the input string n times. Challenge rules: ...

code-golf string  
asked by Kevin Cruijssen 26 votes
answered by muddyfish 5 votes

Hurricane Matthew and the Lightning Bolts

Challenge Inspired by this challenge and the nasty Hurricane Matthew, we will be generating some lightning bolts dynamically. n = 15: \ /\ / \ / / /\ /\ / \ \ / / /\ /\ \ / / ...

code-golf ascii-art random  
asked by Zukaberg 25 votes
answered by Ton Hospel 6 votes

Greatest hits from previous weeks:

Emulate an Intel 8086 CPU

Note: A couple of answers have arrived. Consider upvoting newer answers too. Java from NeatMonster Javascript from crempp C from Mike C C++ from Darius Goad Postscript from luser droog C++ from ...

popularity-contest  
asked by copy 130 votes
answered by j-a 70 votes

Execute prints backwards

Your task is to reverse the order in which some prints get executed. Specs: Your code will be in this form: //some lines of code /*code*/ print "Line1" /*code*/ /*code*/ print "Line2" /*code*/ ...

popularity-contest programming-puzzle  
asked by Vereos 92 votes
answered by Danko Durbić 163 votes
Subscribe to more Stack Exchange newsletters


Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3