Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 100977

Code-golf is a competition to solve a particular problem in the fewest bytes of source code.

0 votes

Make your code error, but only sometimes!

(plain) pdfTeX, 34 bytes \ifcase\pdfuniformdeviate9}\fi\bye
plante's user avatar
  • 221
1 vote

Swapping "Good" and "Bad"

(e-)TeX, 48 bytes \read0to~\expanded{\def\##1~{#1}}\#Good Bad \bye Output is to dvi/pdf file.
plante's user avatar
  • 221
2 votes

The Letter A without A

TeX, 7 bytes ^^!\bye An extra 12 bytes if you wanted to supress the page number: ^^!\def\folio{}\bye
plante's user avatar
  • 221
4 votes

Alphabet triangle

(plain) TeX, 209 bytes \newcount~~65\newcount\j\j64\tt\def\a#1{{\loop\advance\j1\char\j\ifnum\j<#1\repeat\loop\advance\j-1\char\j\ifnum\j>65\repeat}\par}\def\c#1#2#3.{\loop\advance~#11\a~\ifnum~#2#3\r …
plante's user avatar
  • 221
3 votes

Triangular code, triangular output

TeX, 188 bytes Nothing out of the ordinary, but for completeness: % %% %%% %%%% %%%%% %%%%%% %%%%%%% %%%%%%%% \countdef ~=1%%%%%%% \countdef%% \i=26\loop%% \advance~1{%% \loop\advance% \i1.\ifnum\i<~% …
plante's user avatar
  • 221
1 vote

Print 0 to 100 without 1-9 characters

TeX, 57 bytes \newcount~\loop\advance~`^^A\the~ \ifnum~<`^^%\repeat\bye Makes uses of these two tricks: \$\rm\TeX\$'s preprocessor runs through the code and replaces any instance of two consecutive …
plante's user avatar
  • 221
1 vote

Draw the national flag of Iceland

pdfTeX, 108 bytes \def~{ w 9 0 m 9 18 l s 0 9 m 25 9 l s }\pdfliteral{0 .28 .88 rg 0 0 25 18 re f 1 G 4~.84 .16 .16 RG 2~}\bye
plante's user avatar
  • 221