Questions tagged [source-layout]

For challenges that involve the physical layout or physical manipulation of source-code.

Filter by
Sorted by
Tagged with
10
votes
4answers
739 views

Put the line in the code you nut and shake it all up

Using one programming language write 5 single-line programs, each of which outputs a different line of the first verse to Harry Nilsson's 1972 song "Coconut" when run individually: Brother bought a ...
1
vote
4answers
456 views

All those duplicate questions deserve duplicate code to show them off

All those questions that are duplicates... Ignored and marginalized by society. It is just not... right. We have to do something. There surely must be love for them too. They feel appreciated if a ...
6
votes
3answers
499 views

Retrograde morse (d)e(n)coder

This question is inspired by retrograde music. Retrograde music is a piece of music that can both be played normally (from the beginning to the end) as reversed (from the end the beginning). A similar ...
12
votes
1answer
737 views

Code a Code Slidey Puzzle!

The most recognizable sliding puzzle is the fifteen puzzle. It has a 4 by 4 grid, 15 tiles, and one empty grid space. The tiles can only move into the empty space and must always be in line with the ...
12
votes
1answer
260 views

Golf some quine stripes in different languages

You will choose m languages and write n programs in each language, each with length n*m. The kth program should output the kth character of each program, ordered by the program number. For example, ...
22
votes
9answers
2k views

Caesar-Cypher-Mania

The Caesar Cypher is a very simple substitution cypher where each letter is shifted by a fixed offset (looping around Z to A). Similarly, we can also a Caesar cypher for the set of printable ASCII ...
54
votes
24answers
6k views

Significant Whitespace

We define whitespace to be any of the three characters, tab (0x09), newline (0x0A) or space (0x20). For this challenge, you're to write two programs or functions in the same programming language, ...
22
votes
6answers
2k views

Mutual Negative Quines

This was inspired by Print a Negative of your Code and Golf a mutual quine. Consider a rectangle of characters, that meet the following restrictions: Consists solely of printable ASCII characters ...
100
votes
25answers
15k views

Print a Negative of your Code

Consider a square of printable ASCII characters (code points 0x20 to 0x7E) for side length N, like the following (here, N = 6): ...
20
votes
4answers
2k views

The Fatal Error Challenge

Objective Write a routine that accepts a string of printable ASCII characters, s, and returns a string containing the same characters as s, reordered so that no two-character substring appears more ...
22
votes
5answers
3k views

Onion Programming

Using only printable ASCII (hex codes 20 to 7E), write a square N×N core program without comments that is surrounded by 4 more layers, creating a (N+8)×(N+8) square program (N > 0). For N = 3 the ...
17
votes
3answers
1k views

Choose-Your-Own-Language Code

Let's take a grid of 16x16 printable ASCII characters (code points 0x20 to 0x7E). There are 30-choose-15 paths from the top left to the bottom right corner, making only orthogonal moves, like the ...
11
votes
5answers
606 views

Code Crosswords - Solutions

This is the companion question for Code Crosswords. Robber answers go here. See Where should we put robbers? for meta-info.
23
votes
7answers
2k views

Code Crosswords

This is a cops-and-robbers challenge. Answer here if you are a cop (crossword maker), answer the companion question if you are a robber (crossword solver). You may take on both roles. Cops (Puzzlers) ...
34
votes
18answers
4k views

Jumblers vs Rebuilders: Coding with Tetris Bricks

In traditional Tetris, there are 7 distinct tetromino bricks, each denoted by a letter similar to its shape. ...
22
votes
3answers
1k views

Write a square program that outputs the number of times it has been “unrolled”

Consider a square block of text, N characters wide by N tall, for some odd integer N greater than 1. As an example let N = 5 and the text be: ...
10
votes
4answers
854 views

Anagramming Code

Let's try this again. The object of this contest is to make two pieces of code that are anagrams of each other (the two must contain the same bytes in a different order), and they will do the ...
2
votes
3answers
257 views

Writing Phrases with Code [closed]

This is my first contest, so please tell me what I can do to improve. The object of this contest is to write program lines in your language of choice that are both valid code and self-descriptive in ...
27
votes
5answers
2k views

Radioactive Quines

A radioactive quine is a quine-like program that has an even number of characters and, when run, outputs itself with exactly half of its characters removed. The output itself may be a radioactive ...
19
votes
6answers
2k views

Run the Nth characters to get N

Write the shortest program possible such that when you combine the first character and every Nth character after it into a new program, the output is N. This must work for N = 1, 2, ..., 16. Another ...
43
votes
3answers
4k views

Code that runs the Game of Life on itself

Write two rectangular blocks of code, each w characters wide and h characters tall, that implement Conway's Game of Life when arranged in a grid. (w and h may be any positive integers) For example, ...
28
votes
29answers
4k views

Program your favorite phrase

Pick a quote or phrase that is exactly 5 words long, such as Programming puzzles and code golf!. Write a program that, when appended to itself n times, outputs the ...
47
votes
14answers
6k views

Make a code square with your favorite word

Pick your favorite 6 letter common English word that has no repeated letters, such as wombat. Write a program in an N×N grid of characters without comments such ...
63
votes
24answers
7k views

Write a Rectangular Program that Outputs the Number of Times it was Rotated

The title says it all. Your goal is to write a program that forms a w×h rectangle of characters that can be rotated and re-run to output the number of 90° Counter-Clockwise (CCW) rotations that have ...
5
votes
1answer
826 views

Let us create a sonnet quine! [closed]

There are programs that will output its source code to standard output and do nothing else. They also access no external output. This type of program is known as a quine, and is a common code ...
66
votes
7answers
6k views

Fault-Tolerant Hello World (a.k.a. the Interview)

At the end of your interview, the Evil Interviewer tells you, "We make all of our applicants take a short coding test, to see if they really know what they are talking about. Don't worry; it's easy. ...
26
votes
3answers
1k views

Create a rotating quine

A rotation of a string is made by splitting a string into two pieces and reversing their order, for example "world! Hello," is a rotation of ...
116
votes
42answers
16k views

Write a program that always outputs “2012” - even if it's modified!

This idea is not mine, though I don't know where it originated. I once met it in a programming contest very long ago (1998, if I remember correctly). The task is to write a program in your favorite ...