Rebol3 Code Examplex


Rosetta_Code/Count_examples

Count task examples in Rosetta Code.

Rebol [
    title: "Rosetta code: Rosetta_Code/Count_examples"
    file:  %Rosetta_Code-Count_examples.r3
    url:   https://rosettacode.org/wiki/Rosetta_Code/Count_examples
]

;; Import caching and HTML decoding utilities
import thru-cache
import html-entities

;; Set HTTPS request timeout to 30 seconds
system/schemes/https/spec/timeout: 30

get-all-task-titles: function [
    "Scrapes all Rosetta Code task titles"
][
    ;; Build the base API URL for querying the Programming Tasks category
    base-url: rejoin [
        https://rosettacode.org/w/api.php
        "?action=query&format=xml&list=categorymembers&cmlimit=500"
        "&cmtitle=Category:Programming_Tasks"
    ]
    que: to block! base-url ;; Initialize queue with the starting URL
    titles: copy []         ;; Will hold task titles as [pageid title]

    ;; Process each URL in the queue (handles pagination across subcategory pages)
    while [not empty? que][
        ;; Dequeue and read the next URL
        url: take que
        print ["Reading:" as-blue find/tail url "&cmtitle="]
        xml: read-thru/string url

        cmcontinue: none ;; Will hold the "next page" subcategory token, if present
        parse xml [
            ;; Try to extract the pagination continuation token
            opt [
                thru {<continue cmcontinue="}
                copy cmcontinue: to #"^""
            ]
            thru <categorymembers>
            ;; Extract pageid and title from each <cm> element
            any [
                thru {<cm pageid="} copy pageid: to #"^""
                thru { title="} copy title: to #"^""
                (
                    ;; Store pageid as integer alongside title
                    repend titles [to integer! pageid title]
                )
            ]
        ]
        ;; If a cmcontinue token was found, enqueue the continuation URL
        if cmcontinue [
            append que rejoin [base-url "&cmcontinue=" cmcontinue]
        ]
    ]
    titles
]

get-task-examples: function[
    "Return language names with solution for a given task"
    task
][
    ;; Decode HTML entities and re-encode for use in a URL
    task: enhex decode 'html-entities task
    url: join https://rosettacode.org/w/index.php?action=raw&title= task
    data: read-thru/string url
    ;; Collect all language header names from the raw wiki markup
    parse data [
        collect any [thru "=={{header|" keep to "}}=="]
    ]
]

;; Fetch all task titles from Rosetta Code
titles: get-all-task-titles

;; Count language examples per task
counts: make block! length? titles
foreach [pageid title] titles [
    try/with [
        langs: get-task-examples title
        num: length? langs
        print [title as-green num]
        ;; Store [count title] pairs for later sorting
        repend counts [num title]
    ] :print  ;; On error, print the error and continue
]

;; Sort by example count, descending
sort/skip/reverse counts 2

;; Display the 10 tasks with the most language examples
print as-yellow "^/Top 10 tasks with the most examples:"
loop 10 [
    print [counts/2 "has" counts/1 "examples."]
    counts: skip counts 2
]

;; Seek to the last 20 entries (10 pairs) to find the least-covered tasks
print as-yellow "^/Top 10 tasks with the minimum examples:"
counts: skip tail counts -20
loop 10 [
    print [counts/2 "has" counts/1 "examples."]
    counts: skip counts 2
]

;; Timestamp when the data fetch completed
print ["^/Data received:" as-green now]

Output:

Reading: Category:Programming_Tasks
Reading: Category:Programming_Tasks&cmcontinue=page|484152524953532053504952414c|20743
Reading: Category:Programming_Tasks&cmcontinue=page|52554e2d4c454e47544820454e434f44494e47|1990
100 doors 397
100 prisoners 100
15 puzzle game 94
15 puzzle solver 39
2048 70
21 game 70
24 game 117
24 game/Solve 69
4-rings or 4-squares puzzle 77
9 billion names of God the integer 74
99 bottles of beer 440
A+B 347
Abbreviations, automatic 67
Abbreviations, easy 59
Abbreviations, simple 53
ABC correlation 64
ABC problem 166
ABC words 80
Abelian sandpile model 48
Abelian sandpile model/Identity 35
Abstract type 104
Abundant odd numbers 96
Abundant, deficient and perfect number classifications 140
Accumulator factory 122
Achilles numbers 37
Ackermann function 269
Active Directory/Connect 30
Active Directory/Search for a user 25
Active object 50
Add a variable to a class instance at runtime 69
Additive primes 109
Address of a variable 107
ADFGVX cipher 30
AKS test for primes 96
Algebraic data types 41
Align columns 143
Aliquot sequence classifications 59
Almkvist-Giullera formula for pi 39
Almost prime 123
Amb 81
Amicable pairs 127
Anadromes 53
Anagram generator 17
Anagrams 139
Anagrams/Deranged anagrams 87
Anaprimes 30
Angle difference between two bearings 105
Angles (geometric), normalization and conversion 48
Animate a pendulum 79
Animated Spinners 17
Animation 86
Anonymous recursion 126
Anti-primes 121
Append a record to the end of a text file 55
Apply a callback to an array 203
Apply a digital filter (direct form II transposed) 44
Approximate equality 57
Apéry's constant 25
Arbitrary-precision integers (included) 117
Archimedean spiral 89
Arena storage pool 35
Arithmetic derivative 57
Arithmetic evaluation 74
Arithmetic numbers 70
Arithmetic-geometric mean 142
Arithmetic-geometric mean/Calculate Pi 58
Arithmetic/Complex 132
Arithmetic/Integer 253
Arithmetic/Rational 79
Array concatenation 250
Array length 232
Arrays 267
Ascending primes 66
ASCII art diagram converter 39
Assertions 133
Associative array/Creation 185
Associative array/Iteration 144
Associative array/Merging 79
Atomic updates 46
Attractive numbers 98
Autogram checker 15
Average loop length 60
Averages/Arithmetic mean 215
Averages/Mean angle 93
Averages/Mean time of day 74
Averages/Median 143
Averages/Mode 113
Averages/Pythagorean means 126
Averages/Root mean square 150
Averages/Simple moving average 102
AVL tree 46
Babbage problem 164
Babylonian spiral 20
Balanced brackets 167
Balanced ternary 52
Barnsley fern 85
Base64 decode data 81
Bell numbers 95
Benford's law 94
Berlekamp–Massey algorithm 19
Bernoulli numbers 66
Bernoulli's triangle 37
Bernstein basis polynomials 25
Best shuffle 82
Bifid cipher 42
Bin given limits 48
Binary digits 229
Binary search 158
Binary strings 84
Binomial transform 35
Bioinformatics/Base count 65
Bioinformatics/Global alignment 17
Bioinformatics/Sequence mutation 37
Biorhythms 43
Bitcoin/address validation 39
Bitcoin/public point to address 27
Bitmap 97
Bitmap/Bresenham's line algorithm 81
Bitmap/Bézier curves/Cubic 43
Bitmap/Bézier curves/Quadratic 43
Bitmap/Flood fill 55
Bitmap/Histogram 37
Bitmap/Midpoint circle algorithm 55
Bitmap/PPM conversion through a pipe 20
Bitmap/Read a PPM file 52
Bitmap/Read an image through a pipe 21
Bitmap/Write a PPM file 68
Bitwise IO 47
Bitwise operations 168
Blossom algorithm 16
Blum integer 45
Boolean values 225
Borůvka algorithm 23
Boustrophedon transform 27
Box the compass 104
Boyer-Moore string search 30
Brace expansion 48
Brazilian numbers 68
Break OO privacy 45
Brilliant numbers 43
Bron–Kerbosch algorithm 28
Brownian tree 66
Bulls and cows 128
Bulls and cows/Player 52
Burrows–Wheeler transform 46
Bézier curves/Intersections 25
Caesar cipher 183
Calculating the value of e 138
Calendar 85
Calendar - for "REAL" programmers 49
Calkin-Wilf sequence 50
Call a foreign-language function 86
Call a function 129
Call a function in a shared library 64
Call an object method 92
Camel case and snake case 41
Canny edge detector 18
Canonicalize CIDR 50
Cantor set 79
Carmichael 3 strong pseudoprimes 57
Cartesian product of two or more lists 85
Case-sensitivity of identifiers 153
Casting out nines 70
Catalan numbers 150
Catalan numbers/Pascal's triangle 93
Catamorphism 116
Catmull–Clark subdivision surface 18
Centre and radius of a circle passing through 3 points in a plane 37
Chaocipher 54
Chaos game 75
Character codes 219
Chat server 34
Check if a polygon overlaps with a rectangle 21
Check if two polygons overlap 22
Check input device is a terminal 47
Check Machin-like formulas 33
Check output device is a terminal 53
Check that file exists 158
Checkpoint synchronization 33
Chernick's Carmichael numbers 23
Cheryl's birthday 51
Chinese remainder theorem 82
Chinese zodiac 89
Cholesky decomposition 76
Chowla numbers 63
Christofides algorithm 24
Church numerals 48
Circles of given radius through two points 73
Circular primes 56
Cistercian numerals 46
Classes 131
Closest-pair problem 76
Closures/Value capture 96
Cocke–Younger–Kasami (CYK) Algorithm 23
Collections 108
Color of a screen pixel 68
Color quantization 25
Color wheel 48
Colorful numbers 38
Colour bars/Display 73
Colour pinstripe/Display 58
Colour pinstripe/Printer 14
Combinations 130
Combinations and permutations 53
Combinations with repetitions 84
Comma quibbling 130
Command-line arguments 168
Commatizing numbers 33
Comments 344
Compare a list of strings 109
Compare length of two strings 89
Compare sorting algorithms' performance 29
Compile-time calculation 78
Compiler/AST interpreter 24
Compiler/code generator 28
Compiler/lexical analyzer 49
Compiler/Simple file inclusion pre processor 12
Compiler/syntax analyzer 27
Compiler/virtual machine interpreter 35
Composite numbers k with no single digit factors whose factors are all substrings of k 32
Compound data type 147
Concurrent computing 88
Conditional structures 259
Conjugate transpose 43
Consecutive primes with ascending or descending differences 36
Constrained genericity 43
Constrained random points on a circle 82
Continued fraction 81
Continued fraction/Arithmetic/Construct from rational number 56
Continued fraction/Arithmetic/G(matrix ng, continued fraction n) 38
Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2) 34
Convert decimal number to rational 67
Convert seconds to compound duration 99
Convex hull 58
Conway's Game of Life 148
Copy a string 222
Copy stdin to stdout 75
Count in factors 102
Count in octal 161
Count occurrences of a substring 164
Count the coins 96
Cramer's rule 48
CRC-32 98
Create a file 157
Create a file on magnetic tape 42
Create a two-dimensional array at runtime 144
Create an HTML table 108
Create an object at a given address 42
CSV data manipulation 100
CSV to HTML translation 95
Cuban primes 60
Cullen and Woodall numbers 62
Cumulative standard deviation 109
Currency 65
Currying 90
Curzon numbers 44
CUSIP 87
Cut a rectangle 36
Cycles of a permutation 20
Cyclops numbers 40
Cyclotomic polynomial 26
Damm algorithm 96
Date format 149
Date manipulation 87
Dating agency 20
Day of the week 195
De Bruijn sequences 46
De Polignac numbers 70
Deal cards for FreeCell 68
Death Star 43
Deceptive numbers 52
Deconvolution/1D 41
Deconvolution/2D+ 19
Decorate-sort-undecorate idiom 41
Deepcopy 54
Define a primitive data type 65
Delegates 61
Delete a file 140
Deming's funnel 45
Department numbers 119
Descending primes 49
Detect division by zero 152
Determinant and permanent 62
Determine if a string has all the same characters 94
Determine if a string has all unique characters 72
Determine if a string is collapsible 88
Determine if a string is numeric 174
Determine if a string is squeezable 64
Determine if only one instance is running 50
Determine if two triangles overlap 48
Determine sentence type 58
Dice game probabilities 57
Digital root 129
Digital root/Multiplicative digital root 62
Dijkstra's algorithm 74
Dinesman's multiple-dwelling problem 83
Dining philosophers 55
Disarium numbers 90
Discordian date 66
Display a linear combination 65
Display an outline as a nested table 18
Distance and Bearing 23
Distributed programming 30
Distribution of 0 digits in factorial series 30
Diversity prediction theorem 77
DNS query 68
Documentation 75
Dominoes 14
Doomsday rule 54
Dot product 197
Doubly-linked list/Definition 55
Doubly-linked list/Element definition 63
Doubly-linked list/Element insertion 55
Doubly-linked list/Traversal 55
Dragon curve 114
Draw a clock 84
Draw a cuboid 80
Draw a pixel 80
Draw a rotating cube 51
Draw a sphere 93
Duffinian numbers 50
Dutch national flag problem 94
Dynamic variable names 93
Earliest difference between prime gaps 23
Eban numbers 57
Echo server 54
Eertree 28
Egyptian division 87
EKG sequence convergence 35
Element-wise operations 53
Elementary cellular automaton 55
Elementary cellular automaton/Infinite length 25
Elementary cellular automaton/Random number generator 33
Elliptic curve arithmetic 35
Elliptic Curve Digital Signature Algorithm 16
Emirp primes 78
Empty directory 85
Empty program 318
Empty string 209
Enforced immutability 83
Engel expansion 24
Entropy 113
Entropy/Narcissist 45
Enumerations 115
Environment variables 139
Equal prime and composite sums 38
Equilibrium index 100
Erdös-Selfridge categorization of primes 20
Erdős-Nicolas numbers 34
Erdős-primes 49
Erdős–Woods numbers 13
Esthetic numbers 44
Ethiopian multiplication 187
Euclid-Mullin sequence 41
Euclidean rhythm 49
Euler method 103
Euler's constant 0.5772... 47
Euler's identity 52
Euler's sum of powers conjecture 87
Evaluate binomial coefficients 138
Even or odd 255
Events 42
Evolutionary algorithm 117
Exceptions 115
Exceptions/Catch an exception thrown in a nested call 78
Executable library 35
Execute a Markov algorithm 57
Execute a system command 167
Execute Brain**** 127
Execute Computer/Zero 27
Execute HQ9+ 83
Execute SNUSP 34
Experimental Verification of the NKT Law: Interpolating the Masses of 8 Planets Using NASA Data as of 30–31/12/2024 11
Experimental Verification of the NKTg Law in Earth Orbit Based on NASA’s 2025 Earth Dataset 12
Experimental Verification of the NKTg Law Using NASA Mercury Data in 2025 8
Experimental Verification of the NKTg Law Using NASA Neptune Data (2023–2024) 11
Exponential digital sums 19
Exponentiation operator 110
Exponentiation order 103
Exponentiation with infix operators in (or operating on) the base 46
Extend your language 92
Extensible prime generator 61
Extreme floating point values 66
Faces from a mesh 17
Factorial 374
Factorial base numbers indexing permutations of a collection 20
Factorial primes 54
Factorions 56
Factorize string into Lyndon words 21
Factors of a Mersenne number 75
Factors of an integer 210
Fairshare between two and more 55
Farey sequence 77
Fast Fourier transform 77
FASTA format 72
Faulhaber's formula 39
Faulhaber's triangle 40
Feigenbaum constant calculation 57
Fermat numbers 45
Fermat pseudoprimes 30
Fibonacci n-step number sequences 96
Fibonacci sequence 381
Fibonacci word 72
Fibonacci word/fractal 44
File extension is in extensions list 61
File input/output 172
File modification time 89
File size 136
File size distribution 31
Filter 190
Find Chess960 starting position identifier 25
Find common directory path 96
Find duplicate files 27
Find if a point is within a triangle 46
Find largest left truncatable prime in a given base 34
Find limit of recursion 150
Find palindromic numbers in both binary and ternary bases 47
Find the intersection of a line with a plane 49
Find the intersection of two lines 74
Find the last Sunday of each month 99
Find the missing permutation 91
First class environments 34
First perfect square in base n with n unique digits 41
First power of 2 that has leading decimal digits of 12 42
First-class functions 104
First-class functions/Use numbers analogously 63
Five weekends 102
Fivenum 58
Fixed length records 33
FizzBuzz 417
Flatten a list 149
Flipping bits game 53
Flow-control structures 84
Floyd's triangle 125
Floyd-Warshall algorithm 62
Forbidden numbers 59
Forest fire 76
Fork 74
Formal power series 31
Formatted numeric output 148
Fortunate numbers 26
Forward difference 105
Four bit adder 82
Four is magic 50
Four is the number of letters in the ... 18
Fractal tree 89
Fraction reduction 34
Fractran 66
French Republican calendar 20
FTP 38
Function composition 146
Function definition 295
Function frequency 30
Function prototype 45
Functional coverage tree 19
Fusc sequence 70
Gabow's algorithm 23
Galton box animation 39
Gamma function 101
Gapful numbers 91
Gauss-Jordan matrix inversion 50
Gaussian elimination 59
Gaussian primes 26
General FizzBuzz 87
Generate Chess960 starting position 70
Generate lower case ASCII alphabet 194
Generate random chess position 37
Generator/Exponential 69
Generic swap 200
Get system command output 82
Giuga numbers 54
Globally replace text in several files 72
Go Fish 35
Goldbach's comet 39
Golden ratio/Convergence 74
Gosper's hack 46
Gotchas 22
Graph colouring 20
Gray code 112
Grayscale image 63
Greatest common divisor 253
Greatest element of a list 238
Greatest prime dividing the n-th cubefree number 22
Greatest subsequential sum 103
Greedy algorithm for Egyptian fractions 44
Greyscale bars/Display 57
GSTrans string conversion 16
Guess the number 166
Guess the number/With feedback 145
Guess the number/With feedback (player) 81
GUI component interaction 57
GUI enabling/disabling of controls 45
GUI/Maximum window dimensions 50
Hailstone sequence 198
Halt and catch fire 75
Hamiltonian Cycle via Chvátal Closure 15
Hamming numbers 106
Handle a signal 60
Happy numbers 164
Harmonic series 65
Harriss Spiral 14
Harshad or Niven series 138
Hash from two arrays 137
Hash join 66
Hashtron inference 14
Haversine formula 144
Held–Karp algorithm 23
Hello world/Graphical 209
Hello world/Line printer 105
Hello world/Newbie 118
Hello world/Newline omission 223
Hello world/Standard error 172
Hello world/Text 634
Hello world/Web server 85
Here document 96
Heronian triangles 60
Hex dump 34
Hex words 42
Hickerson series of almost integers 53
Higher-order functions 160
Hilbert curve 59
History variables 56
Hofstadter Figure-Figure sequences 61
Hofstadter Q sequence 118
Hofstadter-Conway $10,000 sequence 78
Holidays related to Easter 59
Home primes 22
Honaker primes 54
Honeycombs 34
Hopcroft-Karp Algorithm 23
Horizontal sundial calculations 87
Horner's rule for polynomial evaluation 142
Horse racing 16
Host introspection 72
Hostname 121
Hough transform 27
HTTP 126
HTTPS 75
HTTPS/Authenticated 38
HTTPS/Client-authenticated 23
Huffman coding 67
Humble numbers 61
Hunt the Wumpus 41
I before E except after C 88
I'm a software engineer, get me out of here 15
IBAN 80
Iccanobif primes 37
Identity matrix 138
Idiomatically determine all the characters that can be used for symbols 36
Idiomatically determine all the lowercase and uppercase letters 67
Idoneal numbers 55
Image convolution 30
Image noise 57
Imaginary base numbers 22
Include a file 150
Inconsummate numbers in base 10 38
Increasing gaps between consecutive Niven numbers 38
Increment a numerical string 231
Index finite lists of positive integers 29
Infinity 125
Inheritance/Multiple 69
Inheritance/Single 101
Inner classes 15
Input loop 142
Integer comparison 237
Integer overflow 82
Integer sequence 198
Interactive programming (repl) 110
Intersecting number wheels 36
Introspection 88
Inventory sequence 42
Inverted index 47
Inverted syntax 63
ISBN13 check digit 93
Isograms and heterograms 27
Isqrt (integer square root) of X 84
Iterated digits squaring 72
Jacobi symbol 49
Jacobsthal numbers 54
Jaro similarity 64
Jaro-Winkler distance 26
Jensen's Device 103
Jewels and stones 113
Johnson's algorithm 20
Jordan-Pólya numbers 37
JortSort 71
Josephus problem 129
Joystick position 26
JSON 103
JSON pointer 17
Juggler sequence 36
Julia set 64
Jump anywhere 105
Jury stability criterion 7
K-d tree 35
K-means++ clustering 29
Kaprekar numbers 95
Kernighans large earthquake problem 70
Keyboard input/Flush the keyboard buffer 57
Keyboard input/Keypress check 74
Keyboard input/Obtain a Y or N response 105
Keyboard macros 32
Kirkpatrick–Seidel algorithm 21
Klarner-Rado sequence 39
Knapsack problem/0-1 94
Knapsack problem/Bounded 56
Knapsack problem/Continuous 71
Knapsack problem/Unbounded 68
Knight's tour 77
Knuth shuffle 156
Knuth's algorithm S 50
Knuth's power tree 27
Koch curve 48
Kolakoski sequence 32
Kosaraju 34
Kronecker product 67
Kronecker product based fractals 38
Lah numbers 55
Langton's ant 109
Largest int from concatenated ints 83
Largest number divisible by its digits 58
Largest proper divisor of n 96
Last Friday of each month 104
Last letter-first letter 56
Latin Squares in reduced form 26
Latin Squares in reduced form/Randomizing using Jacobson and Matthews' technique 15
Law of cosines - triples 38
Leap year 203
Least common multiple 163
Least m such that n! + m is prime 20
Left factorials 69
Legendre prime counting function 42
Leonardo numbers 107
Letter frequency 143
Levenshtein distance 145
Levenshtein distance/Alignment 32
Linear congruential generator 86
List comprehensions 86
List rooted trees 33
Literals/Floating point 101
Literals/Integer 150
Literals/String 149
Logical operations 204
Logistic curve fitting in epidemiology 30
Long literals, with continuations 45
Long multiplication 96
Long primes 51
Long year 108
Longest common subsequence 81
Longest common substring 74
Longest increasing subsequence 64
Longest string challenge 69
Look-and-say sequence 143
Loop over multiple arrays simultaneously 178
Loops/Break 207
Loops/Continue 182
Loops/Do-while 221
Loops/Downward for 234
Loops/For 292
Loops/For with a specified step 232
Loops/Foreach 214
Loops/Increment loop index within loop body 78
Loops/Infinite 307
Loops/N plus one half 211
Loops/Nested 146
Loops/While 293
Loops/With multiple ranges 73
Loops/Wrong ranges 69
LU decomposition 48
Lucas-Lehmer test 92
Lucky and even lucky numbers 30
Ludic numbers 68
Luhn test of credit card numbers 179
Lychrel numbers 46
Lyndon word 21
LZW compression 70
MAC vendor lookup 57
Machine code 47
Mad Libs 65
Magic 8-ball 92
Magic constant 56
Magic numbers 22
Magic squares of doubly even order 49
Magic squares of odd order 91
Magic squares of singly even order 32
Magnanimous numbers 53
Main step of GOST 28147-89 28
Make directory path 58
Man or boy test 90
Mandelbrot set 185
Map range 128
Mastermind 29
Matrix chain multiplication 31
Matrix digital rain 32
Matrix multiplication 136
Matrix transposition 141
Matrix-exponentiation operator 68
Maximum triangle path sum 79
Mayan calendar 21
Mayan numerals 49
Maze generation 85
Maze solving 45
McNuggets problem 102
MD4 42
MD5 104
MD5/Implementation 49
Median filter 27
Meissel-Mertens constant 37
Memory allocation 73
Memory layout of a data structure 36
Menu 103
Merge and aggregate datasets 36
Mertens function 64
Metallic ratios 30
Metaprogramming 55
Metered concurrency 41
Metronome 44
Mian-Chowla sequence 42
Middle three digits 128
Miller-Rabin primality test 77
Mind boggling card trick 38
Minesweeper game 42
Minimal steps down to 1 22
Minimum multiple of m where digital sum equals m 60
Minimum positive multiple in base 10 using only 0 and 1 36
Minkowski question-mark function 20
Modified random distribution 32
Modular arithmetic 48
Modular exponentiation 82
Modular inverse 114
Monads/List monad 32
Monads/Maybe monad 38
Monads/Writer monad 28
Monte Carlo methods 99
Monty Hall problem 121
Morse code 84
Motor 7
Motzkin numbers 44
Mouse position 73
Move-to-front algorithm 73
Multi-base primes 19
Multi-dimensional array 51
Multifactorial 104
Multiple distinct objects 77
Multiple regression 53
Multiplication tables 151
Multiplicative order 37
Multisplit 65
Multiton 13
Munchausen numbers 102
Munching squares 75
Musical scale 61
Mutex 39
Mutual recursion 159
Möbius function 77
N'th 138
N-queens problem 143
N-smooth numbers 39
Named parameters 76
Naming conventions 66
Narcissist 49
Narcissistic decimal number 97
Natural sorting 35
Nautical bell 30
Negative base numbers 40
Nested function 84
Nested templated data 39
Next highest int from digits 40
Nim game 89
NKTgLaw 27
Non-continuous subsequences 63
Non-decimal radices/Convert 95
Non-decimal radices/Input 71
Non-decimal radices/Output 81
Non-transitive dice 20
Nonoblock 38
Nonogram solver 25
Nth root 130
Null object 141
Number names 100
Number reversal game 99
Numbers divisible by their individual digits, but not by the product of their digits 70
Numbers k such that the last letter of k is the same as the first letter of k+1 14
Numbers which are not the sum of distinct squares 31
Numbers which are the cube roots of the product of their proper divisors 46
Numbers with equal rises and falls 61
Numeric error propagation 36
Numerical and alphabetical suffixes 15
Numerical integration 79
Numerical integration/Gauss-Legendre Quadrature 43
Numerical integration/Romberg integration 20
Numerical integration/Tanh-Sinh Quadrature 25
O'Halloran numbers 58
Object serialization 42
Odd and square numbers 77
Odd word problem 65
Old lady swallowed a fly 94
Old Russian measure of length 60
OLE automation 8
One of n lines in a file 73
One-dimensional cellular automata 122
One-time pad 16
One-two primes 24
OpenGL 49
OpenWebNet password 22
Operator precedence 99
Optional parameters 69
Order by pair comparisons 36
Order disjoint list items 43
Order two numerical lists 96
Ordered partitions 38
Ordered words 137
Ormiston pairs 32
Ormiston triples 24
Own digits power sum 36
P-Adic numbers, basic 14
P-Adic square roots 13
P-value correction 23
Padovan n-step number sequences 41
Padovan sequence 41
Pairs with common factors 28
Palindrome dates 56
Palindrome detection 203
Palindromic gapful numbers 36
Palindromic primes in base 16 40
Pan base non-primes 21
Pancake numbers 52
Pangram checker 140
Paraffins 33
Parallel brute force 39
Parallel calculations 46
Parameterized SQL statement 41
Parametric polymorphism 49
Parse an IP Address 42
Parsing/RPN calculator algorithm 94
Parsing/RPN to infix conversion 44
Parsing/Shunting-yard algorithm 57
Partial function application 73
Particle fountain 15
Partition an integer x into n primes 52
Partition function P 43
Pascal matrix generation 70
Pascal's triangle 155
Pascal's triangle/Puzzle 53
Passphrase generator 20
Password generator 66
Pathological floating point problems 45
Peaceful chess queen armies 25
Peano curve 40
Pell numbers 25
Pell's equation 42
Penholodigital squares 22
Penney's game 50
Penta-power prime seeds 25
Pentagram 46
Pentomino tiling 20
Percentage difference between images 45
Percolation/Bond percolation 21
Percolation/Mean cluster density 25
Percolation/Mean run density 31
Percolation/Site percolation 25
Perfect numbers 144
Perfect shuffle 65
Perfect totient numbers 71
Periodic table 52
Peripheral drift illusion 18
Perlin noise 44
Permutation test 47
Permutations 136
Permutations by swapping 56
Permutations/Derangements 54
Permutations/Rank of a permutation 29
Pernicious numbers 92
Phrase reversals 107
Pi 101
Pi to 1 million digits 12
Pick random element 150
Pierpont primes 36
Pig the dice game 67
Pig the dice game/Player 25
Pinstripe/Display 49
Pinstripe/Printer 13
Piprimes 48
Pisano period 31
Plasma effect 36
Play recorded sounds 34
Playfair cipher 36
Playing cards 95
Plot coordinate pairs 71
Pointers and references 64
Poker hand analyser 46
Polymorphic copy 53
Polymorphism 77
Polynomial long division 54
Polynomial regression 62
Polyspiral 43
Population count 103
Power set 112
Pragmatic directives 41
Price fraction 105
Primality by trial division 194
Primality by Wilson's theorem 89
Prime conspiracy 48
Prime decomposition 133
Prime numbers whose neighboring pairs are tetraprimes 24
Prime reciprocal sum 27
Prime triangle 26
Primes - allocate descendants to their ancestors 27
Primes: n*2^m+1 26
Primorial numbers 49
Priority queue 89
Probabilistic choice 79
Problem of Apollonius 53
Product of min and max prime factors 48
Program name 128
Program termination 158
Proper divisors 101
Pseudo-random numbers/Combined recursive generator MRG32k3a 26
Pseudo-random numbers/Middle-square method 63
Pseudo-random numbers/PCG32 41
Pseudo-random numbers/Splitmix64 39
Pseudo-random numbers/Xorshift star 33
Punched cards 17
Pythagoras tree 51
Pythagorean quadruples 47
Pythagorean triples 91
QR decomposition 46
Quad-power prime seeds 24
Quaternion 87
Queue/Definition 117
Queue/Usage 93
Quickselect algorithm 70
Quine 192
Quine–McCluskey algorithm 16
Quoting constructs 33
Radical of an integer 34
Ramanujan primes/twins 20
Ramanujan's constant 21
Ramer-Douglas-Peucker line simplification 45
Random Latin squares 38
Random number generator (device) 70
Random number generator (included) 104
Random numbers 132
Random sentence from book 14
Range consolidation 38
Range expansion 107
Range extraction 113
Ranking methods 47
Rare numbers 33
Rate counter 58
Rational calculator 14
Ray-casting algorithm 44
RCRPG 29
Read a configuration file 86
Read a file character by character/UTF8 49
Read a file line by line 148
Read a specific line from a file 100
Read entire file 164
Real constants and functions 153
Recaman's sequence 70
Record sound 29
Reduced row echelon form 74
Reflection/Get source 26
Reflection/List methods 36
Reflection/List properties 39
Regular expressions 112
Remove duplicate elements 172
Remove lines from a file 72
Rename a file 128
Rendezvous 22
Rep-string 91
Repeat 122
Repeat a string 237
Repunit primes 28
Resistor mesh 40
Respond to an unknown method call 52
Retrieve and search chat history 21
Return multiple values 146
Reverse a string 286
Reverse words in a string 129
Rhonda numbers 23
Riordan numbers 48
RIPEMD-160 42
Rock-paper-scissors 83
Roman numerals/Decode 147
Roman numerals/Encode 176
Roots of a function 72
Roots of a quadratic function 71
Roots of unity 91
Rosetta Code/Count examples 50
Rosetta Code/Find bare lang tags 47
Rosetta Code/Find unimplemented tasks 43
Rosetta Code/Fix code tags 33
Rosetta Code/Rank languages by number of users 13
Rosetta Code/Rank languages by popularity 63
Rot-13 215
Round-robin tournament schedule 32
Routh–Hurwitz stability criterion 8
RPG attributes generator 88
RSA code 41
Run-length encoding 132
Runge-Kutta method 79
Runtime evaluation 75
Runtime evaluation/In an environment 61
Ruth-Aaron numbers 26
S-expressions 46
Safe addition 31
Safe primes and unsafe primes 51
Sailors, coconuts and a monkey problem 51
Same fringe 33
Schieber-Vishkin algorithm 21
Scope modifiers 69
Scope/Function names and labels 48
Sealed classes and methods 13
Search a list 134
Search a list of records 72
Search in paragraph's text 18
Secure temporary file 52
SEDOLs 94
Selectively replace multiple instances of a character within a string 40
Self numbers 33
Self-describing numbers 83
Semiprime 101
Semordnilap 91
Send an unknown method call 52
Send email 56
Sequence of non-squares 117
Sequence of primes by trial division 89
Sequence of primorial primes 35
Sequence: nth number with exactly n divisors 25
Sequence: smallest number greater than previous term with exactly n divisors 54
Sequence: smallest number with exactly n divisors 65
Set 99
Set consolidation 71
Set of real numbers 35
Set puzzle 44
Set right-adjacent bits 30
Set, the card game 22
Seven-sided dice from five-sided dice 58
Sexy primes 44
SHA-1 86
SHA-256 85
SHA-256 Merkle tree 22
Shell one-liner 117
Shoelace formula for polygonal area 72
Short-circuit evaluation 116
Shortest common supersequence 32
Show ASCII table 126
Show the epoch 88
Sierpinski arrowhead curve 39
Sierpinski carpet 119
Sierpinski pentagon 36
Sierpinski square curve 30
Sierpinski triangle 135
Sierpinski triangle/Graphical 72
Sieve of Eratosthenes 240
Sieve of Pritchard 25
Simple database 40
Simple turtle graphics 20
Simple windowed application 101
Simulate input/Keyboard 31
Simulate input/Mouse 24
Singleton 64
Singly-linked list/Element definition 89
Singly-linked list/Element insertion 77
Singly-linked list/Traversal 90
Singular value decomposition 16
Sisyphus sequence 21
Sleep 163
Sleeping Beauty problem 54
Smallest number k such that k+2^m is composite for all m less than k 17
Smarandache prime-digital sequence 45
Smarandache-Wellin primes 19
Smith numbers 75
Smith–Waterman algorithm 8
Snake 36
SOAP 25
Sockets 89
Sokoban 29
Soloway's recurring rainfall 42
Solve a Hidato puzzle 41
Solve a Holy Knight's tour 34
Solve a Hopido puzzle 29
Solve a Numbrix puzzle 34
Solve the no connection puzzle 47
Sorensen–Dice coefficient 14
Sort a list of object identifiers 56
Sort an array of composite structures 94
Sort an integer array 175
Sort an outline at every level 17
Sort disjoint sublist 101
Sort numbers lexicographically 72
Sort stability 71
Sort three variables 90
Sort using a custom comparator 104
Sorting algorithms/Bead sort 68
Sorting algorithms/Bogosort 100
Sorting algorithms/Bubble sort 191
Sorting algorithms/Circle sort 53
Sorting algorithms/Cocktail sort 101
Sorting algorithms/Cocktail sort with shifting bounds 37
Sorting algorithms/Comb sort 85
Sorting algorithms/Counting sort 89
Sorting algorithms/Cycle sort 46
Sorting algorithms/Gnome sort 121
Sorting algorithms/Heapsort 101
Sorting algorithms/Insertion sort 150
Sorting algorithms/Merge sort 125
Sorting algorithms/Pancake sort 77
Sorting algorithms/Patience sort 54
Sorting algorithms/Permutation sort 69
Sorting algorithms/Quicksort 181
Sorting algorithms/Radix sort 55
Sorting algorithms/Selection sort 111
Sorting algorithms/Shell sort 92
Sorting algorithms/Sleep sort 71
Sorting algorithms/Stooge sort 87
Sorting algorithms/Strand sort 51
Soundex 92
Sparkline in unicode 58
Special characters 87
Special variables 81
Specific characters 19
Speech synthesis 48
Spelling of ordinal numbers 38
Sphenic numbers 32
Spinning rod animation/Text 57
Spiral matrix 97
Split a character string based on change of character 120
SQL-based authentication 21
Square but not cube 93
Square form factorization 19
Square-free integers 65
Stable marriage problem 57
Stack 165
Stack traces 61
Stair-climbing puzzle 78
Start from a main routine 64
State name puzzle 35
Statistics/Basic 78
Statistics/Normal distribution 56
Steffensen's method 23
Stem-and-leaf plot 77
Stern-Brocot sequence 85
Stirling numbers of the first kind 40
Stirling numbers of the second kind 38
Straddling checkerboard 40
Strassen's algorithm 35
Stream merge 35
String append 158
String case 213
String comparison 114
String concatenation 221
String interpolation (included) 147
String length 215
String matching 146
String prepend 134
Strip a set of characters from a string 158
Strip block comments 65
Strip comments from a string 104
Strip control codes and extended characters from a string 83
Strip whitespace from a string/Top and tail 130
Strong and weak primes 41
Sub-unit squares 35
Subleq 81
Substitution cipher 62
Substring 170
Substring/Top and tail 144
Subtractive generator 54
Successive prime differences 42
Sudan function 71
Sudoku 85
Suffixation of decimal numbers 19
Sum and product of an array 213
Sum and product puzzle 42
Sum digits of an integer 156
Sum multiples of 3 and 5 140
Sum of a series 213
Sum of elements below main diagonal of matrix 59
Sum of squares 193
Sum to 100 53
Summarize and say sequence 49
Summarize primes 48
Super-d numbers 49
Super-Poulet numbers 26
Superellipse 43
Superpermutation minimisation 34
Sutherland-Hodgman polygon clipping 49
Sylvester's sequence 50
Symmetric difference 113
Sync subtitles 25
Synchronous concurrency 58
Syntax highlighting using Mediawiki formatting 18
System time 167
Table creation/Postal addresses 50
Take notes on the command line 90
Tarjan 26
Tau function 98
Tau number 106
Taxicab numbers 55
Teacup rim text 34
Temperature conversion 153
Terminal control/Clear the screen 114
Terminal control/Coloured text 69
Terminal control/Cursor movement 42
Terminal control/Cursor positioning 77
Terminal control/Dimensions 54
Terminal control/Display an extended character 79
Terminal control/Hiding the cursor 57
Terminal control/Inverse video 61
Terminal control/Positional read 28
Terminal control/Preserve screen 41
Terminal control/Ringing the terminal bell 102
Terminal control/Unicode output 43
Ternary logic 72
Test a function 71
Test integerness 49
Text processing/1 55
Text processing/2 59
Text processing/Max licenses in use 73
Textonyms 42
The Name Game 71
The sieve of Sundaram 32
The Twelve Days of Christmas 136
Thiele's interpolation formula 34
Thue-Morse 102
Tic-tac-toe 87
Time a function 121
Tokenize a string 214
Tokenize a string with escaping 62
Tonelli-Shanks algorithm 41
Top rank per group 92
Topic variable 39
Topological sort 66
Topswops 46
Total circles area 38
Totient function 73
Towers of Hanoi 214
Trabb Pardo–Knuth algorithm 101
Transliterate English text using the Greek alphabet 23
Tree datastructures 22
Tree from nesting levels 21
Tree traversal 109
Triangular numbers 24
Trigonometric functions 122
Tropical algebra overloading 23
Truncatable primes 69
Truncate a file 68
Truth table 55
Tupper's self-referential formula 23
Twelve statements 55
Twin primes 42
Twin primes whose sum is square number 34
Two bullet roulette 25
Two identical strings 85
Two's complement 61
Ukkonen’s suffix tree construction 11
Ulam spiral (for primes) 56
Ultra useful primes 30
Unbias a random generator 65
Undefined values 75
Undulating numbers 20
Unicode strings 72
Unicode variable names 90
Universal Lambda Machine 12
Universal Turing machine 64
Unix/ls 81
Unprimeable numbers 42
Untouchable numbers 19
UPC 38
Update a configuration file 35
Upside-down numbers 33
URL decoding 97
URL encoding 93
URL parser 39
Use another language to call a function 39
User input/Graphical 67
User input/Text 178
UTF-8 encode and decode 57
Validate International Securities Identification Number 66
Vampire number 49
Van der Corput sequence 89
Van Eck sequence 95
Variable declaration reset 32
Variable size/Get 77
Variable size/Set 55
Variable-length quantity 52
Variables 154
Variadic fixed-point combinator 15
Variadic function 124
Vector 87
Vector products 119
Verhoeff algorithm 27
Verify distribution uniformity/Chi-squared test 36
Verify distribution uniformity/Naive 52
Video display modes 37
Vigenère cipher 86
Vigenère cipher/Cryptanalysis 31
Visitor pattern 15
Visualize a tree 55
Vogel's approximation method 33
Voronoi diagram 49
Wagstaff primes 41
Walk a directory/Non-recursively 105
Walk a directory/Recursively 92
Walsh matrix 33
War card game 26
Wasteful, equidigital and frugal numbers 17
Water collected between towers 70
Wavelet Matrix 17
Web scraping 89
Weiler-Atherton polygon clipping 13
Weird numbers 43
Wieferich primes 51
Wilson primes of order n 45
Window creation 101
Window creation/X11 35
Window management 24
Wireworld 62
Wolstenholme numbers 26
Word frequency 85
Word ladder 29
Word search 25
Word wheel 49
Word wrap 93
Wordiff 21
Wordle comparison 37
World Cup group stage 34
Worthwhile task shaving 15
Write entire file 100
Write float arrays to a text file 82
Write language name in 3D ASCII 87
Write to Windows event log 36
Xiaolin Wu's line algorithm 46
XML/DOM serialization 57
XML/Input 87
XML/Output 72
XML/XPath 62
Y combinator 113
Yahoo! search interface 29
Yellowstone sequence 61
Yin and yang 95
Zebra puzzle 62
Zeckendorf arithmetic 28
Zeckendorf number representation 116
Zero to the zero power 172
Zhang-Suen thinning algorithm 39
Zig-zag matrix 122
Zsigmondy numbers 27
Zumkeller numbers 42

Top 10 tasks with the most examples:
Hello world/Text has 634 examples.
99 bottles of beer has 440 examples.
FizzBuzz has 417 examples.
100 doors has 397 examples.
Fibonacci sequence has 381 examples.
Factorial has 374 examples.
A+B has 347 examples.
Comments has 344 examples.
Empty program has 318 examples.
Loops/Infinite has 307 examples.

Top 10 tasks with the minimum examples:
Universal Lambda Machine has 12 examples.
Experimental Verification of the NKT Law: Interpolating the Masses of 8 Planets Using NASA Data as of 30–31/12/2024 has 11 examples.
Experimental Verification of the NKTg Law Using NASA Neptune Data (2023–2024) has 11 examples.
Ukkonen’s suffix tree construction has 11 examples.
Experimental Verification of the NKTg Law Using NASA Mercury Data in 2025 has 8 examples.
OLE automation has 8 examples.
Routh–Hurwitz stability criterion has 8 examples.
Smith–Waterman algorithm has 8 examples.
Jury stability criterion has 7 examples.
Motor has 7 examples.

Data received: 1-Jun-2026/13:36:06+2:00