Top new questions this week:
|
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 ...
|
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 ...
|
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 ...
|
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.
...
|
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'.
...
|
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:
...
|
Challenge
Inspired by this challenge and the nasty Hurricane Matthew, we will be generating some lightning bolts dynamically.
n = 15:
\
/\
/ \
/ /
/\ /\
/ \ \
/ / /\
/\ \
/ / ...
|
Greatest hits from previous weeks:
|
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
...
|
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*/
...
|