Skip to main content

Questions tagged [whitespace]

For challenges related to the processing and placement of whitespace characters (mainly, but not limited to spaces, tabs and line feeds), like challenges related to indentation. For challenges about the esoteric programming language Whitespace, use [whitespace-language] instead.

16 votes
19 answers
2k views

The Challenge Given a multiline string, return the longest substring of leading whitespace present in every line, ignoring empty lines or lines composed only of whitespace. If input is empty or ...
dx_over_dt's user avatar
27 votes
7 answers
2k views

I like golfing in tinylisp: (d M(q((x)(i x(i(disp x)0(M x))0 But I also like posting explanations with nicely formatted code: ...
DLosc's user avatar
  • 41k
21 votes
16 answers
5k views

You are to take a string representing a piece of brainfuck code and Explanations, containing only printable ASCII characters and newlines ( to ...
Fmbalbuena's user avatar
  • 5,115
1 vote
0 answers
59 views

The setting "Well I actually wrote the sql library they, the maintainers actually.." "Right, but do you have any experience working with django?" " ...no I don't use ...
TZubiri's user avatar
  • 111
5 votes
19 answers
481 views

Your task is to input a string, and output the number of spaces in the string. This is code-golf, so least number of bytes win. Your Test Cases Double quotes are not part of the test cases. ...
TwilightSparkle's user avatar
-1 votes
1 answer
141 views

Write a program which removes any common leading spaces from the input string. For example, if the least indented line started with 3 spaces, and every other line has ...
Mathieu CAROFF's user avatar
15 votes
23 answers
3k views

Some two-dimensional esolangs, such as Forked, and some non-esolangs, such as Python, can sometimes require spaces before lines of code. This isn't very golfy. Also, I'm lazy and writing a 2d lang ...
MD XF's user avatar
  • 14.3k
10 votes
2 answers
317 views

Write a program that adds or removes whitespace to format code nicely. Rules for what the code should look like when you're done: No line should contain more than one of ...
tbodt's user avatar
  • 2,524
6 votes
1 answer
211 views

Background The tabs versus spaces war in programming has been going on a long time, basically because spaces are too low-level to have all the properties you'd want for alignment and indentation, but ...
user avatar
33 votes
55 answers
4k views

Sona is in her house with her 10 year old daughter. She needs to go to school to bring back another child from school, as school is over at 2 pm. It's hot outside, so she wants to leave her younger ...
user avatar
88 votes
64 answers
8k views

Your task is to write a program that outputs the exact string Programming Puzzles (trailing newline optional), but when all spaces, tabs, and newlines are removed ...
user avatar
17 votes
20 answers
3k views

Ah, yet another of my selfish uses of this Stack. Being a Chromebook owner, I'm a frequent user of the Ace IDE, the editor used by Cloud9. It has lots of tools for dealing with excess whitespace, but ...
JessLovely's user avatar
20 votes
48 answers
3k views

When using Markup, like on the SE network, an indentation of four spaces before a line of text denotes it as part of a code block, as I hope you know. If you don't, here's an example (with ...
JessLovely's user avatar
19 votes
18 answers
3k views

This is part of a Cops and Robbers challenge. Go here for the cops' part. For the purpose of this challenge, we'll define whitespace as only linefeeds (0x0A) and spaces (0x20). Note that most ...
Martin Ender's user avatar
55 votes
27 answers
6k views

For the purpose of this challenge, we'll define whitespace as only linefeeds (0x0A) and spaces (0x20). Note that most languages and regex flavours consider many other characters as whitespace as well, ...
Martin Ender's user avatar

15 30 50 per page