Linked Questions

19
votes
23answers
2k views

Insist on a new filename

At runtime, keep prompting for a line of input until the user input is not the name of an existing file or directory or other file system item, relative to the current working directory. Then return/...
27
votes
18answers
1k views

Right-align text

Your job is to take a string input and a number and align the string to the right, making the width of the text the number. When a line is too long, break it and put the rest on the next line, ...
12
votes
25answers
2k views

N-Dimensional Cartesian Product

Introduction The Cartesian product of two lists is calculated by iterating over every element in the first and second list and outputting points. This is not a very good definition, so here are some ...
12
votes
31answers
5k views

Print a string with vertical words

Your task is to take an input string of ascii characters and output the string as a series of vertical words separated by spaces. An example is shown below: Given the string: ...
17
votes
10answers
3k views

A Skittish Program

Objective You are to write a program that receives an integer n as input (from the command line), and embeds itself (the program) ...
9
votes
21answers
1k views

deRpiFy tHe sTriNg! [closed]

yOu wiLl bE giVen A sTriNg wHich cOnsiSts oF pRintAble asCii cHarActErs. yOu iTeraTe tHrougH thE sTrIng tHen chAnge rAndOM(uNifoRm, 50% cHanCe uPPercAse) lEtteRs to uPPercAse aNd eVerytHing ...
14
votes
14answers
1k views

Short Date into English Long Date

Convert short date format into English long date in as few bytes as possible. Input Input will be in the form of a string with format, yyyy-mm-dd, with zero padding ...
18
votes
5answers
1k views

Find a sequence in the binary digits of π

Given a binary sequence of finite length, find the starting position where this sequence first appears in the binary digits of π (after the decimal). You can assume that an answer exists for any input ...
11
votes
9answers
1k views

What is this date format?

For Gregorian calendars, the date format varies from a country to another. There are three main formats recognized: YY-MM-DD (big-endian) ...
17
votes
6answers
2k views

The Double Slit Experiment

A lazy physicist has the job to perform the double slit experiment. However, they are lazy and can't be bothered to set up all the equipment themselves and so are going to simulate the effects. They ...
13
votes
8answers
792 views

Line numbering - implement nl

Your task is to implement a program similar to the nl command-line tool from the GNU core utilities. Standard loopholes are banned. You may not use any built-in ...
10
votes
4answers
406 views

Expose nondeterminism resulting from the OS thread scheduler

As we all know, modern operating systems have thread schedulers that can pick different orders to schedule your threads based on internal logic which your code is not privy to. Normally you architect ...
7
votes
4answers
128 views

Tips for restricted source in zsh

Adapted from tips for restricted-source in Python Just like code-golf, restricted-source pushes one to exploit quirks and hidden features of the zsh language. While we already have a place to collect ...

15 30 50 per page
1 2
3