Rosetta Code/Count examples: Difference between revisions

m
→‎{{header|Wren}}: Minor changes (though see Talk Page re encoding of '+')
m (→‎{{header|Perl 6}}: Use a better matcher to cut down on both the false positives and false negatives)
m (→‎{{header|Wren}}: Minor changes (though see Talk Page re encoding of '+'))
(46 intermediate revisions by 15 users not shown)
Line 10:
 
Total: X examples.</pre>
 
For a full output, updated periodically, see [[Rosetta Code/Count examples/Full list]].
 
You'll need to use the Media Wiki API, which you can find out about locally, [http://rosettacode.org/mw/api.php here], or in Media Wiki's API documentation at, [http://www.mediawiki.org/wiki/API_Query API:Query]
Line 16 ⟶ 18:
{{libheader|AWS}}
Parsing XML file with XMLAda from AdaCore
<langsyntaxhighlight Adalang="ada">with Aws.Client, Aws.Messages, Aws.Response, Aws.Resources, Aws.Url;
with Dom.Readers, Dom.Core, Dom.Core.Documents, Dom.Core.Nodes, Dom.Core.Attrs;
with Input_Sources.Strings, Unicode, Unicode.Ces.Utf8;
Line 117 ⟶ 119:
Put_Line ("Total :" & Integer'Image (Total) & " exemples.");
end Count_Examples;
</syntaxhighlight>
</lang>
Output :
<pre>
Line 128 ⟶ 130:
 
=={{header|AutoHotkey}}==
<langsyntaxhighlight AutoHotkeylang="autohotkey">UrlDownloadToFile
, http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml
, tasks.xml
Line 147 ⟶ 149:
}
MsgBox % output
Return</langsyntaxhighlight>
 
=={{header|BBC BASIC}}==
{{works with|BBC BASIC for Windows}}
<langsyntaxhighlight lang="bbcbasic"> VDU 23,22,640;512;8,16,16,128+8 : REM Enable UTF-8 support
SYS "LoadLibrary", "URLMON.DLL" TO urlmon%
Line 234 ⟶ 236:
WHEN "&quot;": = """"
ENDCASE
= h$</langsyntaxhighlight>
'''Sample output:'''
<pre>
Line 263 ⟶ 265:
 
=={{header|Bracmat}}==
<langsyntaxhighlight lang="bracmat">( ( get-page
=
. sys$(str$("wget -q -O wget.out \"" !arg \"))
Line 303 ⟶ 305:
)
& lst$(list,taskfreq,NEW)
)</langsyntaxhighlight>
Output (in file <code>tasqfreq</code>):
<pre>list=
Line 351 ⟶ 353:
Object-oriented solution.
 
<langsyntaxhighlight lang="csharp">using System;
using System.Collections.Generic;
using System.Linq;
Line 400 ⟶ 402:
 
foreach (string task in tasknames) {
stringtry content = GetSourceCodeFromPage(task, wc);{
string content = GetSourceCodeFromPage(WebUtility.UrlEncode(task), wc);
int count = new Regex("=={{header", RegexOptions.IgnoreCase).Matches(content).Count;
Task t int count = new TaskRegex(task"=={{header", countRegexOptions.IgnoreCase).Matches(content).Count;
Task t = new Task(task, count);
 
Console.WriteLine(t);
tasks.Add(t);
}
catch (Exception ex) {
Console.WriteLine("**** Unable to get task \"" + task + "\": " + ex.Message);
}
}
 
Console.WriteLine("\nTotal: {0} examples.", tasks.Select(x => x.Examples).Sum());
}
}</langsyntaxhighlight>
 
=={{header|Clojure}}==
<langsyntaxhighlight lang="clojure">(ns count-examples
(:import [java.net URLEncoder])
(:use [clojure.contrib.http.agent :only (http-agent string)]
Line 452 ⟶ 459:
(flush))
(println "Total: " (reduce #(+ %1 (second %2)) 0 task-counts))))
</syntaxhighlight>
</lang>
<langsyntaxhighlight lang="clojure">count-examples> (print-result)
100 doors: 73
24 game: 18
Line 469 ⟶ 476:
Total: 11216
nil
</syntaxhighlight>
</lang>
 
=={{header|D}}==
{{works with|Tango}}
<syntaxhighlight lang="d">
<lang D>
import tango.io.Stdout;
import tango.net.http.HttpClient;
Line 522 ⟶ 529:
}
}
</syntaxhighlight>
</lang>
 
=={{header|EGL}}==
Line 530 ⟶ 537:
 
User Interface: RosettaCodeHandler.egl
<langsyntaxhighlight EGLlang="egl">package com.eglexamples.client;
 
import org.eclipse.edt.rui.widgets.*;
Line 605 ⟶ 612:
title string;
count int;
end</langsyntaxhighlight>
 
Service Interface: ProxyFunctions.egl
<langsyntaxhighlight EGLlang="egl">package com.eglexamples.client;
 
library ProxyFunctions
Line 644 ⟶ 651:
record QueryContinue
categorymembers Categorymembers;
end</langsyntaxhighlight>
 
 
=={{header|Erlang}}==
Line 651 ⟶ 657:
{{libheader|xmerl}}
 
<langsyntaxhighlight lang="erlang">
-module(rosseta_examples).
-include_lib("xmerl/include/xmerl.hrl").
Line 714 ⟶ 720:
replace_chars([],Acc) ->
lists:reverse(Acc).
</syntaxhighlight>
</lang>
 
 
Line 734 ⟶ 740:
Using asynchronous workflows to perform downloads concurrently:
 
<langsyntaxhighlight lang="fsharp">#r "System.Xml.Linq.dll"
 
let uri1 = "http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"
Line 751 ⟶ 757:
|> Async.Parallel
|> Async.RunSynchronously
|> fun xs -> printfn "Total: %d examples" (Seq.sum xs)</langsyntaxhighlight>
 
This is 21&#215; faster than the python thanks to the concurrency.
 
=={{header|Factor}}==
Runs in about a minute. The number of threads is limited to 10 avoid cloudfare's protection mechanism.
 
<langsyntaxhighlight lang="factor">USING: arrays assocs concurrency.combinators
concurrency.semaphores formatting hashtables http.client io
json.reader kernel math math.parser sequences splitting
Line 798 ⟶ 805:
all-programming-titles fetch-counts print-counts ;
 
MAIN: rosetta-examples</langsyntaxhighlight>
Outputs:
 
Line 808 ⟶ 815:
 
Total: 30745 examples.</pre>
 
=={{header|Go}}==
<langsyntaxhighlight lang="go">package main
 
import (
Line 883 ⟶ 891:
fmt.Printf("%s: %d\n", cm, examples)
total += examples
}</langsyntaxhighlight>
{{out|Output: (May 25, 2011)}}
<pre>
Line 897 ⟶ 905:
{{libheader|HTTP XML}} from [http://hackage.haskell.org/packages/hackage.html HackageDB]
 
<langsyntaxhighlight lang="haskell">import Network.Browser
import Network.HTTP
import Network.URI
Line 933 ⟶ 941:
 
mapM_ putStrLn $ zipWith showFormatted tasks ns
putStrLn $ ("Total: " ++) $ show tot</langsyntaxhighlight>
some output:
<langsyntaxhighlight lang="haskell">*Main> progTaskExamples
100 doors: 56
24 game: 11
Line 944 ⟶ 952:
Active object: 9
...
Total: 9156</langsyntaxhighlight>
 
==Icon and {{header|Unicon}}==
The following code uses features exclusive to Unicon. This version handles all tasks, not just the first 500.
 
<langsyntaxhighlight Uniconlang="unicon">$define RCINDEX "http://rosettacode.org/mw/api.php?format=xml&action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500"
$define RCTASK "http://rosettacode.org/mw/index.php?action=raw&title="
$define RCUA "User-Agent: Unicon Rosetta 0.1"
Line 1,030 ⟶ 1,038:
close(page)
return text
end</langsyntaxhighlight>
 
{{libheader|Icon Programming Library}}
Line 1,062 ⟶ 1,070:
'''Solution:'''<br>
Using <code>getCategoryMembers</code> from [[Find unimplemented tasks#J|Find unimplemented tasks]].
<langsyntaxhighlight lang="j">require 'web/gethttp'
 
getAllTaskSolnCounts=: monad define
Line 1,081 ⟶ 1,089:
res=. ;:^:_1 tasks ,. (8!:0 counts) ,. <'examples.'
res , 'Total examples: ' , ": +/counts
)</langsyntaxhighlight>
 
'''Example Usage:'''
<langsyntaxhighlight lang="j"> formatSolnCounts getAllTaskSolnCounts ''
100 doors: 61 examples.
24 game: 15 examples.
24 game Player: 11 examples.
99 Bottles of Beer: 76 examples.
...</langsyntaxhighlight>
 
=={{header|Java}}==
{{works with|Java|1.5+}}
<langsyntaxhighlight lang="java5">
import java.util.ArrayList;
import ScreenScrape;
Line 1,163 ⟶ 1,171:
}
}
</syntaxhighlight>
</lang>
[[Count programming examples/Java/ScreenScrape|ScreenScrape class]]
 
 
 
=={{header|jq}}==
Line 1,173 ⟶ 1,179:
`@uri` filter in the bash function `titles`.
 
<langsyntaxhighlight lang="bash">#!/bin/bash
 
# Produce lines of the form: URI TITLE
Line 1,197 ⟶ 1,203:
n=$((n + i))
done < <(titles)
echo Total: $n examples.</langsyntaxhighlight>
 
{{out}}
Line 1,210 ⟶ 1,216:
Palindrome detection: 136 examples.
Total: 32416 examples.</pre>
 
=={{header|Julia}}==
Output by page is too long, so summaries only output shown.
<syntaxhighlight lang="julia">using HTTP, JSON, Dates
 
rosorg = "http://rosettacode.org"
qURI = "/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=json"
qdURI = "/w/api.php?action=query&list=categorymembers&cmtitle=Category:Draft_Programming_Tasks&cmlimit=500&format=json"
sqURI = rosorg * "/wiki/"
topages(js, v) = for d in js["query"]["categorymembers"] push!(v, sqURI * replace(d["title"], " " => "_")) end
 
function getpages(uri)
wikipages = Vector{String}()
response = HTTP.request("GET", rosorg * uri)
if response.status == 200
fromjson = JSON.parse(String(response.body))
topages(fromjson, wikipages)
while haskey(fromjson, "continue")
cmcont, cont = fromjson["continue"]["cmcontinue"], fromjson["continue"]["continue"]
response = HTTP.request("GET", rosorg * uri * "&cmcontinue=$cmcont&continue=$cont")
fromjson = JSON.parse(String(response.body))
topages(fromjson, wikipages)
end
end
wikipages
end
 
function processtaskpages(wpages, verbose=false)
totalexamples = 0
for pag in wpages
response = HTTP.request("GET", pag)
if response.status == 200
n = length(collect(eachmatch(r"span class=\"mw-headline\"", String(response.body))))
if verbose
println("Wiki page $pag => $n examples.")
end
totalexamples += n
end
end
println("Total of $totalexamples on $(length(wpages)) task pages.\n")
end
 
 
println("Programming examples at $(DateTime(now())):")
qURI |> getpages |> processtaskpages
 
println("Draft programming tasks:")
qdURI |> getpages |> processtaskpages
</syntaxhighlight>{{out}}
<pre>
Programming examples at 2019-02-16T21:04:15.583:
Total of 66388 on 928 task pages.
 
Draft programming tasks:
Total of 3385 on 216 task pages.
</pre>
 
=={{header|Lasso}}==
<langsyntaxhighlight Lassolang="lasso">local(root = json_deserialize(curl('http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=10&format=json')->result))
local(tasks = array, title = string, urltitle = string, thiscount = 0, totalex = 0)
with i in #root->find('query')->find('categorymembers') do => {^
Line 1,228 ⟶ 1,290:
'\r'
^}
'Total: '+#totalex+' examples.'</langsyntaxhighlight>
 
{{out}}
Line 1,250 ⟶ 1,312:
2. Add a text field called "tasks"
 
n.b. The list of tasks is limited to 10 for demo purposes<langsyntaxhighlight LiveCodelang="livecode">on mouseUp
put empty into fld "taskurls"
put URL "http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=10&format=xml" into apixml
Line 1,266 ⟶ 1,328:
end repeat
put "Total" & comma & allTaskTotal after fld "tasks"
end mouseUp</langsyntaxhighlight>
 
=={{header|Maple}}==
<syntaxhighlight lang="maple">ConvertUTF8 := proc( str )
local i, tempstring, uniindex;
try
tempstring := str;
uniindex := [StringTools:-SearchAll("\u",str)];
if uniindex <> [] then
for i in uniindex do
tempstring := StringTools:-Substitute(tempstring, str[i..i+5], UTF8:-unicode(str[i+2..i+5]));
end do:
end if;
return tempstring;
catch:
return str;
end try;
end proc:
print_examples := proc(lst)
local task, count, url, headers, item;
for task in lst do
count := 0:
url := cat("http://www.rosettacode.org/mw/index.php?title=", StringTools:-Encode(StringTools:-SubstituteAll(task["title"], " ", "_"), 'percent'), "&action=raw"):
headers := [StringTools:-SearchAll("=={{header|",URL:-Get(url))]:
for item in headers do
count++:
end do:
printf("%s has %d examples\n",ConvertUTF8(task["title"]), count);
end do:
end proc:
 
=={{header|Mathematica}}==
<lang Mathematica>TaskList = Flatten[
Import["http://rosettacode.org/wiki/Category:Programming_Tasks", "Data"][[1, 1]]];
 
x := JSON:-ParseFile("http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=20&format=json"):
print_examples(x["query"]["categorymembers"]);
while(assigned(x["continue"]["cmcontinue"])) do
continue := x["continue"]["cmcontinue"]:
more_tasks:= cat("http://rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=20&format=json", "&continue=", x["continue"]["continue"], "&cmcontinue=", x["continue"]["cmcontinue"]):
x := JSON:-ParseFile(more_tasks):
print_examples(x["query"]["categorymembers"]);
end do:
</syntaxhighlight>
{{Out|Output}}
<pre>
100 doors has 267 examples
15 Puzzle Game has 42 examples
15 puzzle solver has 4 examples
2048 has 34 examples
24 game has 88 examples
24 game/Solve has 54 examples
4-rings or 4-squares puzzle has 33 examples
9 billion names of God the integer has 42 examples
99 Bottles of Beer has 291 examples
A+B has 224 examples
ABC Problem has 104 examples
Abstract type has 77 examples
Abundant, deficient and perfect number classifications has 69 examples
Accumulator factory has 97 examples
Ackermann function has 194 examples
Active Directory/Connect has 24 examples
Active Directory/Search for a user has 16 examples
Active object has 37 examples
Add a variable to a class instance at runtime has 51 examples
Address of a variable has 69 examples
AKS test for primes has 55 examples
Align columns has 97 examples
Aliquot sequence classifications has 32 examples
Almost prime has 58 examples
Amb has 35 examples
Amicable pairs has 69 examples
Anagrams has 99 examples
Anagrams/Deranged anagrams has 63 examples
Angle difference between two bearings has 24 examples
Animate a pendulum has 55 examples
Animation has 61 examples
Anonymous recursion has 86 examples
Append a record to the end of a text file has 36 examples
Apply a callback to an array has 144 examples
Apply a digital filter (direct form II transposed) has 14 examples
Arbitrary-precision integers (included) has 84 examples
Archimedean spiral has 40 examples
Arena storage pool has 25 examples
Arithmetic evaluation has 51 examples
Arithmetic-geometric mean has 93 examples
Arithmetic-geometric mean/Calculate Pi has 23 examples
Arithmetic/Complex has 101 examples
Arithmetic/Integer has 176 examples
Arithmetic/Rational has 59 examples
Array concatenation has 159 examples
Array length has 124 examples
Arrays has 188 examples
Assertions has 96 examples
Associative array/Creation has 128 examples
Associative array/Iteration has 107 examples
Atomic updates has 38 examples
Average loop length has 34 examples
Averages/Arithmetic mean has 168 examples
Averages/Mean angle has 63 examples
Averages/Mean time of day has 50 examples
Averages/Median has 103 examples
Averages/Mode has 76 examples
Averages/Pythagorean means has 96 examples
Averages/Root mean square has 111 examples
Averages/Simple moving average has 78 examples
AVL tree has 18 examples
Babbage problem has 80 examples
Balanced brackets has 112 examples
Balanced ternary has 34 examples
Barnsley fern has 39 examples
Benford's law has 58 examples
Bernoulli numbers has 43 examples
...
Variable size/Set has 37 examples
Variable-length quantity has 35 examples
Variables has 109 examples
Variadic function has 94 examples
Vector products has 77 examples
Verify distribution uniformity/Chi-squared test has 21 examples
Verify distribution uniformity/Naive has 40 examples
Video display modes has 13 examples
Vigenère cipher has 0 examples
Vigenère cipher/Cryptanalysis has 0 examples
Visualize a tree has 35 examples
Vogel's approximation method has 12 examples
Voronoi diagram has 32 examples
Walk a directory/Non-recursively has 84 examples
Walk a directory/Recursively has 75 examples
Water collected between towers has 28 examples
Web scraping has 75 examples
Window creation has 81 examples
Window creation/X11 has 23 examples
Window management has 19 examples
Wireworld has 47 examples
Word search has 9 examples
Word wrap has 63 examples
World Cup group stage has 14 examples
Write entire file has 53 examples
Write float arrays to a text file has 64 examples
Write language name in 3D ASCII has 59 examples
Write to Windows event log has 23 examples
Xiaolin Wu's line algorithm has 25 examples
XML/DOM serialization has 45 examples
XML/Input has 68 examples
XML/Output has 55 examples
XML/XPath has 52 examples
Y combinator has 81 examples
Yahoo! search interface has 19 examples
Yin and yang has 53 examples
Zebra puzzle has 39 examples
Zeckendorf arithmetic has 10 examples
Zeckendorf number representation has 57 examples
Zero to the zero power has 94 examples
Zhang-Suen thinning algorithm has 26 examples
Zig-zag matrix has 92 examples
</pre>
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<syntaxhighlight lang="mathematica">TaskList = Flatten[
Import["http://rosettacode.org/wiki/Category:Programming_Tasks", "Data"][[1, 1]]];
Print["Task \"", StringReplace[#, "_" -> " "], "\" has ",
Length@Select[Import["http://rosettacode.org/wiki/" <> #, "Data"][[1,2]],
StringFreeQ[#, __ ~~ "Programming Task" | __ ~~ "Omit"]& ], " example(s)"]&
~Map~ StringReplace[TaskList, " " -> "_"]</langsyntaxhighlight>
returns:
<pre>Task "100 doors" has 143 example(s)
Line 1,285 ⟶ 1,499:
 
The function count_examples() need to be saved in a file count_examples.m and its directory need to be included in the path.
<langsyntaxhighlight MATLABlang="matlab"> function c = count_examples(url)
c = 0;
[s, success] = urlread (url);
Line 1,302 ⟶ 1,516:
c = count_examples(['http://rosettacode.org',t]);
printf('Task "%s" has %i examples.\n',t(7:end), c);
end; </langsyntaxhighlight>
 
Output:
Line 1,314 ⟶ 1,528:
 
=={{header|Nim}}==
<langsyntaxhighlight lang="nim">import httpclient, strutils, xmldomxmltree, xmldomparserxmlparser, cgi
 
proc count(s, sub: string): int =
var i = 0
while true:
i = s.find(sub, i)
if i < 0: break
break
inc i
inc result
 
const
mainSite = "http://www.rosettacode.org/wmw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"
subSite = "http://www.rosettacode.org/wmw/index.php?title=$#&action=raw"
 
var client = newHttpClient()
var sum = 0
for node in client.getContent(mainSite).parseXml().findAll("cm"):
let t = node.attr("title").replace(" ", "_")
let c = client.getContent(subSite % encodeUrl(t)).toLower().count("{{header|")
echo t.replace("_", " "), ": ", c, " examples."
inc sum, c
 
echo "\nTotal: ", sum, " examples."</syntaxhighlight>
for i in getContent(mainSite).loadXML().getElementsByTagName("cm"):
let t = PElement(i).getAttribute("title").replace(" ", "_")
let c = getContent(subSite % encodeUrl(t)).toLower().count("{{header|")
echo t.replace("_", " "),": ",c," examples."
sum += c
 
{{out}}
echo "\nTotal: ",sum," examples."</lang>
<pre>100 doors: 326 examples.
Output:
<pre>100 doorsprisoners: 19455 examples.
2415 puzzle game: 6871 examples.
2415 game/Solvepuzzle solver: 4018 examples.
9 billion names of God the integer2048: 2057 examples.
9921 Bottles of Beergame: 22537 examples.
A+B24 game: 159100 examples.
ABC24 Problemgame/Solve: 4264 examples.
Abstract4-rings typeor 4-squares puzzle: 6057 examples.
Accumulator9 factorybillion names of God the integer: 7860 examples.
Ackermann99 functionbottles of beer: 151347 examples.
Active Directory/ConnectA+B: 16278 examples.
Abbreviations, automatic: 39 examples.
Abbreviations, easy: 38 examples.
Abbreviations, simple: 36 examples.
ABC problem: 132 examples.
Abelian sandpile model: 25 examples.
Abelian sandpile model/Identity: 19 examples.
Abstract type: 89 examples.
Abundant odd numbers: 53 examples.
Abundant, deficient and perfect number classifications: 89 examples.
Accumulator factory: 111 examples
[...]</pre>
 
=={{header|Objeck}}==
<langsyntaxhighlight lang="objeck">use HTTP;
use XML;
 
Line 1,390 ⟶ 1,615:
return xml;
}
}</langsyntaxhighlight>
 
Output:<pre>Amb: 28
Line 1,423 ⟶ 1,648:
ocamlfind opt -linkpkg -package str,unix,xml-light,netclient countex.ml -o countex.opt
 
<langsyntaxhighlight lang="ocaml">open Http_client.Convenience
 
Line 1,484 ⟶ 1,709:
let catmb = get_child "categorymembers" query in
List.iter f catmb
| _ -> ()</langsyntaxhighlight>
 
outputs:
Line 1,511 ⟶ 1,736:
{{libheader|OzHttpClient}}
 
<langsyntaxhighlight lang="oz">declare
[HTTPClient] = {Module.link ['x-ozlib://mesaros/net/HTTPClient.ozf']}
[XMLParser] = {Module.link ['x-oz://system/xml/Parser.ozf']}
Line 1,595 ⟶ 1,820:
end
in
{Main}</langsyntaxhighlight>
 
Example output:
Line 1,613 ⟶ 1,838:
 
=={{header|Perl}}==
<langsyntaxhighlight Perllang="perl">use LWPHTTP::SimpleTiny;
 
my $site = "http://rosettacode.org";
my $list_url = "/mww/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml";
 
formy ($response = HTTP::Tiny->new->get("$site$list_url") =~ /cm.*?title="(.*?)"/g) {;
for ($response->{content} =~ /cm.*?title="(.*?)"/g) {
(my $slug = $_) =~ tr/ /_/;
my $count = ()response = HTTP::Tiny->new->get("$site/wiki/$slug") =~ /toclevel-1/g;
my $count = () = $response->{content} =~ /toclevel-1/g;
print "$_: $count examples\n";
}</langsyntaxhighlight>
 
{{libheader|Mojolicious}}
<syntaxhighlight lang="perl">use Mojo::UserAgent;
<lang Perl>use v5.10;
use Mojo::UserAgent;
 
my $site = "http://rosettacode.org";
Line 1,636 ⟶ 1,862:
my $count = $ua->get("$site/wiki/$slug")->res->dom->find("#toc .toclevel-1")->size;
say "$_->{title}: $count examples";
});</langsyntaxhighlight>
=={{header|Perl 6}}==
{{works with|Rakudo|2018.03}}
Retrieves counts for both Tasks and Draft Tasks. Save / Display results as a sortable wikitable rather than a static list. Click on a column header to sort on that column. To do a secondary sort, hold down the shift key and click on a second column header. Tasks have a gray (default) background, Draft Tasks have a yellow background.
<lang perl6>use HTTP::UserAgent;
use URI::Escape;
use JSON::Fast;
 
=={{header|Phix}}==
class Progress-Bar {
First, some common code used by several tasks:
has $.width = 40;
<!--<syntaxhighlight lang="phix">(notonline)-->
has $.count is rw = 0;
<span style="color: #000080;font-style:italic;">--
has @!bar = < ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ >;
-- demo\rosetta\rosettacode_cache.e
 
-- ================================
method inc {
--
($.count += 1) mod= $.width * 8;
-- Common routines for handling rc_cache etc.
self.clear ~ @!bar.tail x $.count div 8 ~ @!bar[ $.count % 8 ]
--</span>
~ ' ' x $.width - 1 - ($.count / 8).floor
<span style="color: #008080;">without</span> <span style="color: #008080;">js</span> <span style="color: #000080;font-style:italic;">-- (libcurl, file i/o, peek, progress..)</span>
}
<span style="color: #008080;">include</span> <span style="color: #000000;">builtins</span><span style="color: #0000FF;">\</span><span style="color: #004080;">timedate</span><span style="color: #0000FF;">.</span><span style="color: #000000;">e</span>
 
<span style="color: #008080;">constant</span> <span style="color: #000000;">day</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">timedelta</span><span style="color: #0000FF;">(</span><span style="color: #000000;">days</span><span style="color: #0000FF;">:=</span><span style="color: #000000;">1</span><span style="color: #0000FF;">)</span>
method clear {
<span style="color: #004080;">integer</span> <span style="color: #000000;">refresh_cache</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">21</span><span style="color: #0000FF;">*</span><span style="color: #000000;">day</span> <span style="color: #000080;font-style:italic;">-- 0 for always [NB refresh_cache += timedelta(days:=1) below]</span>
"\r" ~ ' ' x $.width ~ "\r"
}
<span style="color: #008080;">function</span> <span style="color: #000000;">days</span><span style="color: #0000FF;">(</span><span style="color: #004080;">atom</span> <span style="color: #000000;">delta</span><span style="color: #0000FF;">)</span>
}
<span style="color: #004080;">integer</span> <span style="color: #000000;">d</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">ceil</span><span style="color: #0000FF;">(</span><span style="color: #000000;">delta</span><span style="color: #0000FF;">/</span><span style="color: #000000;">day</span><span style="color: #0000FF;">)</span>
 
<span style="color: #008080;">return</span> <span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%d day%s"</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">d</span><span style="color: #0000FF;">,</span><span style="color: #008080;">iff</span><span style="color: #0000FF;">(</span><span style="color: #000000;">d</span><span style="color: #0000FF;">=</span><span style="color: #000000;">1</span><span style="color: #0000FF;">?</span><span style="color: #008000;">""</span><span style="color: #0000FF;">:</span><span style="color: #008000;">"s"</span><span style="color: #0000FF;">)})</span>
# Friendlier descriptions for task categories
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
my %cat = (
'Programming_Tasks' => 'Task',
<span style="color: #008080;">constant</span> <span style="color: #0000FF;">{</span><span style="color: #000000;">hex</span><span style="color: #0000FF;">,</span><span style="color: #000000;">ascii</span><span style="color: #0000FF;">}</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">columnize</span><span style="color: #0000FF;">({{</span><span style="color: #008000;">"%22"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">`"`</span><span style="color: #0000FF;">},</span>
'Draft_Programming_Tasks' => 'Draft'
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%27"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"'"</span><span style="color: #0000FF;">},</span>
);
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%2A"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"*"</span><span style="color: #0000FF;">},</span>
 
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%2B"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"+"</span><span style="color: #0000FF;">},</span>
my $client = HTTP::UserAgent.new;
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%3A"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">":"</span><span style="color: #0000FF;">},</span>
 
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%5E"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">`^`</span><span style="color: #0000FF;">},</span>
my $url = 'http://rosettacode.org/mw';
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%E2%80%93"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"-"</span><span style="color: #0000FF;">},</span>
 
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%E2%80%99"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"'"</span><span style="color: #0000FF;">},</span>
my $hashfile = './RC_Task_count.json';
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%C3%A8"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"e"</span><span style="color: #0000FF;">},</span>
my $tablefile = './RC_Task_count.txt';
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%C3%A9"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"e"</span><span style="color: #0000FF;">},</span>
 
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%C3%B6"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"o"</span><span style="color: #0000FF;">},</span>
my %tasks;
<span style="color: #0000FF;">{</span><span style="color: #008000;">"%C5%91"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"o"</span><span style="color: #0000FF;">},</span>
 
<span style="color: #0000FF;">{</span><span style="color: #008000;">"&quot;"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">`"`</span><span style="color: #0000FF;">},</span>
#=begin update
<span style="color: #0000FF;">{</span><span style="color: #008000;">"&#039;"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"'"</span><span style="color: #0000FF;">},</span>
 
<span style="color: #0000FF;">{</span><span style="color: #008000;">"_"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">" "</span><span style="color: #0000FF;">}})</span>
note 'Retrieving task information...';
 
<span style="color: #008080;">global</span> <span style="color: #008080;">function</span> <span style="color: #000000;">html_clean</span><span style="color: #0000FF;">(</span><span style="color: #004080;">string</span> <span style="color: #000000;">s</span><span style="color: #0000FF;">)</span>
my $progress = Progress-Bar.new(width => 79);
<span style="color: #008080;">return</span> <span style="color: #7060A8;">substitute_all</span><span style="color: #0000FF;">(</span><span style="color: #000000;">s</span><span style="color: #0000FF;">,</span><span style="color: #000000;">hex</span><span style="color: #0000FF;">,</span><span style="color: #000000;">ascii</span><span style="color: #0000FF;">)</span>
 
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
for %cat.keys -> $cat {
mediawiki-query(
<span style="color: #008080;">include</span> <span style="color: #000000;">builtins</span><span style="color: #0000FF;">\</span><span style="color: #000000;">libcurl</span><span style="color: #0000FF;">.</span><span style="color: #000000;">e</span>
$url, 'pages',
<span style="color: #004080;">atom</span> <span style="color: #000000;">curl</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">NULL</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">pErrorBuffer</span>
:generator<categorymembers>,
:gcmtitle("Category:$cat"),
<span style="color: #008080;">function</span> <span style="color: #000000;">write_callback</span><span style="color: #0000FF;">(</span><span style="color: #004080;">atom</span> <span style="color: #000000;">pData</span><span style="color: #0000FF;">,</span> <span style="color: #004080;">integer</span> <span style="color: #000000;">size</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">nmemb</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">fn</span><span style="color: #0000FF;">)</span>
:gcmlimit<350>,
<span style="color: #004080;">integer</span> <span style="color: #000000;">bytes_written</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">size</span> <span style="color: #0000FF;">*</span> <span style="color: #000000;">nmemb</span>
:rawcontinue(),
<span style="color: #7060A8;">puts</span><span style="color: #0000FF;">(</span><span style="color: #000000;">fn</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">peek</span><span style="color: #0000FF;">({</span><span style="color: #000000;">pData</span><span style="color: #0000FF;">,</span><span style="color: #000000;">bytes_written</span><span style="color: #0000FF;">}))</span>
:prop<title>
<span style="color: #008080;">return</span> <span style="color: #000000;">bytes_written</span>
).map({
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
my $page =
<span style="color: #008080;">constant</span> <span style="color: #000000;">write_cb</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">call_back</span><span style="color: #0000FF;">({</span><span style="color: #008000;">'+'</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">write_callback</span><span style="color: #0000FF;">})</span>
$client.get("{ $url }/index.php?title={ uri-escape .<title> }&action=raw").content;
my $count = +$page.comb(/ ^^'==' <-[\n=]>* '{{header|' \w+ \N+ '==' \h* $$ /);
<span style="color: #008080;">global</span> <span style="color: #004080;">string</span> <span style="color: #000000;">wastitle</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""</span> <span style="color: #000080;font-style:italic;">-- don't clobber "NEED EDITING"/Downloading messages</span>
%tasks{.<title>} = {'cat' => %cat{$cat}, :$count};
<span style="color: #008080;">global</span> <span style="color: #004080;">integer</span> <span style="color: #000000;">show_title</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">progress</span>
print $progress.inc;
})
<span style="color: #008080;">global</span> <span style="color: #008080;">function</span> <span style="color: #000000;">open_download</span><span style="color: #0000FF;">(</span><span style="color: #004080;">string</span> <span style="color: #000000;">filename</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">url</span><span style="color: #0000FF;">,</span> <span style="color: #004080;">integer</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">=</span><span style="color: #000000;">0</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">n</span><span style="color: #0000FF;">=</span><span style="color: #000000;">0</span><span style="color: #0000FF;">)</span>
}
<span style="color: #004080;">object</span> <span style="color: #000000;">text</span>
 
<span style="color: #004080;">bool</span> <span style="color: #000000;">refetch</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">false</span>
print $progress.clear;
<span style="color: #004080;">string</span> <span style="color: #000000;">why</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"not found"</span>
 
<span style="color: #000000;">filename</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">join_path</span><span style="color: #0000FF;">({</span><span style="color: #008000;">"rc_cache"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">})</span>
note "\nTask information saved to local file: {$hashfile.IO.absolute}";
<span style="color: #008080;">if</span> <span style="color: #7060A8;">file_exists</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
$hashfile.IO.spurt(%tasks.&to-json);
<span style="color: #000080;font-style:italic;">-- use existing file if &lt;= refresh_cache days old</span>
 
<span style="color: #004080;">sequence</span> <span style="color: #000000;">last_mod</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">get_file_date</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">)</span>
#=end update
<span style="color: #004080;">atom</span> <span style="color: #000000;">delta</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">timedate_diff</span><span style="color: #0000FF;">(</span><span style="color: #000000;">last_mod</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">date</span><span style="color: #0000FF;">())</span>
 
<span style="color: #000000;">refetch</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">true</span>
# Load information from local file
<span style="color: #008080;">if</span> <span style="color: #000000;">delta</span><span style="color: #0000FF;">></span><span style="color: #000000;">refresh_cache</span>
%tasks = $hashfile.IO.e ?? $hashfile.IO.slurp.&from-json !! ( );
<span style="color: #008080;">and</span> <span style="color: #008080;">not</span> <span style="color: #7060A8;">match</span><span style="color: #0000FF;">(</span><span style="color: #008000;">".hist"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
 
<span style="color: #000000;">why</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">days</span><span style="color: #0000FF;">(</span><span style="color: #000000;">delta</span><span style="color: #0000FF;">)</span> <span style="color: #0000FF;">&</span> <span style="color: #008000;">" &gt; "</span> <span style="color: #0000FF;">&</span> <span style="color: #000000;">days</span><span style="color: #0000FF;">(</span><span style="color: #000000;">refresh_cache</span><span style="color: #0000FF;">)</span>
# Convert saved task / author info to a table
<span style="color: #008080;">elsif</span> <span style="color: #7060A8;">get_file_size</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">)=</span><span style="color: #000000;">0</span> <span style="color: #008080;">then</span>
note "\nBuilding table...";
<span style="color: #000000;">why</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"filesize of 0"</span>
my $count = +%tasks;
<span style="color: #008080;">else</span>
my $taskcnt = +%tasks.grep: *.value.<cat> eq %cat<Programming_Tasks>;
<span style="color: #000000;">text</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">trim</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">get_text</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">))</span>
my $draftcnt = $count - $taskcnt;
<span style="color: #008080;">if</span> <span style="color: #008080;">not</span> <span style="color: #004080;">sequence</span><span style="color: #0000FF;">(</span><span style="color: #000000;">text</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
my $total = sum %tasks{*}»<count>;
<span style="color: #000000;">why</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"no text"</span>
 
<span style="color: #008080;">elsif</span> <span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">text</span><span style="color: #0000FF;">)<</span><span style="color: #000000;">10</span> <span style="color: #008080;">then</span>
# Dump table to a file
<span style="color: #000000;">why</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"&lt;10 bytes"</span>
my $out = open($tablefile, :w) or die "$!\n";
<span style="color: #008080;">else</span>
 
<span style="color: #000000;">refetch</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">false</span>
# Add table boilerplate and caption
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
$out.say:
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
'<div style="height:80ex;overflow:scroll;">', "\n",
<span style="color: #008080;">else</span>
'{|class="wikitable sortable"', "\n",
<span style="color: #000000;">refetch</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">true</span>
"|+ As of { Date.today } :: Tasks: { $taskcnt } :: Draft Tasks: ",
<span style="color: #004080;">string</span> <span style="color: #000000;">directory</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">get_file_path</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">)</span>
"{ $draftcnt } :: Total Tasks: { $count } :: Total Examples: { $total }\n",
<span style="color: #008080;">if</span> <span style="color: #7060A8;">get_file_type</span><span style="color: #0000FF;">(</span><span style="color: #000000;">directory</span><span style="color: #0000FF;">)!=</span><span style="color: #004600;">FILETYPE_DIRECTORY</span> <span style="color: #008080;">then</span>
"! Count !! Task !! Category"
<span style="color: #008080;">if</span> <span style="color: #008080;">not</span> <span style="color: #000000;">create_directory</span><span style="color: #0000FF;">(</span><span style="color: #000000;">directory</span><span style="color: #0000FF;">,</span><span style="color: #000000;">make_parent</span><span style="color: #0000FF;">:=</span><span style="color: #004600;">true</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
;
<span style="color: #7060A8;">crash</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"cannot create %s directory"</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">directory</span><span style="color: #0000FF;">})</span>
 
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
# Sort tasks by count then add row
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
for %tasks.sort: { [-.value<count>, .key] } -> $task {
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
$out.say:
<span style="color: #008080;">if</span> <span style="color: #000000;">refetch</span> <span style="color: #008080;">then</span>
( $task.value<cat> eq 'Draft'
<span style="color: #000000;">wastitle</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"x"</span> <span style="color: #000080;font-style:italic;">-- don't clobber</span>
?? "|- style=\"background-color: #ffc\"\n"
<span style="color: #004080;">string</span> <span style="color: #000000;">nofn</span> <span style="color: #0000FF;">=</span> <span style="color: #008080;">iff</span><span style="color: #0000FF;">(</span><span style="color: #000000;">n</span><span style="color: #0000FF;">?</span><span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"(%d/%d, %.1f%%) "</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">i</span><span style="color: #0000FF;">,</span><span style="color: #000000;">n</span><span style="color: #0000FF;">,</span><span style="color: #000000;">i</span><span style="color: #0000FF;">/</span><span style="color: #000000;">n</span><span style="color: #0000FF;">*</span><span style="color: #000000;">100</span><span style="color: #0000FF;">}):</span><span style="color: #008000;">""</span><span style="color: #0000FF;">),</span>
!! "|-\n"
<span style="color: #000000;">title</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"Downloading %s%s (%s)..."</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">nofn</span><span style="color: #0000FF;">,</span><span style="color: #000000;">html_clean</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">),</span><span style="color: #000000;">why</span><span style="color: #0000FF;">})</span>
),
<span style="color: #000000;">show_title</span><span style="color: #0000FF;">(</span><span style="color: #000000;">title</span><span style="color: #0000FF;">)</span>
"| { $task.value<count> }\n",
<span style="color: #008080;">if</span> <span style="color: #000000;">curl</span><span style="color: #0000FF;">=</span><span style="color: #004600;">NULL</span> <span style="color: #008080;">then</span>
( $task.key ~~ /\d/
<span style="color: #7060A8;">curl_global_init</span><span style="color: #0000FF;">()</span>
?? "|data-sort-value=\"{ $task.key.&naturally }\"| [[{uri-escape $task.key}|{$task.key}]]\n"
<span style="color: #000000;">curl</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">curl_easy_init</span><span style="color: #0000FF;">()</span>
!! "| [[{uri-escape $task.key}|{$task.key}]]\n"
<span style="color: #000000;">pErrorBuffer</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">allocate</span><span style="color: #0000FF;">(</span><span style="color: #000000;">CURL_ERROR_SIZE</span><span style="color: #0000FF;">)</span>
),
<span style="color: #7060A8;">curl_easy_setopt</span><span style="color: #0000FF;">(</span><span style="color: #000000;">curl</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">CURLOPT_ERRORBUFFER</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">pErrorBuffer</span><span style="color: #0000FF;">)</span>
"| { $task.value<cat> }"
<span style="color: #7060A8;">curl_easy_setopt</span><span style="color: #0000FF;">(</span><span style="color: #000000;">curl</span><span style="color: #0000FF;">,</span> <span style="color: #004600;">CURLOPT_WRITEFUNCTION</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">write_cb</span><span style="color: #0000FF;">)</span>
}
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
 
<span style="color: #000000;">url</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">substitute</span><span style="color: #0000FF;">(</span><span style="color: #000000;">url</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"%3A"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">":"</span><span style="color: #0000FF;">)</span>
$out.say( "|}\n", '</div>' );
<span style="color: #000000;">url</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">substitute</span><span style="color: #0000FF;">(</span><span style="color: #000000;">url</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"%2A"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"*"</span><span style="color: #0000FF;">)</span>
$out.close;
<span style="color: #7060A8;">curl_easy_setopt</span><span style="color: #0000FF;">(</span><span style="color: #000000;">curl</span><span style="color: #0000FF;">,</span> <span style="color: #004600;">CURLOPT_URL</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">url</span><span style="color: #0000FF;">)</span>
 
<span style="color: #004080;">integer</span> <span style="color: #000000;">fn</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">open</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"wb"</span><span style="color: #0000FF;">)</span>
note "Table file saved as: {$tablefile.IO.absolute}";
<span style="color: #7060A8;">assert</span><span style="color: #0000FF;">(</span><span style="color: #000000;">fn</span><span style="color: #0000FF;">!=-</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"cannot open "</span><span style="color: #0000FF;">&</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">)</span>
 
<span style="color: #7060A8;">curl_easy_setopt</span><span style="color: #0000FF;">(</span><span style="color: #000000;">curl</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">CURLOPT_WRITEDATA</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">fn</span><span style="color: #0000FF;">)</span>
sub mediawiki-query ($site, $type, *%query) {
<span style="color: #008080;">while</span> <span style="color: #004600;">true</span> <span style="color: #008080;">do</span>
my $url = "$site/api.php?" ~ uri-query-string(
<span style="color: #004080;">CURLcode</span> <span style="color: #000000;">res</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">curl_easy_perform</span><span style="color: #0000FF;">(</span><span style="color: #000000;">curl</span><span style="color: #0000FF;">)</span>
:action<query>, :format<json>, :formatversion<2>, |%query);
<span style="color: #008080;">if</span> <span style="color: #000000;">res</span><span style="color: #0000FF;">=</span><span style="color: #004600;">CURLE_OK</span> <span style="color: #008080;">then</span> <span style="color: #008080;">exit</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
my $continue = '';
<span style="color: #004080;">string</span> <span style="color: #000000;">error</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%d"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">res</span><span style="color: #0000FF;">)</span>
 
<span style="color: #008080;">if</span> <span style="color: #000000;">res</span><span style="color: #0000FF;">=</span><span style="color: #000000;">CURLE_COULDNT_RESOLVE_HOST</span> <span style="color: #008080;">then</span>
gather loop {
<span style="color: #000000;">error</span> <span style="color: #0000FF;">&=</span> <span style="color: #008000;">" [CURLE_COULDNT_RESOLVE_HOST]"</span>
my $response = $client.get("$url&$continue");
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
my $data = from-json($response.content);
<span style="color: #7060A8;">progress</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"Error %s downloading file, retry?(Y/N):"</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">error</span><span style="color: #0000FF;">})</span>
take $_ for $data.<query>.{$type}.values;
<span style="color: #008080;">if</span> <span style="color: #7060A8;">lower</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">wait_key</span><span style="color: #0000FF;">())!=</span><span style="color: #008000;">'y'</span> <span style="color: #008080;">then</span> <span style="color: #7060A8;">abort</span><span style="color: #0000FF;">(</span><span style="color: #000000;">0</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
$continue = uri-query-string |($data.<query-continue>{*}».hash.hash or last);
<span style="color: #7060A8;">printf</span><span style="color: #0000FF;">(</span><span style="color: #000000;">1</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"Y\n"</span><span style="color: #0000FF;">)</span>
}
<span style="color: #008080;">end</span> <span style="color: #008080;">while</span>
}
<span style="color: #7060A8;">close</span><span style="color: #0000FF;">(</span><span style="color: #000000;">fn</span><span style="color: #0000FF;">)</span>
 
<span style="color: #000000;">refresh_cache</span> <span style="color: #0000FF;">+=</span> <span style="color: #7060A8;">timedelta</span><span style="color: #0000FF;">(</span><span style="color: #000000;">days</span><span style="color: #0000FF;">:=</span><span style="color: #000000;">1</span><span style="color: #0000FF;">)</span> <span style="color: #000080;font-style:italic;">-- did I mention it is slow?</span>
sub uri-query-string (*%fields) { %fields.map({ "{.key}={uri-escape .value}" }).join("&") }
<span style="color: #000000;">text</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">get_text</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">)</span>
 
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
sub naturally ($a) { $a.lc.subst(/(\d+)/, ->$/ {0~(65+$0.chars).chr~$0},:g) }
<span style="color: #008080;">return</span> <span style="color: #000000;">text</span>
</lang>
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
 
{{out}}
<span style="color: #008080;">global</span> <span style="color: #008080;">function</span> <span style="color: #000000;">open_category</span><span style="color: #0000FF;">(</span><span style="color: #004080;">string</span> <span style="color: #000000;">filename</span><span style="color: #0000FF;">,</span> <span style="color: #004080;">integer</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">=</span><span style="color: #000000;">0</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">n</span><span style="color: #0000FF;">=</span><span style="color: #000000;">0</span><span style="color: #0000FF;">)</span>
<div style="height:80ex;overflow:scroll;">
<span style="color: #008080;">return</span> <span style="color: #000000;">open_download</span><span style="color: #0000FF;">(</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">&</span><span style="color: #008000;">".htm"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"http://rosettacode.org/wiki/Category:"</span><span style="color: #0000FF;">&</span><span style="color: #000000;">filename</span><span style="color: #0000FF;">,</span><span style="color: #000000;">i</span><span style="color: #0000FF;">,</span><span style="color: #000000;">n</span><span style="color: #0000FF;">)</span>
{|class="wikitable sortable"
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
|+ As of 2018-03-30 :: Tasks: 871 :: Draft Tasks: 209 :: Total Tasks: 1080 :: Total Examples: 55684
! Count !! Task !! Category
<span style="color: #008080;">global</span> <span style="color: #008080;">function</span> <span style="color: #000000;">dewiki</span><span style="color: #0000FF;">(</span><span style="color: #004080;">string</span> <span style="color: #000000;">s</span><span style="color: #0000FF;">,</span> <span style="color: #004080;">sequence</span> <span style="color: #000000;">exclude</span><span style="color: #0000FF;">={})</span>
|-
<span style="color: #000080;font-style:italic;">-- extract tasks from eg `&lt;li&gt;&lt;a href="/wiki/100_doors"`</span>
| 382
<span style="color: #004080;">sequence</span> <span style="color: #000000;">tasks</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{}</span>
| [[Hello%20world%2FText|Hello world/Text]]
<span style="color: #004080;">integer</span> <span style="color: #000000;">start</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">1</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">finish</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">match</span><span style="color: #0000FF;">(</span><span style="color: #008000;">`&lt;div class="printfooter"&gt;`</span><span style="color: #0000FF;">,</span><span style="color: #000000;">s</span><span style="color: #0000FF;">)</span>
| Task
<span style="color: #000000;">s</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">s</span><span style="color: #0000FF;">[</span><span style="color: #000000;">1</span><span style="color: #0000FF;">..</span><span style="color: #000000;">finish</span><span style="color: #0000FF;">-</span><span style="color: #000000;">1</span><span style="color: #0000FF;">]</span>
|-
<span style="color: #008080;">while</span> <span style="color: #004600;">true</span> <span style="color: #008080;">do</span>
| 270
<span style="color: #000000;">start</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">match</span><span style="color: #0000FF;">(</span><span style="color: #008000;">`&lt;li&gt;&lt;a href="/wiki/`</span><span style="color: #0000FF;">,</span><span style="color: #000000;">s</span><span style="color: #0000FF;">,</span><span style="color: #000000;">start</span><span style="color: #0000FF;">)</span>
|data-sort-value="0C99 bottles of beer"| [[99%20Bottles%20of%20Beer|99 Bottles of Beer]]
<span style="color: #008080;">if</span> <span style="color: #000000;">start</span><span style="color: #0000FF;">=</span><span style="color: #000000;">0</span> <span style="color: #008080;">then</span> <span style="color: #008080;">exit</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| Task
<span style="color: #000000;">start</span> <span style="color: #0000FF;">+=</span> <span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #008000;">`&lt;li&gt;&lt;a href="/wiki/`</span><span style="color: #0000FF;">)</span>
|-
<span style="color: #000000;">finish</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">find</span><span style="color: #0000FF;">(</span><span style="color: #008000;">'"'</span><span style="color: #0000FF;">,</span><span style="color: #000000;">s</span><span style="color: #0000FF;">,</span><span style="color: #000000;">start</span><span style="color: #0000FF;">)</span>
| 262
<span style="color: #004080;">string</span> <span style="color: #000000;">task</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">s</span><span style="color: #0000FF;">[</span><span style="color: #000000;">start</span><span style="color: #0000FF;">..</span><span style="color: #000000;">finish</span><span style="color: #0000FF;">-</span><span style="color: #000000;">1</span><span style="color: #0000FF;">]</span>
|data-sort-value="0D100 doors"| [[100%20doors|100 doors]]
<span style="color: #000000;">task</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">substitute_all</span><span style="color: #0000FF;">(</span><span style="color: #000000;">task</span><span style="color: #0000FF;">,{</span><span style="color: #008000;">"*"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">":"</span><span style="color: #0000FF;">},{</span><span style="color: #008000;">"%2A"</span><span style="color: #0000FF;">,</span><span style="color: #008000;">"%3A"</span><span style="color: #0000FF;">})</span>
| Task
<span style="color: #000000;">tasks</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">append</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">,</span><span style="color: #000000;">task</span><span style="color: #0000FF;">)</span>
|-
<span style="color: #000000;">start</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">finish</span><span style="color: #0000FF;">+</span><span style="color: #000000;">1</span>
| 262
<span style="color: #008080;">end</span> <span style="color: #008080;">while</span>
| [[FizzBuzz|FizzBuzz]]
<span style="color: #008080;">return</span> <span style="color: #000000;">tasks</span>
| Task
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
|-
| 239
<span style="color: #008080;">global</span> <span style="color: #008080;">procedure</span> <span style="color: #000000;">curl_cleanup</span><span style="color: #0000FF;">()</span>
| [[Comments|Comments]]
<span style="color: #008080;">if</span> <span style="color: #000000;">curl</span><span style="color: #0000FF;">!=</span><span style="color: #004600;">NULL</span> <span style="color: #008080;">then</span>
| Task
<span style="color: #7060A8;">curl_easy_cleanup</span><span style="color: #0000FF;">(</span><span style="color: #000000;">curl</span><span style="color: #0000FF;">)</span>
|-
<span style="color: #7060A8;">free</span><span style="color: #0000FF;">(</span><span style="color: #000000;">pErrorBuffer</span><span style="color: #0000FF;">)</span>
| 239
<span style="color: #000000;">curl</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">NULL</span>
| [[Fibonacci%20sequence|Fibonacci sequence]]
<span style="color: #000000;">pErrorBuffer</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">NULL</span>
| Task
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
|-
<span style="color: #008080;">end</span> <span style="color: #008080;">procedure</span>
| 230
<!--</syntaxhighlight>-->
| [[Factorial|Factorial]]
The task itself:
| Task
<!--<syntaxhighlight lang="phix">(notonline)-->
|-
<span style="color: #000080;font-style:italic;">--
| 215
-- demo\rosetta\Count_examples.exw
| [[Empty%20program|Empty program]]
-- ===============================
| Task
| --
-- (This uses a few '&' instead of/as well as 'a', fairly obviously for everyone's sanity..)
| 214
-- Counts no of "<nowiki>{{</nowiki>he&der|" (nb not "==<nowiki>{{</nowiki>he&der|") via web api (but gets tasks via scraping).
| [[A%2BB|A+B]]
-- Since downloading all the pages can be very slow, this uses a cache.
| Task
-- Limiting (notdone) by "Phix" fairly obviously speeds it up tenfold :-)
|-
--</span>
| 207
<span style="color: #008080;">without</span> <span style="color: #008080;">js</span> <span style="color: #000080;font-style:italic;">-- (fairly obviously this will never ever run in a browser!)</span>
| [[Function%20definition|Function definition]]
<span style="color: #008080;">constant</span> <span style="color: #000000;">include_drafts</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">true</span><span style="color: #0000FF;">,</span>
| Task
<span style="color: #000000;">sort_by_count</span> <span style="color: #0000FF;">=</span> <span style="color: #004600;">false</span><span style="color: #0000FF;">,</span>
|-
<span style="color: #000080;font-style:italic;">-- notlang = "Phix" -- or "" (ie a zero length string) for all</span>
| 194
<span style="color: #000000;">notlang</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""</span>
| [[Ackermann%20function|Ackermann function]]
| Task
<span style="color: #008080;">include</span> <span style="color: #000000;">rosettacode_cache</span><span style="color: #0000FF;">.</span><span style="color: #000000;">e</span>
|-
| 192
<span style="color: #008080;">function</span> <span style="color: #000000;">count_tasks</span><span style="color: #0000FF;">()</span>
| [[Loops%2FInfinite|Loops/Infinite]]
<span style="color: #008080;">if</span> <span style="color: #7060A8;">get_file_type</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"rc_cache"</span><span style="color: #0000FF;">)!=</span><span style="color: #004600;">FILETYPE_DIRECTORY</span> <span style="color: #008080;">then</span>
| Task
<span style="color: #008080;">if</span> <span style="color: #008080;">not</span> <span style="color: #000000;">create_directory</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"rc_cache"</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
|-
<span style="color: #7060A8;">crash</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"cannot create rc_cache directory"</span><span style="color: #0000FF;">)</span>
| 188
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| [[Loops%2FWhile|Loops/While]]
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| Task
<span style="color: #000080;font-style:italic;">-- note this lot use web scraping (as cribbed from a similar task) ...</span>
|-
<span style="color: #004080;">sequence</span> <span style="color: #000000;">tasks</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">dewiki</span><span style="color: #0000FF;">(</span><span style="color: #000000;">open_category</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"Programming_Tasks"</span><span style="color: #0000FF;">))</span>
| 185
<span style="color: #008080;">if</span> <span style="color: #000000;">include_drafts</span> <span style="color: #008080;">then</span>
| [[Reverse%20a%20string|Reverse a string]]
<span style="color: #000000;">tasks</span> <span style="color: #0000FF;">&=</span> <span style="color: #000000;">dewiki</span><span style="color: #0000FF;">(</span><span style="color: #000000;">open_category</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"Draft_Programming_Tasks"</span><span style="color: #0000FF;">))</span>
| Task
<span style="color: #000000;">tasks</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">sort</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">)</span>
|-
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| 184
<span style="color: #008080;">if</span> <span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">notlang</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">then</span>
| [[Arrays|Arrays]]
<span style="color: #000080;font-style:italic;">-- filter already done in specified language</span>
| Task
<span style="color: #004080;">string</span> <span style="color: #000000;">langurl</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">"http://rosettacode.org/wiki/Category:"</span><span style="color: #0000FF;">&</span><span style="color: #000000;">notlang</span>
|-
<span style="color: #004080;">sequence</span> <span style="color: #000000;">done</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">dewiki</span><span style="color: #0000FF;">(</span><span style="color: #000000;">open_download</span><span style="color: #0000FF;">(</span><span style="color: #000000;">notlang</span><span style="color: #0000FF;">&</span><span style="color: #008000;">".htm"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">langurl</span><span style="color: #0000FF;">))</span>
| 177
<span style="color: #004080;">integer</span> <span style="color: #000000;">k</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
| [[Loops%2FFor|Loops/For]]
<span style="color: #008080;">for</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">=</span><span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">do</span>
| Task
<span style="color: #004080;">string</span> <span style="color: #000000;">ti</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">tasks</span><span style="color: #0000FF;">[</span><span style="color: #000000;">i</span><span style="color: #0000FF;">]</span>
|-
<span style="color: #004080;">integer</span> <span style="color: #000000;">d</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">find</span><span style="color: #0000FF;">(</span><span style="color: #000000;">ti</span><span style="color: #0000FF;">,</span><span style="color: #000000;">done</span><span style="color: #0000FF;">)</span>
| 176
<span style="color: #008080;">if</span> <span style="color: #008080;">not</span> <span style="color: #000000;">d</span> <span style="color: #008080;">then</span>
| [[Greatest%20common%20divisor|Greatest common divisor]]
<span style="color: #000000;">k</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
| Task
<span style="color: #000000;">tasks</span><span style="color: #0000FF;">[</span><span style="color: #000000;">k</span><span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">ti</span>
|-
<span style="color: #008080;">else</span>
| 171
<span style="color: #000000;">done</span><span style="color: #0000FF;">[</span><span style="color: #000000;">d</span><span style="color: #0000FF;">..</span><span style="color: #000000;">d</span><span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{}</span>
| [[Arithmetic%2FInteger|Arithmetic/Integer]]
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| Task
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
|-
<span style="color: #000000;">tasks</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">tasks</span><span style="color: #0000FF;">[</span><span style="color: #000000;">1</span><span style="color: #0000FF;">..</span><span style="color: #000000;">k</span><span style="color: #0000FF;">]</span>
| 171
<span style="color: #000000;">done</span> <span style="color: #0000FF;">=</span> <span style="color: #0000FF;">{}</span>
| [[Conditional%20structures|Conditional structures]]
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| Task
<span style="color: #7060A8;">progress</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%d tasks found\n"</span><span style="color: #0000FF;">,{</span><span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">)})</span>
|-
<span style="color: #000080;font-style:italic;">-- ... whereas the individual tasks use the web api instead (3x smaller/faster)</span>
| 170
<span style="color: #004080;">integer</span> <span style="color: #000000;">total_count</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span>
| [[Greatest%20element%20of%20a%20list|Greatest element of a list]]
<span style="color: #004080;">sequence</span> <span style="color: #000000;">task_counts</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">repeat</span><span style="color: #0000FF;">(</span><span style="color: #000000;">0</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">))</span>
| Task
<span style="color: #008080;">for</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">=</span><span style="color: #000000;">1</span> <span style="color: #008080;">to</span> <span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">do</span>
|-
<span style="color: #004080;">string</span> <span style="color: #000000;">ti</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">tasks</span><span style="color: #0000FF;">[</span><span style="color: #000000;">i</span><span style="color: #0000FF;">],</span>
| 167
<span style="color: #000000;">url</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">sprintf</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"http://rosettacode.org/mw/index.php?title=%s&action=raw"</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">ti</span><span style="color: #0000FF;">}),</span>
| [[Averages%2FArithmetic%20mean|Averages/Arithmetic mean]]
<span style="color: #000000;">contents</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">open_download</span><span style="color: #0000FF;">(</span><span style="color: #000000;">ti</span><span style="color: #0000FF;">&</span><span style="color: #008000;">".raw"</span><span style="color: #0000FF;">,</span><span style="color: #000000;">url</span><span style="color: #0000FF;">),</span>
| Task
<span style="color: #000000;">prev</span> <span style="color: #0000FF;">=</span> <span style="color: #008000;">""</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">curr</span>
|-
<span style="color: #004080;">integer</span> <span style="color: #000000;">count</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">0</span><span style="color: #0000FF;">,</span> <span style="color: #000000;">start</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">1</span>
| 162
<span style="color: #008080;">while</span> <span style="color: #004600;">true</span> <span style="color: #008080;">do</span>
| [[Integer%20comparison|Integer comparison]]
<span style="color: #000000;">start</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">match</span><span style="color: #0000FF;">(</span><span style="color: #008000;">`<nowiki>{{</nowiki>hea`</span><span style="color: #0000FF;">&</span><span style="color: #008000;">`der|`</span><span style="color: #0000FF;">,</span><span style="color: #000000;">contents</span><span style="color: #0000FF;">,</span><span style="color: #000000;">start</span><span style="color: #0000FF;">)</span>
| Task
<span style="color: #008080;">if</span> <span style="color: #000000;">start</span><span style="color: #0000FF;">=</span><span style="color: #000000;">0</span> <span style="color: #008080;">then</span> <span style="color: #008080;">exit</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
|-
<span style="color: #000080;font-style:italic;">--
| 158
-- skip duplicates/we also have to cope with eg
| [[Increment%20a%20numerical%20string|Increment a numerical string]]
-- ==<nowiki>{{</nowiki>he&der|Python<nowiki>}}</nowiki>== \
| Task
-- ===<nowiki>{{</nowiki>he&der|Python<nowiki>}}</nowiki> Original=== } count
|-
-- ===<nowiki>{{</nowiki>he&der|Python<nowiki>}}</nowiki> Succinct=== } once
| 158
-- ===<nowiki>{{</nowiki>he&der|Python<nowiki>}}</nowiki> Recursive === /
| [[Repeat%20a%20string|Repeat a string]]
-- ==<nowiki>{{</nowiki>he&der|Mathematica<nowiki>}}</nowiki> / <nowiki>{{</nowiki>he&der|Wolfram Language<nowiki>}}</nowiki>== \
| Task
-- ==<nowiki>{{</nowiki>he&der|Icon<nowiki>}}</nowiki> and <nowiki>{{</nowiki>he&der|Unicon<nowiki>}}</nowiki>== } count
|-
-- == <nowiki>{{</nowiki>he&der|Icon<nowiki>}}</nowiki> and <nowiki>{{</nowiki>he&der|Unicon<nowiki>}}</nowiki> == / both
| 157
-- == <nowiki>{{</nowiki>he&der|Java<nowiki>}}</nowiki>==
| [[Loops%2FDownward%20for|Loops/Downward for]]
-- etc. Note however that this /does/ count eg
| Task
-- ===<nowiki>{{</nowiki>he&der|Applesoft BASIC<nowiki>}}</nowiki>=== \
|-
-- ===<nowiki>{{</nowiki>he&der|BASIC256<nowiki>}}</nowiki>=== } count
| 156
-- ===<nowiki>{{</nowiki>he&der|Commodore BASIC<nowiki>}}</nowiki>=== } 'em
| [[Array%20concatenation|Array concatenation]]
-- ===<nowiki>{{</nowiki>he&der|IS-BASIC<nowiki>}}</nowiki>=== } all
| Task
-- ===<nowiki>{{</nowiki>he&der|Sinclair ZX81 BASIC<nowiki>}}</nowiki>=== /
|-
--</span>
| 156
<span style="color: #000000;">curr</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">contents</span><span style="color: #0000FF;">[</span><span style="color: #000000;">start</span><span style="color: #0000FF;">..</span><span style="color: #7060A8;">match</span><span style="color: #0000FF;">(</span><span style="color: #008000;">`<nowiki>}}</nowiki>`</span><span style="color: #0000FF;">,</span><span style="color: #000000;">contents</span><span style="color: #0000FF;">,</span><span style="color: #000000;">start</span><span style="color: #0000FF;">+</span><span style="color: #000000;">1</span><span style="color: #0000FF;">)]</span>
| [[Boolean%20values|Boolean values]]
<span style="color: #008080;">if</span> <span style="color: #000000;">curr</span><span style="color: #0000FF;">!=</span><span style="color: #000000;">prev</span> <span style="color: #008080;">then</span>
| Task
<span style="color: #000000;">count</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
|-
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| 152
<span style="color: #000000;">prev</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">curr</span>
| [[Loops%2FFor%20with%20a%20specified%20step|Loops/For with a specified step]]
<span style="color: #000000;">start</span> <span style="color: #0000FF;">+=</span> <span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #008000;">`<nowiki>{{</nowiki>hea`</span><span style="color: #0000FF;">&</span><span style="color: #008000;">`der|`</span><span style="color: #0000FF;">)</span>
| Task
<span style="color: #008080;">end</span> <span style="color: #008080;">while</span>
|-
<span style="color: #008080;">if</span> <span style="color: #000000;">sort_by_count</span> <span style="color: #008080;">then</span>
| 151
<span style="color: #000000;">task_counts</span><span style="color: #0000FF;">[</span><span style="color: #000000;">i</span><span style="color: #0000FF;">]</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">count</span>
| [[Copy%20a%20string|Copy a string]]
<span style="color: #008080;">elsif</span> <span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">notlang</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">or</span> <span style="color: #000000;">i</span><span style="color: #0000FF;"><=</span><span style="color: #000000;">2</span> <span style="color: #008080;">or</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">>=</span><span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">)-</span><span style="color: #000000;">1</span> <span style="color: #008080;">or</span> <span style="color: #7060A8;">mod</span><span style="color: #0000FF;">(</span><span style="color: #000000;">i</span><span style="color: #0000FF;">,</span><span style="color: #000000;">200</span><span style="color: #0000FF;">)=</span><span style="color: #000000;">0</span> <span style="color: #008080;">then</span>
| Task
<span style="color: #7060A8;">progress</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%s: %d\n"</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">html_clean</span><span style="color: #0000FF;">(</span><span style="color: #000000;">ti</span><span style="color: #0000FF;">),</span><span style="color: #000000;">count</span><span style="color: #0000FF;">})</span>
|-
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| 148
<span style="color: #000000;">total_count</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">count</span>
| [[Hello%20world%2FGraphical|Hello world/Graphical]]
<span style="color: #008080;">if</span> <span style="color: #7060A8;">get_key</span><span style="color: #0000FF;">()=</span><span style="color: #000000;">#1B</span> <span style="color: #008080;">then</span> <span style="color: #7060A8;">progress</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"escape keyed\n"</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">exit</span> <span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
| Task
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
|-
<span style="color: #000000;">curl_cleanup</span><span style="color: #0000FF;">()</span>
| 148
<span style="color: #008080;">if</span> <span style="color: #000000;">sort_by_count</span> <span style="color: #008080;">then</span>
| [[Sum%20and%20product%20of%20an%20array|Sum and product of an array]]
<span style="color: #004080;">sequence</span> <span style="color: #000000;">tags</span> <span style="color: #0000FF;">=</span> <span style="color: #7060A8;">custom_sort</span><span style="color: #0000FF;">(</span><span style="color: #000000;">task_counts</span><span style="color: #0000FF;">,</span><span style="color: #7060A8;">tagset</span><span style="color: #0000FF;">(</span><span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">)))</span>
| Task
<span style="color: #008080;">for</span> <span style="color: #000000;">i</span><span style="color: #0000FF;">=</span><span style="color: #7060A8;">length</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tags</span><span style="color: #0000FF;">)</span> <span style="color: #008080;">to</span> <span style="color: #000000;">1</span> <span style="color: #008080;">by</span> <span style="color: #0000FF;">-</span><span style="color: #000000;">1</span> <span style="color: #008080;">do</span>
|-
<span style="color: #004080;">integer</span> <span style="color: #000000;">ti</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">tags</span><span style="color: #0000FF;">[</span><span style="color: #000000;">i</span><span style="color: #0000FF;">]</span>
| 147
<span style="color: #7060A8;">progress</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"%s: %d\n"</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">html_clean</span><span style="color: #0000FF;">(</span><span style="color: #000000;">tasks</span><span style="color: #0000FF;">[</span><span style="color: #000000;">ti</span><span style="color: #0000FF;">]),</span><span style="color: #000000;">task_counts</span><span style="color: #0000FF;">[</span><span style="color: #000000;">ti</span><span style="color: #0000FF;">]})</span>
| [[Even%20or%20odd|Even or odd]]
<span style="color: #008080;">end</span> <span style="color: #008080;">for</span>
| Task
<span style="color: #008080;">end</span> <span style="color: #008080;">if</span>
|-
<span style="color: #008080;">return</span> <span style="color: #000000;">total_count</span>
| 146
<span style="color: #008080;">end</span> <span style="color: #008080;">function</span>
| [[String%20length|String length]]
| Task
<span style="color: #7060A8;">progress</span><span style="color: #0000FF;">(</span><span style="color: #008000;">"Total: %d\n"</span><span style="color: #0000FF;">,{</span><span style="color: #000000;">count_tasks</span><span style="color: #0000FF;">()})</span>
|-
<!--</syntaxhighlight>-->
| 144
{{out}} (as of 30/2/22, showing first two, every 200th, and last two)
| [[Apply%20a%20callback%20to%20an%20array|Apply a callback to an array]]
<pre>
| Task
1523 tasks found
|-
10001th prime: 33
| 144
100 doors: 337
| [[Loops%2FForeach|Loops/Foreach]]
Chowla numbers: 46
| Task
Exactly three adjacent 3 in lists: 27
|-
Imaginary base numbers: 21
| 143
Monte Carlo methods: 87
| [[Character%20codes|Character codes]]
Prime numbers which contain 123: 23
| Task
Smallest number k such that k+2^m is composite for all m less than k: 5
|-
Trabb Pardo-Knuth algorithm: 83
| 143
Zig-zag matrix: 113
| [[Loops%2FDo-while|Loops/Do-while]]
Zumkeller numbers: 36
| Task
Total: 88455
|-
</pre>
| 141
| [[String%20case|String case]]
| Task
|-
| 138
| [[Hello%20world%2FNewline%20omission|Hello world/Newline omission]]
| Task
|-
| 137
| [[Generic%20swap|Generic swap]]
| Task
|-
| 137
| [[Loops%2FN%20plus%20one%20half|Loops/N plus one half]]
| Task
|-
| 137
| [[String%20concatenation|String concatenation]]
| Task
|-
| 136
| [[Hailstone%20sequence|Hailstone sequence]]
| Task
|-
| 136
| [[Integer%20sequence|Integer sequence]]
| Task
|-
| 136
| [[Sum%20of%20a%20series|Sum of a series]]
| Task
|-
| 136
| [[Sum%20of%20squares|Sum of squares]]
| Task
|-
| 135
| [[Binary%20digits|Binary digits]]
| Task
|-
| 135
| [[Filter|Filter]]
| Task
|-
| 134
| [[Loops%2FBreak|Loops/Break]]
| Task
|-
| 134
| [[Palindrome%20detection|Palindrome detection]]
| Task
|-
| 134
|data-sort-value="rot-0C13"| [[Rot-13|Rot-13]]
| Task
|-
| 133
| [[Execute%20a%20system%20command|Execute a system command]]
| Task
|-
| 133
| [[Towers%20of%20Hanoi|Towers of Hanoi]]
| Task
|-
| 131
| [[Logical%20operations|Logical operations]]
| Task
|-
| 131
| [[Sort%20an%20integer%20array|Sort an integer array]]
| Task
|-
| 130
| [[Dot%20product|Dot product]]
| Task
|-
| 128
| [[Sieve%20of%20Eratosthenes|Sieve of Eratosthenes]]
| Task
|-
| 127
| [[Associative%20array%2FCreation|Associative array/Creation]]
| Task
|-
| 127
| [[File%20input%2Foutput|File input/output]]
| Task
|-
| 127
| [[Tokenize%20a%20string|Tokenize a string]]
| Task
|-
| 126
| [[Higher-order%20functions|Higher-order functions]]
| Task
|-
| 126
| [[Leap%20year|Leap year]]
| Task
|-
| 126
| [[Remove%20duplicate%20elements|Remove duplicate elements]]
| Task
|-
| 125
| [[Determine%20if%20a%20string%20is%20numeric|Determine if a string is numeric]]
| Task
|-
| 124
| [[Sorting%20algorithms%2FBubble%20sort|Sorting algorithms/Bubble sort]]
| Task
|-
| 123
| [[Array%20length|Array length]]
| Task
|-
| 122
| [[Quine|Quine]]
| Task
|-
| 122
| [[Roman%20numerals%2FEncode|Roman numerals/Encode]]
| Task
|-
| 121
| [[Empty%20string|Empty string]]
| Task
|-
| 121
| [[Read%20entire%20file|Read entire file]]
| Task
|-
| 121
| [[User%20input%2FText|User input/Text]]
| Task
|-
| 120
| [[Command-line%20arguments|Command-line arguments]]
| Task
|-
| 120
| [[Hello%20world%2FStandard%20error|Hello world/Standard error]]
| Task
|-
| 119
| [[Create%20a%20file|Create a file]]
| Task
|-
| 118
| [[Guess%20the%20number|Guess the number]]
| Task
|-
| 118
| [[Primality%20by%20trial%20division|Primality by trial division]]
| Task
|-
| 117
| [[Bitwise%20operations|Bitwise operations]]
| Task
|-
| 117
| [[Loop%20over%20multiple%20arrays%20simultaneously|Loop over multiple arrays simultaneously]]
| Task
|-
| 117
| [[Sorting%20algorithms%2FQuicksort|Sorting algorithms/Quicksort]]
| Task
|-
| 116
| [[Sleep|Sleep]]
| Task
|-
| 116
| [[System%20time|System time]]
| Task
|-
| 115
| [[Factors%20of%20an%20integer|Factors of an integer]]
| Task
|-
| 114
| [[Check%20that%20file%20exists|Check that file exists]]
| Task
|-
| 114
| [[Day%20of%20the%20week|Day of the week]]
| Task
|-
| 114
| [[Happy%20numbers|Happy numbers]]
| Task
|-
| 114
| [[Literals%2FString|Literals/String]]
| Task
|-
| 113
| [[Caesar%20cipher|Caesar cipher]]
| Task
|-
| 113
| [[Least%20common%20multiple|Least common multiple]]
| Task
|-
| 113
| [[Mutual%20recursion|Mutual recursion]]
| Task
|-
| 113
| [[Substring|Substring]]
| Task
|-
| 112
| [[Literals%2FInteger|Literals/Integer]]
| Task
|-
| 112
| [[Pascal%27s%20triangle|Pascal's triangle]]
| Task
|-
| 112
| [[Stack|Stack]]
| Task
|-
| 111
| [[Flatten%20a%20list|Flatten a list]]
| Task
|-
| 111
| [[Luhn%20test%20of%20credit%20card%20numbers|Luhn test of credit card numbers]]
| Task
|-
| 110
| [[Include%20a%20file|Include a file]]
| Task
|-
| 110
| [[Loops%2FContinue|Loops/Continue]]
| Task
|-
| 109
| [[Averages%2FRoot%20mean%20square|Averages/Root mean square]]
| Task
|-
| 109
| [[Balanced%20brackets|Balanced brackets]]
| Task
|-
| 109
| [[Ethiopian%20multiplication|Ethiopian multiplication]]
| Task
|-
| 109
| [[File%20size|File size]]
| Task
|-
| 109
| [[Knuth%20shuffle|Knuth shuffle]]
| Task
|-
| 108
| [[Compound%20data%20type|Compound data type]]
| Task
|-
| 108
| [[Date%20format|Date format]]
| Task
|-
| 107
| [[Associative%20array%2FIteration|Associative array/Iteration]]
| Task
|-
| 107
| [[Program%20termination|Program termination]]
| Task
|-
| 106
| [[Read%20a%20file%20line%20by%20line|Read a file line by line]]
| Task
|-
| 106
| [[Real%20constants%20and%20functions|Real constants and functions]]
| Task
|-
| 106
| [[Search%20a%20list|Search a list]]
| Task
|-
| 105
| [[Anagrams|Anagrams]]
| Task
|-
| 105
| [[Detect%20division%20by%20zero|Detect division by zero]]
| Task
|-
| 105
| [[Variables|Variables]]
| Task
|-
| 104
| [[Classes|Classes]]
| Task
|-
| 104
| [[Delete%20a%20file|Delete a file]]
| Task
|-
| 104
| [[Rename%20a%20file|Rename a file]]
| Task
|-
| 103
| [[Averages%2FMedian|Averages/Median]]
| Task
|-
| 103
| [[Binary%20search|Binary search]]
| Task
|-
| 103
| [[Case-sensitivity%20of%20identifiers|Case-sensitivity of identifiers]]
| Task
|-
| 103
| [[Formatted%20numeric%20output|Formatted numeric output]]
| Task
|-
| 103
| [[Function%20composition|Function composition]]
| Task
|-
| 103
| [[Return%20multiple%20values|Return multiple values]]
| Task
|-
| 102
| [[ABC%20Problem|ABC Problem]]
| Task
|-
| 102
| [[Count%20in%20octal|Count in octal]]
| Task
|-
| 102
| [[Hostname|Hostname]]
| Task
|-
| 102
| [[Input%20loop|Input loop]]
| Task
|-
| 102
| [[Loops%2FNested|Loops/Nested]]
| Task
|-
| 102
| [[Null%20object|Null object]]
| Task
|-
| 101
| [[Arithmetic%2FComplex|Arithmetic/Complex]]
| Task
|-
| 101
| [[Hash%20from%20two%20arrays|Hash from two arrays]]
| Task
|-
| 101
| [[Random%20numbers|Random numbers]]
| Task
|-
| 101
| [[Sorting%20algorithms%2FInsertion%20sort|Sorting algorithms/Insertion sort]]
| Task
|-
| 100
| [[Count%20occurrences%20of%20a%20substring|Count occurrences of a substring]]
| Task
|-
| 100
| [[Multiplication%20tables|Multiplication tables]]
| Task
|-
| 99
| [[Environment%20variables|Environment variables]]
| Task
|-
| 99
| [[Generate%20lower%20case%20ASCII%20alphabet|Generate lower case ASCII alphabet]]
| Task
|-
| 99
| [[Matrix%20multiplication|Matrix multiplication]]
| Task
|-
| 99
| [[Matrix%20transposition|Matrix transposition]]
| Task
|-
| 99
| [[N-queens%20problem|N-queens problem]]
| Task
|-
| 99
| [[Pick%20random%20element|Pick random element]]
| Task
|-
| 98
| [[HTTP|HTTP]]
| Task
|-
| 98
| [[Horner%27s%20rule%20for%20polynomial%20evaluation|Horner's rule for polynomial evaluation]]
| Task
|-
| 97
| [[Create%20a%20two-dimensional%20array%20at%20runtime|Create a two-dimensional array at runtime]]
| Task
|-
| 97
| [[Guess%20the%20number%2FWith%20feedback|Guess the number/With feedback]]
| Task
|-
| 97
| [[Pangram%20checker|Pangram checker]]
| Task
|-
| 96
| [[Accumulator%20factory|Accumulator factory]]
| Task
|-
| 96
| [[Assertions|Assertions]]
| Task
|-
| 96
| [[Haversine%20formula|Haversine formula]]
| Task
|-
| 96
| [[Identity%20matrix|Identity matrix]]
| Task
|-
| 96
| [[Mandelbrot%20set|Mandelbrot set]]
| Task
|-
| 96
| [[Perfect%20numbers|Perfect numbers]]
| Task
|-
| 96
| [[Roman%20numerals%2FDecode|Roman numerals/Decode]]
| Task
|-
| 95
| [[Align%20columns|Align columns]]
| Task
|-
| 95
| [[Averages%2FPythagorean%20means|Averages/Pythagorean means]]
| Task
|-
| 95
| [[Evaluate%20binomial%20coefficients|Evaluate binomial coefficients]]
| Task
|-
| 95
| [[Find%20limit%20of%20recursion|Find limit of recursion]]
| Task
|-
| 95
| [[String%20matching|String matching]]
| Task
|-
| 95
| [[Strip%20a%20set%20of%20characters%20from%20a%20string|Strip a set of characters from a string]]
| Task
|-
| 94
| [[Temperature%20conversion|Temperature conversion]]
| Task
|-
| 93
| [[Catalan%20numbers|Catalan numbers]]
| Task
|-
| 93
| [[Run-length%20encoding|Run-length encoding]]
| Task
|-
| 93
| [[Substring%2FTop%20and%20tail|Substring/Top and tail]]
| Task
|-
| 93
| [[Variadic%20function|Variadic function]]
| Task
|-
| 93
| [[Zero%20to%20the%20zero%20power|Zero to the zero power]]
| Task
|-
| 92
| [[Exceptions|Exceptions]]
| Task
|-
| 92
| [[Zig-zag%20matrix|Zig-zag matrix]]
| Task
|-
| 91
| [[Arithmetic-geometric%20mean|Arithmetic-geometric mean]]
| Task
|-
| 91
| [[Program%20name|Program name]]
| Task
|-
| 91
| [[Strip%20whitespace%20from%20a%20string%2FTop%20and%20tail|Strip whitespace from a string/Top and tail]]
| Task
|-
| 90
| [[Infinity|Infinity]]
| Task
|-
| 90
| [[Letter%20frequency|Letter frequency]]
| Task
|-
| 90
| [[Prime%20decomposition|Prime decomposition]]
| Task
|-
| 90
| [[Regular%20expressions|Regular expressions]]
| Task
|-
| 90
| [[Shell%20one-liner|Shell one-liner]]
| Task
|-
| 89
| [[Combinations|Combinations]]
| Task
|-
| 89
| [[Conway%27s%20Game%20of%20Life|Conway's Game of Life]]
| Task
|-
| 89
| [[String%20interpolation%20%28included%29|String interpolation (included)]]
| Task
|-
| 89
| [[Trigonometric%20functions|Trigonometric functions]]
| Task
|-
| 88
|data-sort-value="0C24 game"| [[24%20game|24 game]]
| Task
|-
| 88
| [[Middle%20three%20digits|Middle three digits]]
| Task
|-
| 88
| [[Power%20set|Power set]]
| Task
|-
| 88
| [[Random%20number%20generator%20%28included%29|Random number generator (included)]]
| Task
|-
| 88
| [[Sierpinski%20triangle|Sierpinski triangle]]
| Task
|-
| 88
| [[Sorting%20algorithms%2FMerge%20sort|Sorting algorithms/Merge sort]]
| Task
|-
| 88
| [[Sorting%20algorithms%2FSelection%20sort|Sorting algorithms/Selection sort]]
| Task
|-
| 87
| [[Collections|Collections]]
| Task
|-
| 87
| [[Enumerations|Enumerations]]
| Task
|-
| 87
| [[Ordered%20words|Ordered words]]
| Task
|-
| 87
| [[Short-circuit%20evaluation|Short-circuit evaluation]]
| Task
|-
| 86
| [[Anonymous%20recursion|Anonymous recursion]]
| Task
|-
| 86
| [[One-dimensional%20cellular%20automata|One-dimensional cellular automata]]
| Task
|-
| 85
| [[Comma%20quibbling|Comma quibbling]]
| Task
|-
| 85
| [[Exponentiation%20operator|Exponentiation operator]]
| Task
|-
| 85
| [[Inheritance%2FSingle|Inheritance/Single]]
| Task
|-
| 85
| [[Levenshtein%20distance|Levenshtein distance]]
| Task
|-
| 85
| [[Look-and-say%20sequence|Look-and-say sequence]]
| Task
|-
| 85
| [[Sequence%20of%20non-squares|Sequence of non-squares]]
| Task
|-
| 84
| [[Arbitrary-precision%20integers%20%28included%29|Arbitrary-precision integers (included)]]
| Task
|-
| 84
| [[First-class%20functions|First-class functions]]
| Task
|-
| 84
| [[Interactive%20programming|Interactive programming]]
| Task
|-
| 84
| [[Permutations|Permutations]]
| Task
|-
| 84
| [[Range%20extraction|Range extraction]]
| Task
|-
| 84
| [[Reverse%20words%20in%20a%20string|Reverse words in a string]]
| Task
|-
| 84
|data-sort-value="sum multiples of 0B3 and 0B5"| [[Sum%20multiples%20of%203%20and%205|Sum multiples of 3 and 5]]
| Task
|-
| 84
| [[Walk%20a%20directory%2FNon-recursively|Walk a directory/Non-recursively]]
| Task
|-
| 83
| [[Queue%2FDefinition|Queue/Definition]]
| Task
|-
| 83
| [[Sort%20using%20a%20custom%20comparator|Sort using a custom comparator]]
| Task
|-
| 82
| [[Cumulative%20standard%20deviation|Cumulative standard deviation]]
| Task
|-
| 82
| [[Nth%20root|Nth root]]
| Task
|-
| 82
| [[Range%20expansion|Range expansion]]
| Task
|-
| 81
| [[Bulls%20and%20cows|Bulls and cows]]
| Task
|-
| 81
| [[Five%20weekends|Five weekends]]
| Task
|-
| 81
|data-sort-value="md0B5"| [[MD5|MD5]]
| Task
|-
| 81
| [[Sorting%20algorithms%2FGnome%20sort|Sorting algorithms/Gnome sort]]
| Task
|-
| 81
| [[Symmetric%20difference|Symmetric difference]]
| Task
|-
| 80
| [[Create%20an%20HTML%20table|Create an HTML table]]
| Task
|-
| 80
| [[Evolutionary%20algorithm|Evolutionary algorithm]]
| Task
|-
| 80
| [[Time%20a%20function|Time a function]]
| Task
|-
| 80
| [[Y%20combinator|Y combinator]]
| Task
|-
| 79
| [[Averages%2FSimple%20moving%20average|Averages/Simple moving average]]
| Task
|-
| 79
| [[Forward%20difference|Forward difference]]
| Task
|-
| 79
| [[String%20prepend|String prepend]]
| Task
|-
| 79
| [[Window%20creation|Window creation]]
| Task
|-
| 78
| [[Abstract%20type|Abstract type]]
| Task
|-
| 78
| [[Call%20a%20function|Call a function]]
| Task
|-
| 78
| [[File%20modification%20time|File modification time]]
| Task
|-
| 78
| [[Price%20fraction|Price fraction]]
| Task
|-
| 77
| [[Averages%2FMode|Averages/Mode]]
| Task
|-
| 77
| [[Dragon%20curve|Dragon curve]]
| Task
|-
| 77
| [[Greatest%20subsequential%20sum|Greatest subsequential sum]]
| Task
|-
| 77
| [[Monty%20Hall%20problem|Monty Hall problem]]
| Task
|-
| 77
| [[Sierpinski%20carpet|Sierpinski carpet]]
| Task
|-
| 77
| [[String%20append|String append]]
| Task
|-
| 77
| [[Vector%20products|Vector products]]
| Task
|-
| 76
| [[Hamming%20numbers|Hamming numbers]]
| Task
|-
| 76
| [[Langton%27s%20ant|Langton's ant]]
| Task
|-
| 76
| [[Sum%20digits%20of%20an%20integer|Sum digits of an integer]]
| Task
|-
| 75
| [[Babbage%20problem|Babbage problem]]
| Task
|-
| 75
| [[Entropy|Entropy]]
| Task
|-
| 75
| [[Menu|Menu]]
| Task
|-
| 75
| [[Simple%20windowed%20application|Simple windowed application]]
| Task
|-
| 75
| [[Sorting%20algorithms%2FBogosort|Sorting algorithms/Bogosort]]
| Task
|-
| 75
| [[Sorting%20algorithms%2FCocktail%20sort|Sorting algorithms/Cocktail sort]]
| Task
|-
| 74
| [[Harshad%20or%20Niven%20series|Harshad or Niven series]]
| Task
|-
| 74
| [[Hello%20world%2FLine%20printer|Hello world/Line printer]]
| Task
|-
| 74
| [[JSON|JSON]]
| Task
|-
| 74
| [[Non-decimal%20radices%2FConvert|Non-decimal radices/Convert]]
| Task
|-
| 74
| [[Show%20the%20epoch|Show the epoch]]
| Task
|-
| 74
| [[The%20Twelve%20Days%20of%20Christmas|The Twelve Days of Christmas]]
| Task
|-
| 73
| [[Closures%2FValue%20capture|Closures/Value capture]]
| Task
|-
| 73
| [[Digital%20root|Digital root]]
| Task
|-
| 73
| [[Gray%20code|Gray code]]
| Task
|-
| 73
| [[Map%20range|Map range]]
| Task
|-
| 73
| [[Monte%20Carlo%20methods|Monte Carlo methods]]
| Task
|-
| 73
| [[Set|Set]]
| Task
|-
| 73
| [[Spiral%20matrix|Spiral matrix]]
| Task
|-
| 73
| [[Tree%20traversal|Tree traversal]]
| Task
|-
| 73
| [[Walk%20a%20directory%2FRecursively|Walk a directory/Recursively]]
| Task
|-
| 72
| [[Execute%20Brain%2A%2A%2A%2A|Execute Brain****]]
| Task
|-
| 72
| [[Introspection|Introspection]]
| Task
|-
| 72
| [[Last%20Friday%20of%20each%20month|Last Friday of each month]]
| Task
|-
| 72
| [[Literals%2FFloating%20point|Literals/Floating point]]
| Task
|-
| 72
| [[Man%20or%20boy%20test|Man or boy test]]
| Task
|-
| 72
| [[Queue%2FUsage|Queue/Usage]]
| Task
|-
| 72
| [[Read%20a%20specific%20line%20from%20a%20file|Read a specific line from a file]]
| Task
|-
| 72
| [[SEDOLs|SEDOLs]]
| Task
|-
| 72
| [[Web%20scraping|Web scraping]]
| Task
|-
| 71
| [[CSV%20to%20HTML%20translation|CSV to HTML translation]]
| Task
|-
| 71
| [[Number%20reversal%20game|Number reversal game]]
| Task
|-
| 71
| [[Singly-linked%20list%2FTraversal|Singly-linked list/Traversal]]
| Task
|-
| 71
| [[Sort%20an%20array%20of%20composite%20structures|Sort an array of composite structures]]
| Task
|-
| 71
| [[URL%20decoding|URL decoding]]
| Task
|-
| 70
| [[Bitmap|Bitmap]]
| Task
|-
| 70
| [[CSV%20data%20manipulation|CSV data manipulation]]
| Task
|-
| 70
| [[Count%20in%20factors|Count in factors]]
| Task
|-
| 70
| [[Number%20names|Number names]]
| Task
|-
| 70
| [[Sorting%20algorithms%2FHeapsort|Sorting algorithms/Heapsort]]
| Task
|-
| 69
| [[Amicable%20pairs|Amicable pairs]]
| Task
|-
| 69
| [[Floyd%27s%20triangle|Floyd's triangle]]
| Task
|-
| 69
| [[Linear%20congruential%20generator|Linear congruential generator]]
| Task
|-
| 68
| [[Address%20of%20a%20variable|Address of a variable]]
| Task
|-
| 68
| [[Concurrent%20computing|Concurrent computing]]
| Task
|-
| 68
| [[Find%20the%20missing%20permutation|Find the missing permutation]]
| Task
|-
| 68
| [[Josephus%20problem|Josephus problem]]
| Task
|-
| 68
|data-sort-value="knapsack problem/0B0-0B1"| [[Knapsack%20problem%2F0-1|Knapsack problem/0-1]]
| Task
|-
| 68
| [[List%20comprehensions|List comprehensions]]
| Task
|-
| 68
| [[Special%20characters|Special characters]]
| Task
|-
| 68
| [[Take%20notes%20on%20the%20command%20line|Take notes on the command line]]
| Task
|-
| 68
| [[Terminal%20control%2FRinging%20the%20terminal%20bell|Terminal control/Ringing the terminal bell]]
| Task
|-
| 68
| [[Top%20rank%20per%20group|Top rank per group]]
| Task
|-
| 68
| [[XML%2FInput|XML/Input]]
| Task
|-
| 67
| [[Abundant%2C%20deficient%20and%20perfect%20number%20classifications|Abundant, deficient and perfect number classifications]]
| Task
|-
| 67
| [[Catamorphism|Catamorphism]]
| Task
|-
| 67
| [[Date%20manipulation|Date manipulation]]
| Task
|-
| 67
| [[Find%20common%20directory%20path|Find common directory path]]
| Task
|-
| 67
| [[Roots%20of%20unity|Roots of unity]]
| Task
|-
| 67
| [[Sockets|Sockets]]
| Task
|-
| 67
| [[Sorting%20algorithms%2FShell%20sort|Sorting algorithms/Shell sort]]
| Task
|-
| 67
| [[String%20comparison|String comparison]]
| Task
|-
| 67
| [[Strip%20comments%20from%20a%20string|Strip comments from a string]]
| Task
|-
| 66
| [[Box%20the%20compass|Box the compass]]
| Task
|-
| 66
| [[Dynamic%20variable%20names|Dynamic variable names]]
| Task
|-
| 66
| [[Kaprekar%20numbers|Kaprekar numbers]]
| Task
|-
| 66
| [[Non-decimal%20radices%2FOutput|Non-decimal radices/Output]]
| Task
|-
| 66
| [[Playing%20cards|Playing cards]]
| Task
|-
| 66
| [[Polymorphism|Polymorphism]]
| Task
|-
| 66
| [[Singly-linked%20list%2FElement%20definition|Singly-linked list/Element definition]]
| Task
|-
| 66
| [[Soundex|Soundex]]
| Task
|-
| 66
| [[Stair-climbing%20puzzle|Stair-climbing puzzle]]
| Task
|-
| 66
| [[URL%20encoding|URL encoding]]
| Task
|-
| 66
| [[Unicode%20variable%20names|Unicode variable names]]
| Task
|-
| 65
| [[Bitmap%2FBresenham%27s%20line%20algorithm|Bitmap/Bresenham's line algorithm]]
| Task
|-
| 65
| [[Empty%20directory|Empty directory]]
| Task
|-
| 65
| [[Equilibrium%20index|Equilibrium index]]
| Task
|-
| 65
| [[Longest%20common%20subsequence|Longest common subsequence]]
| Task
|-
| 65
| [[Lucas-Lehmer%20test|Lucas-Lehmer test]]
| Task
|-
| 65
| [[Order%20two%20numerical%20lists|Order two numerical lists]]
| Task
|-
| 64
| [[Find%20the%20last%20Sunday%20of%20each%20month|Find the last Sunday of each month]]
| Task
|-
| 64
| [[Flow-control%20structures|Flow-control structures]]
| Task
|-
| 64
| [[N%27th|N'th]]
| Task
|-
| 64
| [[Sorting%20algorithms%2FCounting%20sort|Sorting algorithms/Counting sort]]
| Task
|-
| 64
| [[Write%20float%20arrays%20to%20a%20text%20file|Write float arrays to a text file]]
| Task
|-
| 63
| [[Anagrams%2FDeranged%20anagrams|Anagrams/Deranged anagrams]]
| Task
|-
| 63
| [[Averages%2FMean%20angle|Averages/Mean angle]]
| Task
|-
| 63
| [[Exceptions%2FCatch%20an%20exception%20thrown%20in%20a%20nested%20call|Exceptions/Catch an exception thrown in a nested call]]
| Task
|-
| 63
| [[Hello%20world%2FWeb%20server|Hello world/Web server]]
| Task
|-
| 63
| [[Keyboard%20input%2FObtain%20a%20Y%20or%20N%20response|Keyboard input/Obtain a Y or N response]]
| Task
|-
| 63
| [[Multifactorial|Multifactorial]]
| Task
|-
| 63
| [[Multiple%20distinct%20objects|Multiple distinct objects]]
| Task
|-
| 63
| [[Parsing%2FRPN%20calculator%20algorithm|Parsing/RPN calculator algorithm]]
| Task
|-
| 63
| [[Semordnilap|Semordnilap]]
| Task
|-
| 63
| [[Sorting%20algorithms%2FComb%20sort|Sorting algorithms/Comb sort]]
| Task
|-
| 63
| [[Terminal%20control%2FClear%20the%20screen|Terminal control/Clear the screen]]
| Task
|-
| 63
| [[Word%20wrap|Word wrap]]
| Task
|-
| 62
| [[Call%20an%20object%20method|Call an object method]]
| Task
|-
| 62
| [[Compare%20a%20list%20of%20strings|Compare a list of strings]]
| Task
|-
| 62
| [[Count%20the%20coins|Count the coins]]
| Task
|-
| 62
| [[Fibonacci%20n-step%20number%20sequences|Fibonacci n-step number sequences]]
| Task
|-
| 62
| [[Guess%20the%20number%2FWith%20feedback%20%28player%29|Guess the number/With feedback (player)]]
| Task
|-
| 62
| [[Here%20document|Here document]]
| Task
|-
| 62
| [[Hofstadter%20Q%20sequence|Hofstadter Q sequence]]
| Task
|-
| 62
| [[Jensen%27s%20Device|Jensen's Device]]
| Task
|-
| 62
| [[Largest%20int%20from%20concatenated%20ints|Largest int from concatenated ints]]
| Task
|-
| 62
| [[Long%20multiplication|Long multiplication]]
| Task
|-
| 62
| [[Pythagorean%20triples|Pythagorean triples]]
| Task
|-
| 62
| [[Read%20a%20configuration%20file|Read a configuration file]]
| Task
|-
| 62
| [[Sorting%20algorithms%2FStooge%20sort|Sorting algorithms/Stooge sort]]
| Task
|-
| 62
| [[Vigen%C3%A8re%20cipher|Vigenère cipher]]
| Task
|-
| 61
| [[Animation|Animation]]
| Task
|-
| 61
| [[Convert%20seconds%20to%20compound%20duration|Convert seconds to compound duration]]
| Task
|-
| 61
| [[Enforced%20immutability|Enforced immutability]]
| Task
|-
| 61
| [[Hello%20world%2FNewbie|Hello world/Newbie]]
| Task
|-
| 61
| [[Sort%20disjoint%20sublist|Sort disjoint sublist]]
| Task
|-
| 61
| [[Sudoku|Sudoku]]
| Task
|-
| 61
| [[Text%20processing%2FMax%20licenses%20in%20use|Text processing/Max licenses in use]]
| Task
|-
| 61
| [[Trabb%20Pardo%E2%80%93Knuth%20algorithm|Trabb Pardo–Knuth algorithm]]
| Task
|-
| 60
| [[Constrained%20random%20points%20on%20a%20circle|Constrained random points on a circle]]
| Task
|-
| 60
|data-sort-value="execute hq0B9+"| [[Execute%20HQ9%2B|Execute HQ9+]]
| Task
|-
| 60
| [[Gamma%20function|Gamma function]]
| Task
|-
| 60
| [[Numerical%20integration|Numerical integration]]
| Task
|-
| 60
| [[Operator%20precedence|Operator precedence]]
| Task
|-
| 60
| [[Probabilistic%20choice|Probabilistic choice]]
| Task
|-
| 60
| [[Sort%20stability|Sort stability]]
| Task
|-
| 60
| [[Strip%20control%20codes%20and%20extended%20characters%20from%20a%20string|Strip control codes and extended characters from a string]]
| Task
|-
| 59
| [[Call%20a%20foreign-language%20function|Call a foreign-language function]]
| Task
|-
| 59
| [[Euler%20method|Euler method]]
| Task
|-
| 59
| [[Fork|Fork]]
| Task
|-
| 59
| [[Four%20bit%20adder|Four bit adder]]
| Task
|-
| 59
| [[Runtime%20evaluation|Runtime evaluation]]
| Task
|-
| 58
| [[Benford%27s%20law|Benford's law]]
| Task
|-
| 58
| [[Named%20parameters|Named parameters]]
| Task
|-
| 58
| [[One%20of%20n%20lines%20in%20a%20file|One of n lines in a file]]
| Task
|-
| 58
| [[Quaternion%20type|Quaternion type]]
| Task
|-
| 58
| [[Remove%20lines%20from%20a%20file|Remove lines from a file]]
| Task
|-
| 58
| [[Roots%20of%20a%20quadratic%20function|Roots of a quadratic function]]
| Task
|-
| 58
| [[Singly-linked%20list%2FElement%20insertion|Singly-linked list/Element insertion]]
| Task
|-
| 58
| [[Special%20variables|Special variables]]
| Task
|-
| 58
| [[Variable%20size%2FGet|Variable size/Get]]
| Task
|-
| 57
| [[Arithmetic%2FRational|Arithmetic/Rational]]
| Task
|-
| 57
| [[Closest-pair%20problem|Closest-pair problem]]
| Task
|-
| 57
| [[Combinations%20with%20repetitions|Combinations with repetitions]]
| Task
|-
| 57
| [[Fractal%20tree|Fractal tree]]
| Task
|-
| 57
| [[HTTPS|HTTPS]]
| Task
|-
| 57
| [[Horizontal%20sundial%20calculations|Horizontal sundial calculations]]
| Task
|-
| 57
| [[IBAN|IBAN]]
| Task
|-
| 57
| [[Magic%20squares%20of%20odd%20order|Magic squares of odd order]]
| Task
|-
| 57
| [[Optional%20parameters|Optional parameters]]
| Task
|-
| 57
| [[Phrase%20reversals|Phrase reversals]]
| Task
|-
| 57
| [[Pi|Pi]]
| Task
|-
| 57
| [[Priority%20queue|Priority queue]]
| Task
|- style="background-color: #ffc"
| 57
| [[Proper%20divisors|Proper divisors]]
| Draft
|-
| 57
| [[Rock-paper-scissors|Rock-paper-scissors]]
| Task
|-
| 57
| [[Roots%20of%20a%20function|Roots of a function]]
| Task
|-
| 57
| [[Undefined%20values|Undefined values]]
| Task
|-
| 56
| [[Almost%20prime|Almost prime]]
| Task
|-
| 56
| [[Catalan%20numbers%2FPascal%27s%20triangle|Catalan numbers/Pascal's triangle]]
| Task
|-
| 56
| [[Currying|Currying]]
| Task
|-
| 56
|data-sort-value="hofstadter-conway $0C10,0D000 sequence"| [[Hofstadter-Conway%20%2410%2C000%20sequence|Hofstadter-Conway $10,000 sequence]]
| Task
|-
| 56
| [[Host%20introspection|Host introspection]]
| Task
|-
| 56
| [[Memory%20allocation|Memory allocation]]
| Task
|-
| 56
| [[Runge-Kutta%20method|Runge-Kutta method]]
| Task
|-
| 56
|data-sort-value="sha-0B1"| [[SHA-1|SHA-1]]
| Task
|-
| 56
| [[Self-describing%20numbers|Self-describing numbers]]
| Task
|-
| 56
| [[Van%20der%20Corput%20sequence|Van der Corput sequence]]
| Task
|-
| 56
| [[Zeckendorf%20number%20representation|Zeckendorf number representation]]
| Task
|-
| 55
| [[AKS%20test%20for%20primes|AKS test for primes]]
| Task
|-
| 55
| [[Best%20shuffle|Best shuffle]]
| Task
|-
| 55
|data-sort-value="crc-0C32"| [[CRC-32|CRC-32]]
| Task
|-
| 55
| [[Cholesky%20decomposition|Cholesky decomposition]]
| Task
|-
| 55
| [[Draw%20a%20sphere|Draw a sphere]]
| Task
|-
| 55
| [[Fast%20Fourier%20transform|Fast Fourier transform]]
| Task
|-
| 55
| [[Jump%20anywhere|Jump anywhere]]
| Task
|-
| 55
| [[Knapsack%20problem%2FUnbounded|Knapsack problem/Unbounded]]
| Task
|-
| 55
| [[Modular%20inverse|Modular inverse]]
| Task
|-
| 55
| [[Narcissistic%20decimal%20number|Narcissistic decimal number]]
| Task
|-
| 55
| [[Sorting%20algorithms%2FPancake%20sort|Sorting algorithms/Pancake sort]]
| Task
|-
| 55
| [[Sorting%20algorithms%2FSleep%20sort|Sorting algorithms/Sleep sort]]
| Task
|-
| 54
| [[Extend%20your%20language|Extend your language]]
| Task
|-
| 54
| [[Inheritance%2FMultiple|Inheritance/Multiple]]
| Task
|-
| 54
| [[Maze%20generation|Maze generation]]
| Task
|-
| 54
| [[Non-decimal%20radices%2FInput|Non-decimal radices/Input]]
| Task
|-
| 54
| [[Partial%20function%20application|Partial function application]]
| Task
|-
| 54
|data-sort-value="sha-0D256"| [[SHA-256|SHA-256]]
| Task
|-
| 54
| [[XML%2FOutput|XML/Output]]
| Task
|-
| 53
| [[Calendar|Calendar]]
| Task
|-
| 53
| [[Factors%20of%20a%20Mersenne%20number|Factors of a Mersenne number]]
| Task
|-
| 53
| [[Forest%20fire|Forest fire]]
| Task
|-
| 53
| [[Globally%20replace%20text%20in%20several%20files|Globally replace text in several files]]
| Task
|-
| 53
| [[Old%20lady%20swallowed%20a%20fly|Old lady swallowed a fly]]
| Task
|-
| 53
| [[Pernicious%20numbers|Pernicious numbers]]
| Task
|-
| 53
| [[Reduced%20row%20echelon%20form|Reduced row echelon form]]
| Task
|-
| 53
| [[Stem-and-leaf%20plot|Stem-and-leaf plot]]
| Task
|-
| 53
| [[Test%20a%20function|Test a function]]
| Task
|-
| 53
| [[Yin%20and%20yang|Yin and yang]]
| Task
|-
| 52
|data-sort-value="0C24 game/solve"| [[24%20game%2FSolve|24 game/Solve]]
| Task
|-
| 52
| [[Documentation|Documentation]]
| Task
|-
| 52
| [[Extreme%20floating%20point%20values|Extreme floating point values]]
| Task
|-
| 52
| [[Fibonacci%20word|Fibonacci word]]
| Task
|-
| 52
| [[Huffman%20coding|Huffman coding]]
| Task
|-
| 52
| [[Odd%20word%20problem|Odd word problem]]
| Task
|-
| 52
| [[Singleton|Singleton]]
| Task
|-
| 52
| [[Sorting%20algorithms%2FBead%20sort|Sorting algorithms/Bead sort]]
| Task
|-
| 52
| [[Synchronous%20concurrency|Synchronous concurrency]]
| Task
|-
| 52
| [[Write%20entire%20file|Write entire file]]
| Task
|-
| 52
|data-sort-value="write language name in 0B3d ascii"| [[Write%20language%20name%20in%203D%20ASCII|Write language name in 3D ASCII]]
| Task
|-
| 52
| [[XML%2FXPath|XML/XPath]]
| Task
|-
| 51
| [[Animate%20a%20pendulum|Animate a pendulum]]
| Task
|-
| 51
| [[Arithmetic%20evaluation|Arithmetic evaluation]]
| Task
|-
| 51
| [[Binary%20strings|Binary strings]]
| Task
|-
| 51
| [[Hash%20join|Hash join]]
| Task
|-
| 51
| [[Knapsack%20problem%2FContinuous|Knapsack problem/Continuous]]
| Task
|-
| 51
| [[Rep-string|Rep-string]]
| Task
|- style="background-color: #ffc"
| 51
| [[Repeat|Repeat]]
| Draft
|-
| 51
| [[Sequence%20of%20primes%20by%20trial%20division|Sequence of primes by trial division]]
| Task
|-
| 51
| [[Stack%20traces|Stack traces]]
| Task
|-
| 50
| [[Add%20a%20variable%20to%20a%20class%20instance%20at%20runtime|Add a variable to a class instance at runtime]]
| Task
|-
| 50
| [[Brownian%20tree|Brownian tree]]
| Task
|-
| 50
| [[Compile-time%20calculation|Compile-time calculation]]
| Task
|-
| 50
| [[Continued%20fraction|Continued fraction]]
| Task
|-
| 50
| [[Miller%E2%80%93Rabin%20primality%20test|Miller–Rabin primality test]]
| Task
|-
| 50
| [[Rosetta%20Code%2FRank%20languages%20by%20popularity|Rosetta Code/Rank languages by popularity]]
| Task
|-
| 50
| [[Runtime%20evaluation%2FIn%20an%20environment|Runtime evaluation/In an environment]]
| Task
|-
| 50
| [[Scope%20modifiers|Scope modifiers]]
| Task
|-
| 50
| [[Semiprime|Semiprime]]
| Task
|-
| 50
| [[Sorting%20algorithms%2FPermutation%20sort|Sorting algorithms/Permutation sort]]
| Task
|-
| 50
| [[Truncate%20a%20file|Truncate a file]]
| Task
|-
| 50
| [[Unix%2Fls|Unix/ls]]
| Task
|-
| 49
| [[Averages%2FMean%20time%20of%20day|Averages/Mean time of day]]
| Task
|-
| 49
| [[Deal%20cards%20for%20FreeCell|Deal cards for FreeCell]]
| Task
|-
| 49
| [[Dinesman%27s%20multiple-dwelling%20problem|Dinesman's multiple-dwelling problem]]
| Task
|-
| 49
| [[Draw%20a%20clock|Draw a clock]]
| Task
|-
| 49
| [[Euler%27s%20sum%20of%20powers%20conjecture|Euler's sum of powers conjecture]]
| Task
|-
| 49
| [[Knight%27s%20tour|Knight's tour]]
| Task
|-
| 49
| [[LZW%20compression|LZW compression]]
| Task
|-
| 49
| [[Morse%20code|Morse code]]
| Task
|-
| 49
| [[Plot%20coordinate%20pairs|Plot coordinate pairs]]
| Task
|-
| 49
| [[Tic-tac-toe|Tic-tac-toe]]
| Task
|-
| 49
| [[Truncatable%20primes|Truncatable primes]]
| Task
|-
| 49
| [[Unbias%20a%20random%20generator|Unbias a random generator]]
| Task
|-
| 48
| [[Circles%20of%20given%20radius%20through%20two%20points|Circles of given radius through two points]]
| Task
|-
| 48
| [[Doubly-linked%20list%2FElement%20definition|Doubly-linked list/Element definition]]
| Task
|-
| 48
| [[Generator%2FExponential|Generator/Exponential]]
| Task
|-
| 48
| [[Modular%20exponentiation|Modular exponentiation]]
| Task
|- style="background-color: #ffc"
| 48
| [[Modulinos|Modulinos]]
| Draft
|-
| 48
| [[Pointers%20and%20references|Pointers and references]]
| Task
|-
| 48
| [[Send%20email|Send email]]
| Task
|-
| 48
| [[Terminal%20control%2FDisplay%20an%20extended%20character|Terminal control/Display an extended character]]
| Task
|-
| 48
| [[Unicode%20strings|Unicode strings]]
| Task
|-
| 47
| [[Bitmap%2FWrite%20a%20PPM%20file|Bitmap/Write a PPM file]]
| Task
|-
| 47
| [[Dutch%20national%20flag%20problem|Dutch national flag problem]]
| Task
|-
| 47
| [[I%20before%20E%20except%20after%20C|I before E except after C]]
| Task
|-
| 47
| [[Integer%20overflow|Integer overflow]]
| Task
|-
| 47
| [[Left%20factorials|Left factorials]]
| Task
|-
| 47
| [[Mouse%20position|Mouse position]]
| Task
|-
| 47
| [[Multisplit|Multisplit]]
| Task
|-
| 47
| [[Non-continuous%20subsequences|Non-continuous subsequences]]
| Task
|-
| 47
| [[Random%20number%20generator%20%28device%29|Random number generator (device)]]
| Task
|-
| 47
| [[Split%20a%20character%20string%20based%20on%20change%20of%20character|Split a character string based on change of character]]
| Task
|-
| 47
| [[Statistics%2FBasic|Statistics/Basic]]
| Task
|-
| 47
| [[Topological%20sort|Topological sort]]
| Task
|-
| 47
| [[Wireworld|Wireworld]]
| Task
|-
| 46
| [[DNS%20query|DNS query]]
| Task
|-
| 46
| [[Grayscale%20image|Grayscale image]]
| Task
|-
| 46
| [[Handle%20a%20signal|Handle a signal]]
| Task
|-
| 46
| [[Nested%20function|Nested function]]
| Task
|-
| 46
| [[Respond%20to%20an%20unknown%20method%20call|Respond to an unknown method call]]
| Task
|-
| 46
|data-sort-value="text processing/0B1"| [[Text%20processing%2F1|Text processing/1]]
| Task
|-
| 46
|data-sort-value="text processing/0B2"| [[Text%20processing%2F2|Text processing/2]]
| Task
|-
| 46
| [[User%20input%2FGraphical|User input/Graphical]]
| Task
|-
| 45
| [[Define%20a%20primitive%20data%20type|Define a primitive data type]]
| Task
|-
| 45
| [[Draw%20a%20cuboid|Draw a cuboid]]
| Task
|-
| 45
| [[First-class%20functions%2FUse%20numbers%20analogously|First-class functions/Use numbers analogously]]
| Task
|-
| 45
| [[JortSort|JortSort]]
| Task
|-
| 45
| [[Ludic%20numbers|Ludic numbers]]
| Task
|-
| 45
| [[Mad%20Libs|Mad Libs]]
| Task
|-
| 45
| [[Maximum%20triangle%20path%20sum|Maximum triangle path sum]]
| Task
|-
| 45
| [[Seven-sided%20dice%20from%20five-sided%20dice|Seven-sided dice from five-sided dice]]
| Task
|-
| 45
| [[Stable%20marriage%20problem|Stable marriage problem]]
| Task
|-
| 45
| [[XML%2FDOM%20serialization|XML/DOM serialization]]
| Task
|-
| 44
|data-sort-value="0B9 billion names of god the integer"| [[9%20billion%20names%20of%20God%20the%20integer|9 billion names of God the integer]]
| Task
|-
| 44
| [[Chinese%20remainder%20theorem|Chinese remainder theorem]]
| Task
|-
| 44
| [[Delegates|Delegates]]
| Task
|-
| 44
| [[General%20FizzBuzz|General FizzBuzz]]
| Task
|-
| 44
| [[Heronian%20triangles|Heronian triangles]]
| Task
|-
| 44
| [[Matrix-exponentiation%20operator|Matrix-exponentiation operator]]
| Task
|-
| 44
| [[Munchausen%20numbers|Munchausen numbers]]
| Task
|-
| 44
| [[Population%20count|Population count]]
| Task
|-
| 44
| [[Sierpinski%20triangle%2FGraphical|Sierpinski triangle/Graphical]]
| Task
|-
| 44
| [[Table%20creation%2FPostal%20addresses|Table creation/Postal addresses]]
| Task
|-
| 44
| [[Ternary%20logic|Ternary logic]]
| Task
|-
| 44
| [[Thue-Morse|Thue-Morse]]
| Task
|-
| 43
| [[Bernoulli%20numbers|Bernoulli numbers]]
| Task
|-
| 43
| [[Call%20a%20function%20in%20a%20shared%20library|Call a function in a shared library]]
| Task
|-
| 43
| [[Discordian%20date|Discordian date]]
| Task
|-
| 43
| [[Longest%20increasing%20subsequence|Longest increasing subsequence]]
| Task
|-
| 43
| [[Munching%20squares|Munching squares]]
| Task
|-
| 43
| [[Quickselect%20algorithm|Quickselect algorithm]]
| Task
|-
| 43
| [[Send%20an%20unknown%20method%20call|Send an unknown method call]]
| Task
|-
| 43
| [[Terminal%20control%2FCursor%20positioning|Terminal control/Cursor positioning]]
| Task
|-
| 42
|data-sort-value="0C15 puzzle game"| [[15%20Puzzle%20Game|15 Puzzle Game]]
| Task
|-
| 42
| [[Dining%20philosophers|Dining philosophers]]
| Task
|-
| 42
| [[Doubly-linked%20list%2FElement%20insertion|Doubly-linked list/Element insertion]]
| Task
|-
| 42
| [[Emirp%20primes|Emirp primes]]
| Task
|-
| 42
| [[Polymorphic%20copy|Polymorphic copy]]
| Task
|-
| 41
| [[Color%20of%20a%20screen%20pixel|Color of a screen pixel]]
| Task
|-
| 41
| [[Convert%20decimal%20number%20to%20rational|Convert decimal number to rational]]
| Task
|-
| 41
| [[Doubly-linked%20list%2FTraversal|Doubly-linked list/Traversal]]
| Task
|-
| 41
| [[Echo%20server|Echo server]]
| Task
|-
| 41
| [[Execute%20a%20Markov%20algorithm|Execute a Markov algorithm]]
| Task
|-
| 41
| [[Hofstadter%20Figure-Figure%20sequences|Hofstadter Figure-Figure sequences]]
| Task
|-
| 41
| [[Holidays%20related%20to%20Easter|Holidays related to Easter]]
| Task
|-
| 41
| [[Inverted%20syntax|Inverted syntax]]
| Task
|-
| 41
| [[Iterated%20digits%20squaring|Iterated digits squaring]]
| Task
|-
| 41
| [[Longest%20string%20challenge|Longest string challenge]]
| Task
|-
| 41
| [[Make%20directory%20path|Make directory path]]
| Task
|-
| 41
| [[Rate%20counter|Rate counter]]
| Task
|-
| 41
| [[Strip%20block%20comments|Strip block comments]]
| Task
|- style="background-color: #ffc"
| 41
| [[Two%20Sum|Two Sum]]
| Draft
|-
| 40
| [[Exponentiation%20order|Exponentiation order]]
| Task
|-
| 40
| [[GUI%20component%20interaction|GUI component interaction]]
| Task
|-
| 40
| [[Keyboard%20input%2FKeypress%20check|Keyboard input/Keypress check]]
| Task
|-
| 40
| [[Last%20letter-first%20letter|Last letter-first letter]]
| Task
|-
| 40
| [[Move-to-front%20algorithm|Move-to-front algorithm]]
| Task
|-
| 40
| [[Parsing%2FShunting-yard%20algorithm|Parsing/Shunting-yard algorithm]]
| Task
|-
| 40
| [[Rosetta%20Code%2FCount%20examples|Rosetta Code/Count examples]]
| Task
|-
| 40
| [[Universal%20Turing%20machine|Universal Turing machine]]
| Task
|-
| 40
| [[Verify%20distribution%20uniformity%2FNaive|Verify distribution uniformity/Naive]]
| Task
|-
| 39
| [[Atomic%20updates|Atomic updates]]
| Task
|-
| 39
| [[Barnsley%20fern|Barnsley fern]]
| Task
|-
| 39
| [[Bitmap%2FFlood%20fill|Bitmap/Flood fill]]
| Task
|-
| 39
| [[Bitmap%2FRead%20a%20PPM%20file|Bitmap/Read a PPM file]]
| Task
|- style="background-color: #ffc"
| 39
| [[Extract%20file%20extension|Extract file extension]]
| Draft
|-
| 39
| [[Get%20system%20command%20output|Get system command output]]
| Task
|-
| 39
| [[Greyscale%20bars%2FDisplay|Greyscale bars/Display]]
| Task
|-
| 39
| [[Polynomial%20regression|Polynomial regression]]
| Task
|-
| 39
| [[Search%20a%20list%20of%20records|Search a list of records]]
| Task
|-
| 39
| [[Terminal%20control%2FColoured%20text|Terminal control/Coloured text]]
| Task
|-
| 39
| [[Zebra%20puzzle|Zebra puzzle]]
| Task
|-
| 38
| [[Bitmap%2FMidpoint%20circle%20algorithm|Bitmap/Midpoint circle algorithm]]
| Task
|-
| 38
| [[Determine%20if%20only%20one%20instance%20is%20running|Determine if only one instance is running]]
| Task
|-
| 38
| [[Digital%20root%2FMultiplicative%20digital%20root|Digital root/Multiplicative digital root]]
| Task
|-
| 38
| [[FASTA%20format|FASTA format]]
| Task
|-
| 38
| [[OpenGL|OpenGL]]
| Task
|-
| 38
| [[Polynomial%20long%20division|Polynomial long division]]
| Task
|-
| 38
| [[Problem%20of%20Apollonius|Problem of Apollonius]]
| Task
|-
| 38
| [[Secure%20temporary%20file|Secure temporary file]]
| Task
|-
| 38
| [[Set%20consolidation|Set consolidation]]
| Task
|-
| 38
| [[Sorting%20algorithms%2FStrand%20sort|Sorting algorithms/Strand sort]]
| Task
|-
| 38
| [[Sparkline%20in%20unicode|Sparkline in unicode]]
| Task
|-
| 37
| [[Doubly-linked%20list%2FDefinition|Doubly-linked list/Definition]]
| Task
|-
| 37
| [[Fractran|Fractran]]
| Task
|-
| 37
| [[Image%20noise|Image noise]]
| Task
|-
| 37
| [[Parametric%20polymorphism|Parametric polymorphism]]
| Task
|-
| 37
| [[Perfect%20shuffle|Perfect shuffle]]
| Task
|-
| 37
| [[Pig%20the%20dice%20game|Pig the dice game]]
| Task
|-
| 37
| [[Subtractive%20generator|Subtractive generator]]
| Task
|-
| 37
| [[Variable%20size%2FSet|Variable size/Set]]
| Task
|-
| 36
| [[Active%20object|Active object]]
| Task
|- style="background-color: #ffc"
| 36
| [[Dijkstra%27s%20algorithm|Dijkstra's algorithm]]
| Draft
|-
| 36
|data-sort-value="generate chess0D960 starting position"| [[Generate%20Chess960%20starting%20position|Generate Chess960 starting position]]
| Task
|-
| 36
| [[History%20variables|History variables]]
| Task
|-
| 36
| [[Inverted%20index|Inverted index]]
| Task
|-
| 36
|data-sort-value="md0B5/implementation"| [[MD5%2FImplementation|MD5/Implementation]]
| Task
|-
| 36
| [[Metaprogramming|Metaprogramming]]
| Task
|-
| 36
| [[Narcissist|Narcissist]]
| Task
|-
| 36
| [[Pascal%20matrix%20generation|Pascal matrix generation]]
| Task
|-
| 36
| [[Permutations%20by%20swapping|Permutations by swapping]]
| Task
|-
| 36
| [[Stern-Brocot%20sequence|Stern-Brocot sequence]]
| Task
|-
| 36
| [[Twelve%20statements|Twelve statements]]
| Task
|-
| 35
| [[Append%20a%20record%20to%20the%20end%20of%20a%20text%20file|Append a record to the end of a text file]]
| Task
|- style="background-color: #ffc"
| 35
|data-sort-value="base0C64 encode data"| [[Base64%20encode%20data|Base64 encode data]]
| Draft
|-
| 35
| [[Bulls%20and%20cows%2FPlayer|Bulls and cows/Player]]
| Task
|-
| 35
| [[Colour%20bars%2FDisplay|Colour bars/Display]]
| Task
|-
| 35
| [[Department%20Numbers|Department Numbers]]
| Task
|-
| 35
| [[Element-wise%20operations|Element-wise operations]]
| Task
|-
| 35
| [[Farey%20sequence|Farey sequence]]
| Task
|-
| 35
| [[GUI%20enabling%2Fdisabling%20of%20controls|GUI enabling/disabling of controls]]
| Task
|-
| 35
| [[Knapsack%20problem%2FBounded|Knapsack problem/Bounded]]
| Task
|-
| 35
| [[Kronecker%20product|Kronecker product]]
| Task
|-
| 35
| [[Matrix%20arithmetic|Matrix arithmetic]]
| Task
|-
| 35
| [[Parallel%20calculations|Parallel calculations]]
| Task
|-
| 35
| [[Percentage%20difference%20between%20images|Percentage difference between images]]
| Task
|-
| 35
| [[Permutations%2FDerangements|Permutations/Derangements]]
| Task
|-
| 35
| [[Ray-casting%20algorithm|Ray-casting algorithm]]
| Task
|-
| 35
| [[Smith%20numbers|Smith numbers]]
| Task
|-
| 35
| [[Subleq|Subleq]]
| Task
|-
| 35
|data-sort-value="sum to 0D100"| [[Sum%20to%20100|Sum to 100]]
| Task
|-
| 35
| [[Terminal%20control%2FDimensions|Terminal control/Dimensions]]
| Task
|-
| 35
| [[Validate%20International%20Securities%20Identification%20Number|Validate International Securities Identification Number]]
| Task
|-
| 35
| [[Variable-length%20quantity|Variable-length quantity]]
| Task
|-
| 35
| [[Visualize%20a%20tree|Visualize a tree]]
| Task
|-
| 34
| [[Amb|Amb]]
| Task
|-
| 34
| [[Archimedean%20spiral|Archimedean spiral]]
| Task
|-
| 34
| [[Average%20loop%20length|Average loop length]]
| Task
|-
| 34
| [[Balanced%20ternary|Balanced ternary]]
| Task
|-
| 34
| [[Calendar%20-%20for%20%22REAL%22%20programmers|Calendar - for "REAL" programmers]]
| Task
|-
| 34
| [[Constrained%20genericity|Constrained genericity]]
| Task
|-
| 34
| [[Jaro%20distance|Jaro distance]]
| Task
|-
| 34
| [[Leonardo%20numbers|Leonardo numbers]]
| Task
|- style="background-color: #ffc"
| 34
| [[Longest%20common%20prefix|Longest common prefix]]
| Draft
|-
| 34
| [[Self-referential%20sequence|Self-referential sequence]]
| Task
|-
| 34
| [[Statistics%2FNormal%20distribution|Statistics/Normal distribution]]
| Task
|-
| 34
| [[Tokenize%20a%20string%20with%20escaping|Tokenize a string with escaping]]
| Task
|-
| 34
| [[Topswops|Topswops]]
| Task
|-
| 33
|data-sort-value="carmichael 0B3 strong pseudoprimes"| [[Carmichael%203%20strong%20pseudoprimes|Carmichael 3 strong pseudoprimes]]
| Task
|-
| 33
| [[Combinations%20and%20permutations|Combinations and permutations]]
| Task
|-
| 33
| [[Gaussian%20elimination|Gaussian elimination]]
| Task
|-
| 33
| [[Hickerson%20series%20of%20almost%20integers|Hickerson series of almost integers]]
| Task
|-
| 33
| [[Naming%20conventions|Naming conventions]]
| Task
|-
| 33
| [[Parsing%2FRPN%20to%20infix%20conversion|Parsing/RPN to infix conversion]]
| Task
|-
| 33
| [[Sorting%20algorithms%2FRadix%20sort|Sorting algorithms/Radix sort]]
| Task
|-
| 33
| [[Start%20from%20a%20main%20routine|Start from a main routine]]
| Task
|-
| 33
| [[Ulam%20spiral%20%28for%20primes%29|Ulam spiral (for primes)]]
| Task
|-
| 32
|data-sort-value="0E2048"| [[2048|2048]]
| Task
|-
| 32
|data-sort-value="0B4-rings or 0B4-squares puzzle"| [[4-rings%20or%204-squares%20puzzle|4-rings or 4-squares puzzle]]
| Task
|-
| 32
| [[Aliquot%20sequence%20classifications|Aliquot sequence classifications]]
| Task
|-
| 32
| [[Break%20OO%20privacy|Break OO privacy]]
| Task
|-
| 32
| [[Events|Events]]
| Task
|-
| 32
| [[Extensible%20prime%20generator|Extensible prime generator]]
| Task
|-
| 32
| [[GUI%2FMaximum%20window%20dimensions|GUI/Maximum window dimensions]]
| Task
|-
| 32
| [[Knuth%27s%20algorithm%20S|Knuth's algorithm S]]
| Task
|-
| 32
| [[Metered%20concurrency|Metered concurrency]]
| Task
|- style="background-color: #ffc"
| 32
| [[Multiline%20shebang|Multiline shebang]]
| Draft
|-
| 32
| [[Order%20disjoint%20list%20items|Order disjoint list items]]
| Task
|-
| 32
| [[Pascal%27s%20triangle%2FPuzzle|Pascal's triangle/Puzzle]]
| Task
|-
| 32
| [[Password%20generator|Password generator]]
| Task
|-
| 32
| [[S-Expressions|S-Expressions]]
| Task
|-
| 32
| [[Test%20integerness|Test integerness]]
| Task
|-
| 32
| [[Vampire%20number|Vampire number]]
| Task
|-
| 32
| [[Voronoi%20diagram|Voronoi diagram]]
| Task
|-
| 31
| [[CUSIP|CUSIP]]
| Task
|-
| 31
| [[Chaos%20game|Chaos game]]
| Task
|-
| 31
| [[Deepcopy|Deepcopy]]
| Task
|-
| 31
| [[Keyboard%20input%2FFlush%20the%20keyboard%20buffer|Keyboard input/Flush the keyboard buffer]]
| Task
|-
| 31
|data-sort-value="md0B4"| [[MD4|MD4]]
| Task
|-
| 31
| [[Permutation%20test|Permutation test]]
| Task
|-
| 31
| [[Taxicab%20numbers|Taxicab numbers]]
| Task
|- style="background-color: #ffc"
| 31
| [[Vector|Vector]]
| Draft
|-
| 30
| [[Bitmap%2FB%C3%A9zier%20curves%2FCubic|Bitmap/Bézier curves/Cubic]]
| Task
|-
| 30
| [[Cartesian%20product%20of%20two%20or%20more%20lists|Cartesian product of two or more lists]]
| Task
|-
| 30
| [[Casting%20out%20nines|Casting out nines]]
| Task
|-
| 30
| [[Fibonacci%20word%2Ffractal|Fibonacci word/fractal]]
| Task
|-
| 30
| [[LU%20decomposition|LU decomposition]]
| Task
|-
| 30
| [[Numerical%20integration%2FGauss-Legendre%20Quadrature|Numerical integration/Gauss-Legendre Quadrature]]
| Task
|-
| 30
| [[Ordered%20Partitions|Ordered Partitions]]
| Task
|- style="background-color: #ffc"
| 30
| [[Permutations%20with%20repetitions|Permutations with repetitions]]
| Draft
|-
| 30
| [[Scope%2FFunction%20names%20and%20labels|Scope/Function names and labels]]
| Task
|-
| 30
| [[Sort%20three%20variables|Sort three variables]]
| Task
|-
| 30
| [[Speech%20synthesis|Speech synthesis]]
| Task
|-
| 30
| [[Terminal%20control%2FInverse%20video|Terminal control/Inverse video]]
| Task
|-
| 29
| [[Bitmap%2FHistogram|Bitmap/Histogram]]
| Task
|-
| 29
| [[Conjugate%20transpose|Conjugate transpose]]
| Task
|-
| 29
| [[Function%20prototype|Function prototype]]
| Task
|- style="background-color: #ffc"
| 29
| [[Input%2FOutput%20for%20Pairs%20of%20Numbers|Input/Output for Pairs of Numbers]]
| Draft
|-
| 29
| [[Maze%20solving|Maze solving]]
| Task
|-
| 28
| [[Bitmap%2FB%C3%A9zier%20curves%2FQuadratic|Bitmap/Bézier curves/Quadratic]]
| Task
|-
| 28
| [[Bitwise%20IO|Bitwise IO]]
| Task
|-
| 28
| [[Elementary%20cellular%20automaton|Elementary cellular automaton]]
| Task
|-
| 28
| [[Executable%20library|Executable library]]
| Task
|-
| 28
| [[Flipping%20bits%20game|Flipping bits game]]
| Task
|-
| 28
| [[Minesweeper%20game|Minesweeper game]]
| Task
|-
| 28
| [[Object%20serialization|Object serialization]]
| Task
|- style="background-color: #ffc"
| 28
| [[Parse%20command-line%20arguments|Parse command-line arguments]]
| Draft
|-
| 28
| [[Primorial%20numbers|Primorial numbers]]
| Task
|-
| 28
| [[Simple%20database|Simple database]]
| Task
|-
| 28
| [[Sutherland-Hodgman%20polygon%20clipping|Sutherland-Hodgman polygon clipping]]
| Task
|-
| 28
| [[Terminal%20control%2FHiding%20the%20cursor|Terminal control/Hiding the cursor]]
| Task
|-
| 28
| [[Terminal%20control%2FUnicode%20output|Terminal control/Unicode output]]
| Task
|-
| 28
| [[Topic%20variable|Topic variable]]
| Task
|-
| 28
| [[Water%20collected%20between%20towers|Water collected between towers]]
| Task
|-
| 27
| [[Bitcoin%2Faddress%20validation|Bitcoin/address validation]]
| Task
|-
| 27
| [[Colour%20pinstripe%2FDisplay|Colour pinstripe/Display]]
| Task
|- style="background-color: #ffc"
| 27
| [[File%20extension%20is%20in%20extensions%20list|File extension is in extensions list]]
| Draft
|-
| 27
| [[Find%20the%20intersection%20of%20two%20lines|Find the intersection of two lines]]
| Task
|- style="background-color: #ffc"
| 27
| [[Input%2FOutput%20for%20Lines%20of%20Text|Input/Output for Lines of Text]]
| Draft
|-
| 27
| [[Julia%20set|Julia set]]
| Task
|-
| 27
| [[Multiple%20regression|Multiple regression]]
| Task
|-
| 27
| [[Pinstripe%2FDisplay|Pinstripe/Display]]
| Task
|- style="background-color: #ffc"
| 27
| [[Sattolo%20cycle|Sattolo cycle]]
| Draft
|-
| 26
| [[Memory%20layout%20of%20a%20data%20structure|Memory layout of a data structure]]
| Task
|-
| 26
| [[Numeric%20error%20propagation|Numeric error propagation]]
| Task
|-
| 26
| [[Pathological%20floating%20point%20problems|Pathological floating point problems]]
| Task
|-
| 26
| [[Penney%27s%20game|Penney's game]]
| Task
|-
| 26
| [[RSA%20code|RSA code]]
| Task
|-
| 26
| [[Ranking%20methods|Ranking methods]]
| Task
|-
| 26
| [[Sailors%2C%20coconuts%20and%20a%20monkey%20problem|Sailors, coconuts and a monkey problem]]
| Task
|-
| 26
| [[Set%20puzzle|Set puzzle]]
| Task
|-
| 26
| [[Solve%20a%20Hidato%20puzzle|Solve a Hidato puzzle]]
| Task
|- style="background-color: #ffc"
| 26
| [[Sorting%20Algorithms%2FCircle%20Sort|Sorting Algorithms/Circle Sort]]
| Draft
|-
| 26
| [[Use%20another%20language%20to%20call%20a%20function|Use another language to call a function]]
| Task
|-
| 26
| [[Xiaolin%20Wu%27s%20line%20algorithm|Xiaolin Wu's line algorithm]]
| Task
|-
| 26
| [[Zhang-Suen%20thinning%20algorithm|Zhang-Suen thinning algorithm]]
| Task
|-
| 25
| [[Arena%20storage%20pool|Arena storage pool]]
| Task
|- style="background-color: #ffc"
| 25
| [[Check%20output%20device%20is%20a%20terminal|Check output device is a terminal]]
| Draft
|-
| 25
| [[Continued%20fraction%2FArithmetic%2FConstruct%20from%20rational%20number|Continued fraction/Arithmetic/Construct from rational number]]
| Task
|-
| 25
| [[Entropy%2FNarcissist|Entropy/Narcissist]]
| Task
|-
| 25
| [[Execute%20SNUSP|Execute SNUSP]]
| Task
|-
| 25
| [[First%20class%20environments|First class environments]]
| Task
|-
| 25
| [[Floyd-Warshall%20algorithm|Floyd-Warshall algorithm]]
| Task
|-
| 25
| [[Formal%20power%20series|Formal power series]]
| Task
|- style="background-color: #ffc"
| 25
| [[Longest%20Common%20Substring|Longest Common Substring]]
| Draft
|-
| 25
| [[Magic%20squares%20of%20doubly%20even%20order|Magic squares of doubly even order]]
| Task
|-
| 25
| [[Multiplicative%20order|Multiplicative order]]
| Task
|-
| 25
| [[Parametrized%20SQL%20statement|Parametrized SQL statement]]
| Task
|-
| 25
| [[QR%20decomposition|QR decomposition]]
| Task
|-
| 25
|data-sort-value="ripemd-0D160"| [[RIPEMD-160|RIPEMD-160]]
| Task
|- style="background-color: #ffc"
| 25
|data-sort-value="read a file character by character/utf0B8"| [[Read%20a%20file%20character%20by%20character%2FUTF8|Read a file character by character/UTF8]]
| Draft
|-
| 25
| [[Rosetta%20Code%2FFind%20unimplemented%20tasks|Rosetta Code/Find unimplemented tasks]]
| Task
|-
| 25
| [[Same%20Fringe|Same Fringe]]
| Task
|-
| 25
| [[State%20name%20puzzle|State name puzzle]]
| Task
|-
| 25
| [[Straddling%20checkerboard|Straddling checkerboard]]
| Task
|- style="background-color: #ffc"
| 25
| [[Subset%20sum%20problem|Subset sum problem]]
| Draft
|-
| 25
| [[Textonyms|Textonyms]]
| Task
|-
| 25
| [[Update%20a%20configuration%20file|Update a configuration file]]
| Task
|-
| 24
| [[Brace%20expansion|Brace expansion]]
| Task
|-
| 24
| [[Chinese%20zodiac|Chinese zodiac]]
| Task
|-
| 24
|data-sort-value="deconvolution/0B1d"| [[Deconvolution%2F1D|Deconvolution/1D]]
| Task
|-
| 24
| [[Distributed%20programming|Distributed programming]]
| Task
|-
| 24
| [[Egyptian%20division|Egyptian division]]
| Task
|-
| 24
| [[Find%20palindromic%20numbers%20in%20both%20binary%20and%20ternary%20bases|Find palindromic numbers in both binary and ternary bases]]
| Task
|-
| 24
| [[Keyboard%20macros|Keyboard macros]]
| Task
|-
| 24
| [[Metronome|Metronome]]
| Task
|- style="background-color: #ffc"
| 24
| [[Musical%20scale|Musical scale]]
| Draft
|-
| 24
| [[Pragmatic%20directives|Pragmatic directives]]
| Task
|-
| 24
| [[Resistor%20mesh|Resistor mesh]]
| Task
|-
| 24
| [[Rosetta%20Code%2FFix%20code%20tags|Rosetta Code/Fix code tags]]
| Task
|- style="background-color: #ffc"
| 24
| [[Sorting%20algorithms%2FCycle%20sort|Sorting algorithms/Cycle sort]]
| Draft
|-
| 23
| [[Arithmetic-geometric%20mean%2FCalculate%20Pi|Arithmetic-geometric mean/Calculate Pi]]
| Task
|-
| 23
| [[Cramer%27s%20rule|Cramer's rule]]
| Task
|-
| 23
| [[Death%20Star|Death Star]]
| Task
|- style="background-color: #ffc"
| 23
| [[Find%20first%20and%20last%20set%20bit%20of%20a%20long%20integer|Find first and last set bit of a long integer]]
| Draft
|-
| 23
| [[Lychrel%20numbers|Lychrel numbers]]
| Task
|-
| 23
| [[Natural%20sorting|Natural sorting]]
| Task
|-
| 23
| [[Paraffins|Paraffins]]
| Task
|-
| 23
| [[Pattern%20matching|Pattern matching]]
| Task
|-
| 23
| [[Pythagoras%20tree|Pythagoras tree]]
| Task
|-
| 23
| [[Rosetta%20Code%2FFind%20bare%20lang%20tags|Rosetta Code/Find bare lang tags]]
| Task
|-
| 23
| [[Solve%20the%20no%20connection%20puzzle|Solve the no connection puzzle]]
| Task
|-
| 23
| [[Sort%20a%20list%20of%20object%20identifiers|Sort a list of object identifiers]]
| Task
|- style="background-color: #ffc"
| 23
| [[Sorting%20algorithms%2FPatience%20sort|Sorting algorithms/Patience sort]]
| Draft
|-
| 23
| [[Stream%20Merge|Stream Merge]]
| Task
|-
| 23
| [[Truth%20table|Truth table]]
| Task
|-
| 23
|data-sort-value="window creation/x0C11"| [[Window%20creation%2FX11|Window creation/X11]]
| Task
|-
| 22
| [[Active%20Directory%2FConnect|Active Directory/Connect]]
| Task
|-
| 22
| [[Angle%20difference%20between%20two%20bearings|Angle difference between two bearings]]
| Task
|-
| 22
| [[Check%20Machin-like%20formulas|Check Machin-like formulas]]
| Task
|-
| 22
| [[Checkpoint%20synchronization|Checkpoint synchronization]]
| Task
|-
| 22
| [[Create%20a%20file%20on%20magnetic%20tape|Create a file on magnetic tape]]
| Task
|-
| 22
| [[FTP|FTP]]
| Task
|-
| 22
| [[Galton%20box%20animation|Galton box animation]]
| Task
|-
| 22
| [[Go%20Fish|Go Fish]]
| Task
|- style="background-color: #ffc"
| 22
| [[Prime%20conspiracy|Prime conspiracy]]
| Draft
|- style="background-color: #ffc"
| 22
| [[Text%20between|Text between]]
| Draft
|- style="background-color: #ffc"
| 22
| [[Word%20count|Word count]]
| Draft
|-
| 22
| [[Write%20to%20Windows%20event%20log|Write to Windows event log]]
| Task
|-
| 21
| [[Chat%20server|Chat server]]
| Task
|- style="background-color: #ffc"
| 21
| [[Check%20input%20device%20is%20a%20terminal|Check input device is a terminal]]
| Draft
|- style="background-color: #ffc"
| 21
| [[Currency|Currency]]
| Draft
|-
| 21
| [[Find%20largest%20left%20truncatable%20prime%20in%20a%20given%20base|Find largest left truncatable prime in a given base]]
| Task
|-
| 21
| [[Honeycombs|Honeycombs]]
| Task
|- style="background-color: #ffc"
| 21
| [[Implicit%20type%20conversion|Implicit type conversion]]
| Draft
|-
| 21
| [[Nautical%20bell|Nautical bell]]
| Task
|-
| 21
| [[Set%20of%20real%20numbers|Set of real numbers]]
| Task
|-
| 21
| [[Solve%20a%20Holy%20Knight%27s%20tour|Solve a Holy Knight's tour]]
| Task
|-
| 21
| [[Sum%20and%20Product%20Puzzle|Sum and Product Puzzle]]
| Task
|- style="background-color: #ffc"
| 21
| [[Table%20creation|Table creation]]
| Draft
|-
| 21
| [[Terminal%20control%2FCursor%20movement|Terminal control/Cursor movement]]
| Task
|-
| 21
| [[Terminal%20control%2FPreserve%20screen|Terminal control/Preserve screen]]
| Task
|-
| 21
| [[The%20ISAAC%20Cipher|The ISAAC Cipher]]
| Task
|-
| 21
| [[URL%20parser|URL parser]]
| Task
|-
| 21
|data-sort-value="utf-0B8 encode and decode"| [[UTF-8%20encode%20and%20decode|UTF-8 encode and decode]]
| Task
|-
| 21
| [[Verify%20distribution%20uniformity%2FChi-squared%20test|Verify distribution uniformity/Chi-squared test]]
| Task
|- style="background-color: #ffc"
| 20
| [[Birthday%20problem|Birthday problem]]
| Draft
|- style="background-color: #ffc"
| 20
| [[Cycle%20detection|Cycle detection]]
| Draft
|- style="background-color: #ffc"
| 20
| [[Decimal%20floating%20point%20number%20to%20binary|Decimal floating point number to binary]]
| Draft
|-
| 20
| [[Function%20frequency|Function frequency]]
| Task
|-
| 20
| [[Image%20convolution|Image convolution]]
| Task
|-
| 20
| [[MAC%20Vendor%20Lookup|MAC Vendor Lookup]]
| Task
|- style="background-color: #ffc"
| 20
| [[Multi-dimensional%20array|Multi-dimensional array]]
| Draft
|-
| 20
| [[Partition%20an%20integer%20X%20into%20N%20primes|Partition an integer X into N primes]]
| Task
|-
| 20
| [[Pentagram|Pentagram]]
| Task
|-
| 20
| [[Percolation%2FMean%20run%20density|Percolation/Mean run density]]
| Task
|-
| 20
| [[Permutations%2FRank%20of%20a%20permutation|Permutations/Rank of a permutation]]
| Task
|-
| 20
| [[Play%20recorded%20sounds|Play recorded sounds]]
| Task
|-
| 20
| [[RCRPG|RCRPG]]
| Task
|- style="background-color: #ffc"
| 20
| [[Ramsey%27s%20theorem|Ramsey's theorem]]
| Draft
|-
| 20
| [[Safe%20addition|Safe addition]]
| Task
|-
| 20
| [[Shoelace%20formula%20for%20polygonal%20area|Shoelace formula for polygonal area]]
| Task
|-
| 20
| [[Simulate%20input%2FKeyboard|Simulate input/Keyboard]]
| Task
|- style="background-color: #ffc"
| 20
| [[Substitution%20Cipher|Substitution Cipher]]
| Draft
|- style="background-color: #ffc"
| 20
| [[Welch%27s%20t-test|Welch's t-test]]
| Draft
|-
| 20
| [[Yahoo%21%20search%20interface|Yahoo! search interface]]
| Task
|-
| 19
| [[Cut%20a%20rectangle|Cut a rectangle]]
| Task
|- style="background-color: #ffc"
| 19
| [[Damm%20algorithm|Damm algorithm]]
| Draft
|- style="background-color: #ffc"
| 19
| [[Decision%20tables|Decision tables]]
| Draft
|- style="background-color: #ffc"
| 19
| [[Elliptic%20curve%20arithmetic|Elliptic curve arithmetic]]
| Draft
|-
| 19
| [[HTTPS%2FAuthenticated|HTTPS/Authenticated]]
| Task
|- style="background-color: #ffc"
| 19
| [[Idiomatically%20determine%20all%20the%20lowercase%20and%20uppercase%20letters|Idiomatically determine all the lowercase and uppercase letters]]
| Draft
|-
| 19
|data-sort-value="main step of gost 0F28147-0C89"| [[Main%20step%20of%20GOST%2028147-89|Main step of GOST 28147-89]]
| Task
|- style="background-color: #ffc"
| 19
| [[Old%20Russian%20measure%20of%20length|Old Russian measure of length]]
| Draft
|-
| 19
| [[Record%20sound|Record sound]]
| Task
|-
| 19
| [[Superellipse|Superellipse]]
| Task
|-
| 19
| [[Thiele%27s%20interpolation%20formula|Thiele's interpolation formula]]
| Task
|-
| 19
| [[Total%20circles%20area|Total circles area]]
| Task
|- style="background-color: #ffc"
| 19
| [[Type%20detection|Type detection]]
| Draft
|-
| 18
| [[AVL%20tree|AVL tree]]
| Task
|-
| 18
| [[Create%20an%20object%20at%20a%20given%20address|Create an object at a given address]]
| Task
|- style="background-color: #ffc"
| 18
| [[Dice%20game%20probabilities|Dice game probabilities]]
| Draft
|-
| 18
| [[Egyptian%20fractions|Egyptian fractions]]
| Task
|-
| 18
| [[Hough%20transform|Hough transform]]
| Task
|-
| 18
| [[K-means%2B%2B%20clustering|K-means++ clustering]]
| Task
|- style="background-color: #ffc"
| 18
| [[Make%20a%20backup%20file|Make a backup file]]
| Draft
|-
| 18
| [[Parse%20an%20IP%20Address|Parse an IP Address]]
| Task
|-
| 18
| [[Poker%20hand%20analyser|Poker hand analyser]]
| Task
|- style="background-color: #ffc"
| 18
| [[Reflection%2FList%20methods|Reflection/List methods]]
| Draft
|-
| 18
| [[SOAP|SOAP]]
| Task
|-
| 18
| [[Window%20management|Window management]]
| Task
|- style="background-color: #ffc"
| 17
| [[Display%20a%20linear%20combination|Display a linear combination]]
| Draft
|-
| 17
| [[Draw%20a%20rotating%20cube|Draw a rotating cube]]
| Task
|- style="background-color: #ffc"
| 17
| [[Integer%20roots|Integer roots]]
| Draft
|- style="background-color: #ffc"
| 17
| [[Modular%20arithmetic|Modular arithmetic]]
| Draft
|-
| 17
| [[Parallel%20Brute%20Force|Parallel Brute Force]]
| Task
|-
| 17
| [[Pig%20the%20dice%20game%2FPlayer|Pig the dice game/Player]]
| Task
|-
| 17
| [[Plasma%20effect|Plasma effect]]
| Task
|- style="background-color: #ffc"
| 17
| [[Playfair%20cipher|Playfair cipher]]
| Draft
|-
| 17
| [[Polyspiral|Polyspiral]]
| Task
|-
| 17
| [[Reflection%2FList%20properties|Reflection/List properties]]
| Task
|- style="background-color: #ffc"
| 17
| [[Sequence%20of%20primorial%20primes|Sequence of primorial primes]]
| Draft
|-
| 17
| [[Sokoban|Sokoban]]
| Task
|- style="background-color: #ffc"
| 16
| [[Elementary%20cellular%20automaton%2FRandom%20Number%20Generator|Elementary cellular automaton/Random Number Generator]]
| Draft
|- style="background-color: #ffc"
| 16
| [[Idiomatically%20determine%20all%20the%20characters%20that%20can%20be%20used%20for%20symbols|Idiomatically determine all the characters that can be used for symbols]]
| Draft
|- style="background-color: #ffc"
| 16
| [[Kahan%20summation|Kahan summation]]
| Draft
|-
| 16
| [[Kronecker%20product%20based%20fractals|Kronecker product based fractals]]
| Task
|- style="background-color: #ffc"
| 16
| [[Linux%20CPU%20utilization|Linux CPU utilization]]
| Draft
|-
| 16
| [[Median%20filter|Median filter]]
| Task
|- style="background-color: #ffc"
| 16
| [[Perlin%20noise|Perlin noise]]
| Draft
|-
| 16
| [[Pythagorean%20quadruples|Pythagorean quadruples]]
| Task
|-
| 16
| [[Simulate%20input%2FMouse|Simulate input/Mouse]]
| Task
|-
| 16
| [[Solve%20a%20Numbrix%20puzzle|Solve a Numbrix puzzle]]
| Task
|-
| 15
| [[Active%20Directory%2FSearch%20for%20a%20user|Active Directory/Search for a user]]
| Task
|- style="background-color: #ffc"
| 15
| [[Bacon%20cipher|Bacon cipher]]
| Draft
|- style="background-color: #ffc"
| 15
| [[Card%20shuffles|Card shuffles]]
| Draft
|-
| 15
| [[Compiler%2Flexical%20analyzer|Compiler/lexical analyzer]]
| Task
|- style="background-color: #ffc"
| 15
| [[Faulhaber%27s%20formula|Faulhaber's formula]]
| Draft
|- style="background-color: #ffc"
| 15
| [[Levenshtein%20distance%2FAlignment|Levenshtein distance/Alignment]]
| Draft
|-
| 15
| [[Machine%20code|Machine code]]
| Task
|-
| 15
| [[Solve%20a%20Hopido%20puzzle|Solve a Hopido puzzle]]
| Task
|- style="background-color: #ffc"
| 14
| [[Assertions%20in%20design%20by%20contract|Assertions in design by contract]]
| Draft
|- style="background-color: #ffc"
| 14
| [[AudioAlarm|AudioAlarm]]
| Draft
|- style="background-color: #ffc"
| 14
| [[Chebyshev%20coefficients|Chebyshev coefficients]]
| Draft
|- style="background-color: #ffc"
| 14
| [[Deming%27s%20Funnel|Deming's Funnel]]
| Draft
|- style="background-color: #ffc"
| 14
| [[Elementary%20cellular%20automaton%2FInfinite%20length|Elementary cellular automaton/Infinite length]]
| Draft
|- style="background-color: #ffc"
| 14
| [[Index%20finite%20lists%20of%20positive%20integers|Index finite lists of positive integers]]
| Draft
|-
| 14
| [[K-d%20tree|K-d tree]]
| Task
|-
| 14
| [[Magic%20squares%20of%20singly%20even%20order|Magic squares of singly even order]]
| Task
|- style="background-color: #ffc"
| 14
| [[Names%20to%20numbers|Names to numbers]]
| Draft
|- style="background-color: #ffc"
| 14
| [[Native%20shebang|Native shebang]]
| Draft
|-
| 14
| [[Negative%20base%20numbers|Negative base numbers]]
| Task
|- style="background-color: #ffc"
| 14
| [[Reverse%20the%20gender%20of%20a%20string|Reverse the gender of a string]]
| Draft
|- style="background-color: #ffc"
| 14
| [[Selective%20File%20Copy|Selective File Copy]]
| Draft
|- style="background-color: #ffc"
| 14
| [[Tonelli-Shanks%20algorithm|Tonelli-Shanks algorithm]]
| Draft
|-
| 14
| [[Vigen%C3%A8re%20cipher%2FCryptanalysis|Vigenère cipher/Cryptanalysis]]
| Task
|-
| 14
| [[World%20Cup%20group%20stage|World Cup group stage]]
| Task
|- style="background-color: #ffc"
| 13
| [[A%2A%20search%20algorithm|A* search algorithm]]
| Draft
|-
| 13
| [[Apply%20a%20digital%20filter%20%28direct%20form%20II%20transposed%29|Apply a digital filter (direct form II transposed)]]
| Task
|-
| 13
| [[Bitcoin%2Fpublic%20point%20to%20address|Bitcoin/public point to address]]
| Task
|- style="background-color: #ffc"
| 13
| [[Cipolla%27s%20algorithm|Cipolla's algorithm]]
| Draft
|-
| 13
| [[Color%20quantization|Color quantization]]
| Task
|- style="background-color: #ffc"
| 13
| [[Convex%20hull|Convex hull]]
| Draft
|- style="background-color: #ffc"
| 13
| [[Create%20an%20object%2FNative%20demonstration|Create an object/Native demonstration]]
| Draft
|- style="background-color: #ffc"
| 13
| [[Fivenum|Fivenum]]
| Draft
|-
| 13
| [[Nonoblock|Nonoblock]]
| Task
|-
| 13
| [[Percolation%2FSite%20percolation|Percolation/Site percolation]]
| Task
|-
| 13
| [[Rendezvous|Rendezvous]]
| Task
|-
| 13
| [[SQL-based%20authentication|SQL-based authentication]]
| Task
|-
| 13
| [[Sierpinski%20pentagon|Sierpinski pentagon]]
| Task
|- style="background-color: #ffc"
| 13
| [[Superpermutation%20minimisation|Superpermutation minimisation]]
| Draft
|-
| 13
| [[Video%20display%20modes|Video display modes]]
| Task
|-
| 12
| [[Bitmap%2FRead%20an%20image%20through%20a%20pipe|Bitmap/Read an image through a pipe]]
| Task
|- style="background-color: #ffc"
| 12
| [[Diversity%20prediction%20theorem|Diversity prediction theorem]]
| Draft
|- style="background-color: #ffc"
| 12
| [[I.Q.%20Puzzle|I.Q. Puzzle]]
| Draft
|-
| 12
| [[Joystick%20position|Joystick position]]
| Task
|-
| 12
| [[Lucky%20and%20even%20lucky%20numbers|Lucky and even lucky numbers]]
| Task
|- style="background-color: #ffc"
| 12
| [[Most%20frequent%20k%20chars%20distance|Most frequent k chars distance]]
| Draft
|-
| 12
| [[Percolation%2FBond%20percolation|Percolation/Bond percolation]]
| Task
|-
| 12
| [[Percolation%2FMean%20cluster%20density|Percolation/Mean cluster density]]
| Task
|-
| 12
| [[Reflection%2FGet%20source|Reflection/Get source]]
| Task
|-
| 12
| [[Retrieve%20and%20search%20chat%20history|Retrieve and search chat history]]
| Task
|- style="background-color: #ffc"
| 12
| [[Untrusted%20environment|Untrusted environment]]
| Draft
|- style="background-color: #ffc"
| 12
| [[Word%20break%20problem|Word break problem]]
| Draft
|- style="background-color: #ffc"
| 11
| [[Arithmetic%20coding%2FAs%20a%20generalized%20change%20of%20radix|Arithmetic coding/As a generalized change of radix]]
| Draft
|- style="background-color: #ffc"
| 11
| [[Bilinear%20interpolation|Bilinear interpolation]]
| Draft
|-
| 11
| [[Compare%20sorting%20algorithms%27%20performance|Compare sorting algorithms' performance]]
| Task
|- style="background-color: #ffc"
| 11
| [[Faulhaber%27s%20triangle|Faulhaber's triangle]]
| Draft
|- style="background-color: #ffc"
| 11
| [[Find%20URI%20in%20text|Find URI in text]]
| Draft
|-
| 11
| [[Find%20the%20intersection%20of%20a%20line%20with%20a%20plane|Find the intersection of a line with a plane]]
| Task
|- style="background-color: #ffc"
| 11
| [[Knuth%27s%20power%20tree|Knuth's power tree]]
| Draft
|- style="background-color: #ffc"
| 11
| [[List%20rooted%20trees|List rooted trees]]
| Draft
|- style="background-color: #ffc"
| 11
| [[Monads%2FMaybe%20monad|Monads/Maybe monad]]
| Draft
|- style="background-color: #ffc"
| 11
| [[N-body%20problem|N-body problem]]
| Draft
|- style="background-color: #ffc"
| 11
| [[NYSIIS|NYSIIS]]
| Draft
|- style="background-color: #ffc"
| 11
| [[Polynomial%20synthetic%20division|Polynomial synthetic division]]
| Draft
|- style="background-color: #ffc"
| 11
| [[Proof|Proof]]
| Draft
|-
| 11
| [[Ramer-Douglas-Peucker%20line%20simplification|Ramer-Douglas-Peucker line simplification]]
| Task
|- style="background-color: #ffc"
| 11
| [[Separate%20the%20house%20number%20from%20the%20street%20name|Separate the house number from the street name]]
| Draft
|- style="background-color: #ffc"
| 11
| [[Shortest%20common%20supersequence|Shortest common supersequence]]
| Draft
|-
| 11
| [[Terminal%20control%2FPositional%20read|Terminal control/Positional read]]
| Task
|-
| 11
| [[Vogel%27s%20approximation%20method|Vogel's approximation method]]
| Task
|- style="background-color: #ffc"
| 10
| [[Aspect%20Oriented%20Programming|Aspect Oriented Programming]]
| Draft
|-
| 10
| [[Commatizing%20numbers|Commatizing numbers]]
| Task
|-
| 10
| [[Compiler%2Fcode%20generator|Compiler/code generator]]
| Task
|-
| 10
| [[Compiler%2Fvirtual%20machine%20interpreter|Compiler/virtual machine interpreter]]
| Task
|- style="background-color: #ffc"
| 10
| [[Determine%20if%20two%20triangles%20overlap|Determine if two triangles overlap]]
| Draft
|- style="background-color: #ffc"
| 10
| [[Find%20duplicate%20files|Find duplicate files]]
| Draft
|- style="background-color: #ffc"
| 10
| [[Generate%20random%20chess%20position|Generate random chess position]]
| Draft
|-
| 10
| [[HTTPS%2FClient-authenticated|HTTPS/Client-authenticated]]
| Task
|- style="background-color: #ffc"
| 10
| [[Markov%20chain%20text%20generator|Markov chain text generator]]
| Draft
|- style="background-color: #ffc"
| 10
| [[Mersenne%20primes|Mersenne primes]]
| Draft
|- style="background-color: #ffc"
| 10
| [[Monads%2FList%20monad|Monads/List monad]]
| Draft
|-
| 10
| [[Nonogram%20solver|Nonogram solver]]
| Task
|- style="background-color: #ffc"
| 10
| [[P-value%20correction|P-value correction]]
| Draft
|-
| 10
| [[Primes%20-%20allocate%20descendants%20to%20their%20ancestors|Primes - allocate descendants to their ancestors]]
| Task
|- style="background-color: #ffc"
| 10
| [[Readline%20interface|Readline interface]]
| Draft
|- style="background-color: #ffc"
| 10
| [[Topological%20sort%2FExtracted%20top%20item|Topological sort/Extracted top item]]
| Draft
|-
| 10
| [[Zeckendorf%20arithmetic|Zeckendorf arithmetic]]
| Task
|- style="background-color: #ffc"
| 9
| [[Abbreviations%2C%20automatic|Abbreviations, automatic]]
| Draft
|- style="background-color: #ffc"
| 9
|data-sort-value="base0C58check encoding"| [[Base58Check%20encoding|Base58Check encoding]]
| Draft
|-
| 9
| [[Bitmap%2FPPM%20conversion%20through%20a%20pipe|Bitmap/PPM conversion through a pipe]]
| Task
|- style="background-color: #ffc"
| 9
| [[Code%20segment%20unload|Code segment unload]]
| Draft
|- style="background-color: #ffc"
| 9
| [[Color%20wheel|Color wheel]]
| Draft
|- style="background-color: #ffc"
| 9
| [[Continued%20fraction%2FArithmetic%2FG%28matrix%20NG%2C%20Contined%20Fraction%20N%29|Continued fraction/Arithmetic/G(matrix NG, Contined Fraction N)]]
| Draft
|-
| 9
| [[Eertree|Eertree]]
| Task
|- style="background-color: #ffc"
| 9
| [[File%20size%20distribution|File size distribution]]
| Draft
|- style="background-color: #ffc"
| 9
| [[Four%20is%20magic|Four is magic]]
| Draft
|- style="background-color: #ffc"
| 9
| [[Free%20polyominoes%20enumeration|Free polyominoes enumeration]]
| Draft
|- style="background-color: #ffc"
| 9
| [[Snake|Snake]]
| Draft
|- style="background-color: #ffc"
| 9
| [[Suffix%20tree|Suffix tree]]
| Draft
|- style="background-color: #ffc"
| 9
| [[Transportation%20problem|Transportation problem]]
| Draft
|- style="background-color: #ffc"
| 9
| [[VList|VList]]
| Draft
|-
| 9
| [[Word%20search|Word search]]
| Task
|- style="background-color: #ffc"
| 9
| [[XML%20Validation|XML Validation]]
| Draft
|-
| 8
| [[Compiler%2FAST%20interpreter|Compiler/AST interpreter]]
| Task
|-
| 8
| [[Compiler%2Fsyntax%20analyzer|Compiler/syntax analyzer]]
| Task
|-
| 8
| [[Hunt%20The%20Wumpus|Hunt The Wumpus]]
| Task
|- style="background-color: #ffc"
| 8
| [[Kosaraju|Kosaraju]]
| Draft
|- style="background-color: #ffc"
| 8
| [[Largest%20number%20divisible%20by%20its%20digits|Largest number divisible by its digits]]
| Draft
|- style="background-color: #ffc"
| 8
| [[Loops%2FIncrement%20loop%20index%20within%20loop%20body|Loops/Increment loop index within loop body]]
| Draft
|- style="background-color: #ffc"
| 8
| [[Montgomery%20reduction|Montgomery reduction]]
| Draft
|- style="background-color: #ffc"
| 8
| [[Perceptron|Perceptron]]
| Draft
|- style="background-color: #ffc"
| 8
| [[Self-hosting%20compiler|Self-hosting compiler]]
| Draft
|- style="background-color: #ffc"
| 7
| [[Abbreviations%2C%20easy|Abbreviations, easy]]
| Draft
|-
| 7
| [[Canny%20edge%20detector|Canny edge detector]]
| Task
|-
| 7
|data-sort-value="deconvolution/0B2d+"| [[Deconvolution%2F2D%2B|Deconvolution/2D+]]
| Task
|- style="background-color: #ffc"
| 7
| [[Finite%20state%20machine|Finite state machine]]
| Draft
|- style="background-color: #ffc"
| 7
| [[Generalised%20floating%20point%20addition|Generalised floating point addition]]
| Draft
|- style="background-color: #ffc"
| 7
| [[IPC%20via%20named%20pipe|IPC via named pipe]]
| Draft
|- style="background-color: #ffc"
| 7
| [[Mastermind|Mastermind]]
| Draft
|- style="background-color: #ffc"
| 7
| [[Monads%2FWriter%20monad|Monads/Writer monad]]
| Draft
|- style="background-color: #ffc"
| 7
| [[Orbital%20elements|Orbital elements]]
| Draft
|- style="background-color: #ffc"
| 7
| [[Particle%20Swarm%20Optimization|Particle Swarm Optimization]]
| Draft
|- style="background-color: #ffc"
| 7
| [[Run%20as%20a%20daemon%20or%20service|Run as a daemon or service]]
| Draft
|- style="background-color: #ffc"
| 7
| [[Singly-linked%20list%2FElement%20removal|Singly-linked list/Element removal]]
| Draft
|-
| 7
| [[The%20Name%20Game|The Name Game]]
| Task
|- style="background-color: #ffc"
| 7
| [[Time-based%20One-time%20Password%20Algorithm|Time-based One-time Password Algorithm]]
| Draft
|- style="background-color: #ffc"
| 7
| [[User%20defined%20pipe%20and%20redirection%20operators|User defined pipe and redirection operators]]
| Draft
|- style="background-color: #ffc"
| 6
| [[Addition%20chains|Addition chains]]
| Draft
|- style="background-color: #ffc"
| 6
| [[Banker%27s%20algorithm|Banker's algorithm]]
| Draft
|-
| 6
| [[Catmull%E2%80%93Clark%20subdivision%20surface|Catmull–Clark subdivision surface]]
| Task
|- style="background-color: #ffc"
| 6
| [[French%20Republican%20calendar|French Republican calendar]]
| Draft
|- style="background-color: #ffc"
| 6
| [[Just%20in%20time%20processing%20on%20a%20character%20stream|Just in time processing on a character stream]]
| Draft
|- style="background-color: #ffc"
| 6
| [[Morpion%20solitaire|Morpion solitaire]]
| Draft
|- style="background-color: #ffc"
| 6
| [[Parse%20EBNF|Parse EBNF]]
| Draft
|- style="background-color: #ffc"
| 5
| [[ASCII%20art%20diagram%20converter|ASCII art diagram converter]]
| Draft
|- style="background-color: #ffc"
| 5
| [[Abbreviations%2C%20simple|Abbreviations, simple]]
| Draft
|- style="background-color: #ffc"
| 5
| [[Audio%20frequency%20generator|Audio frequency generator]]
| Draft
|- style="background-color: #ffc"
| 5
| [[Combinations%20with%20repetitions%2FSquare%20Digit%20Chain|Combinations with repetitions/Square Digit Chain]]
| Draft
|- style="background-color: #ffc"
| 5
| [[Imaginary%20base%20numbers|Imaginary base numbers]]
| Draft
|- style="background-color: #ffc"
| 5
| [[OpenGL%20Pixel%20Shader|OpenGL Pixel Shader]]
| Draft
|-
| 5
| [[Pinstripe%2FPrinter|Pinstripe/Printer]]
| Task
|- style="background-color: #ffc"
| 5
| [[Sorting%20algorithms%2FTree%20sort%20on%20a%20linked%20list|Sorting algorithms/Tree sort on a linked list]]
| Draft
|- style="background-color: #ffc"
| 5
| [[Spelling%20of%20ordinal%20numbers|Spelling of ordinal numbers]]
| Draft
|- style="background-color: #ffc"
| 5
| [[Starting%20a%20web%20browser|Starting a web browser]]
| Draft
|-
| 4
|data-sort-value="0C15 puzzle solver"| [[15%20puzzle%20solver|15 puzzle solver]]
| Task
|- style="background-color: #ffc"
| 4
| [[Addition-chain%20exponentiation|Addition-chain exponentiation]]
| Draft
|-
| 4
| [[Colour%20pinstripe%2FPrinter|Colour pinstripe/Printer]]
| Task
|- style="background-color: #ffc"
| 4
|data-sort-value="continued fraction/arithmetic/g(matrix ng, contined fraction n0B1, contined fraction n0B2)"| [[Continued%20fraction%2FArithmetic%2FG%28matrix%20NG%2C%20Contined%20Fraction%20N1%2C%20Contined%20Fraction%20N2%29|Continued fraction/Arithmetic/G(matrix NG, Contined Fraction N1, Contined Fraction N2)]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Data%20Encryption%20Standard|Data Encryption Standard]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Fibonacci%20heap|Fibonacci heap]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Four%20is%20the%20number%20of%20letters%20in%20the%20...|Four is the number of letters in the ...]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Functional%20coverage%20tree|Functional coverage tree]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Gauss-Jordan%20matrix%20inversion|Gauss-Jordan matrix inversion]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Geometric%20algebra|Geometric algebra]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Greed|Greed]]
| Draft
|- style="background-color: #ffc"
| 4
| [[One-time%20pad|One-time pad]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Pentomino%20tiling|Pentomino tiling]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Railway%20circuit|Railway circuit]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Remote%20agent%2FAgent%20interface|Remote agent/Agent interface]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Remote%20agent%2FAgent%20logic|Remote agent/Agent logic]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Remote%20agent%2FSimulation|Remote agent/Simulation]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Rosetta%20Code%2FRun%20examples|Rosetta Code/Run examples]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Snake%20And%20Ladder|Snake And Ladder]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Tarjan|Tarjan]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Tetris|Tetris]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Using%20a%20Speech%20engine%20to%20highlight%20words|Using a Speech engine to highlight words]]
| Draft
|- style="background-color: #ffc"
| 4
| [[Using%20the%20Meetup.com%20API|Using the Meetup.com API]]
| Draft
|- style="background-color: #ffc"
| 3
| [[Boids|Boids]]
| Draft
|- style="background-color: #ffc"
| 3
| [[Hexapawn|Hexapawn]]
| Draft
|- style="background-color: #ffc"
| 3
| [[OpenGL%2FUtah%20Teapot|OpenGL/Utah Teapot]]
| Draft
|- style="background-color: #ffc"
| 3
| [[Robots|Robots]]
| Draft
|- style="background-color: #ffc"
| 3
| [[Rosetta%20Code%2FRank%20languages%20by%20number%20of%20users|Rosetta Code/Rank languages by number of users]]
| Draft
|- style="background-color: #ffc"
| 3
| [[Rosetta%20Code%2FTasks%20without%20examples|Rosetta Code/Tasks without examples]]
| Draft
|- style="background-color: #ffc"
| 3
| [[Simulated%20annealing|Simulated annealing]]
| Draft
|- style="background-color: #ffc"
| 3
| [[Text%20to%20HTML|Text to HTML]]
| Draft
|- style="background-color: #ffc"
| 2
| [[Audio%20Overlap%20Loop|Audio Overlap Loop]]
| Draft
|- style="background-color: #ffc"
| 2
| [[Chess%20player|Chess player]]
| Draft
|- style="background-color: #ffc"
| 2
| [[External%20sort|External sort]]
| Draft
|-
| 2
| [[OLE%20Automation|OLE Automation]]
| Task
|- style="background-color: #ffc"
| 2
| [[OpenWebNet%20Password|OpenWebNet Password]]
| Draft
|- style="background-color: #ffc"
| 2
| [[Penrose%20tiling|Penrose tiling]]
| Draft
|- style="background-color: #ffc"
| 2
| [[Recursive%20descent%20parser%20generator|Recursive descent parser generator]]
| Draft
|- style="background-color: #ffc"
| 2
| [[Solve%20a%20Rubik%27s%20Cube|Solve a Rubik's Cube]]
| Draft
|- style="background-color: #ffc"
| 2
| [[Tamagotchi%20emulator|Tamagotchi emulator]]
| Draft
|- style="background-color: #ffc"
| 1
| [[Black%20Box|Black Box]]
| Draft
|- style="background-color: #ffc"
| 1
| [[Generalised%20floating%20point%20multiplication|Generalised floating point multiplication]]
| Draft
|- style="background-color: #ffc"
| 1
| [[IRC%20gateway|IRC gateway]]
| Draft
|- style="background-color: #ffc"
| 1
| [[Multidimensional%20Newton-Raphson%20metod|Multidimensional Newton-Raphson metod]]
| Draft
|- style="background-color: #ffc"
| 1
| [[Process%20SMIL%20directives%20in%20XML%20data|Process SMIL directives in XML data]]
| Draft
|- style="background-color: #ffc"
| 1
| [[Rosetta%20Code%2FList%20authors%20of%20task%20descriptions|Rosetta Code/List authors of task descriptions]]
| Draft
|- style="background-color: #ffc"
| 1
| [[Solving%20coin%20problems|Solving coin problems]]
| Draft
|- style="background-color: #ffc"
| 1
| [[Terminal%20control%2FRestricted%20width%20positional%20input%2FNo%20wrapping|Terminal control/Restricted width positional input/No wrapping]]
| Draft
|- style="background-color: #ffc"
| 1
| [[Terminal%20control%2FRestricted%20width%20positional%20input%2FWith%20wrapping|Terminal control/Restricted width positional input/With wrapping]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Blackjack%20strategy|Blackjack strategy]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Chess%20player%2FMove%20generation|Chess player/Move generation]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Chess%20player%2FProgram%20options%20and%20user%20interface|Chess player/Program options and user interface]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Chess%20player%2FSearch%20and%20evaluation|Chess player/Search and evaluation]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Rosetta%20Code%2FTasks%20sorted%20by%20average%20lines%20of%20code|Rosetta Code/Tasks sorted by average lines of code]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Ukkonen%E2%80%99s%20Suffix%20Tree%20Construction|Ukkonen’s Suffix Tree Construction]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Unicode%20polynomial%20equation|Unicode polynomial equation]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Waveform%20analysis%2FDoh%20ray%20me|Waveform analysis/Doh ray me]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Waveform%20analysis%2FTop%20and%20tail|Waveform analysis/Top and tail]]
| Draft
|- style="background-color: #ffc"
| 0
| [[Weather%20Routing|Weather Routing]]
| Draft
|}
</div>
 
=={{header|PicoLisp}}==
<langsyntaxhighlight PicoLisplang="picolisp">(load "@lib/http.l")
 
(client "rosettacode.org" 80
Line 6,105 ⟶ 2,153:
(unless (sub? "." (till "<" T))
(inc 'Cnt) ) )
(out NIL (prinl (ht:Pack Task) ": " Cnt)) ) ) ) ) )</langsyntaxhighlight>
Output (05may10):
<pre>100 doors: 79
Line 6,114 ⟶ 2,162:
Abstract type: 29
...</pre>
 
 
=={{header|PureBasic}}==
<langsyntaxhighlight PureBasiclang="purebasic">Procedure handleError(value, msg.s)
If value = 0
MessageRequester("Error", msg)
Line 6,180 ⟶ 2,227:
Input()
CloseConsole()
EndIf</langsyntaxhighlight>
Sample output:
<pre>100 doors: 224 examples
Line 6,198 ⟶ 2,245:
=={{header|Python}}==
 
<langsyntaxhighlight lang="python">importfrom urllib.request import urlopen, xml.dom.minidomRequest
import xml.dom.minidom
 
r = Request(
x = urllib.urlopen("http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml")
'https://www.rosettacode.org/mw/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml',
headers={'User-Agent': 'Mozilla/5.0'})
x = urlopen(r)
 
tasks = []
for i in xml.dom.minidom.parseString(x.read()).getElementsByTagName("'cm"'):
t = i.getAttribute('title').replace("' "', "'_"')
yr = urllib.urlopenRequest("httpf'https://www.rosettacode.org/wmw/index.php?title=%s{t}&action=raw" % t.encode('utf-8')),
headers={'User-Agent': 'Mozilla/5.0'})
tasks.append( y.read().lower().count("{{header|") )
y = urlopen(r)
print t.replace("_", " ") + ": %d examples." % tasks[-1]
tasks.append( y.read().lower().count(b'{{header|') )
print(t.replace('_', ' ') + f': {tasks[-1]} examples.')
 
print "(f'\nTotal: %d{sum(tasks)} examples." % sum(tasks')</lang>
</syntaxhighlight>
 
===Using Semantic MediaWiki===
{{libheader|Requests}}
Here we use the [https://www.semantic-mediawiki.org/wiki/Help:API:ask ask] API provided by the [https://www.semantic-mediawiki.org/wiki/Semantic_MediaWiki Semantic MediaWiki extension] to query page [https://www.semantic-mediawiki.org/wiki/Help:Properties_and_types properties] rather than parse page content, producing subtly different counts to some other solutions. Maybe too different for this task.
 
We only count task examples that have a corresponding category page AND that page has the "Is Language" property set to True. In other words, <code>Implemented In</code> + <code>Not Implemented In</code> + <code>Omitted From</code> is always equal to the total number of languages.
 
<syntaxhighlight lang="python">"""Count Rosetta Code tasks implementations using the Semantic MediaWiki API.
Works with Python >= 3.7."""
import json
import logging
 
from dataclasses import dataclass
from dataclasses import field
 
from datetime import datetime
 
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Set
from typing import Tuple
 
import requests
from requests.adapters import HTTPAdapter
from requests.adapters import Retry
 
logging.basicConfig(level=logging.WARN)
 
# See https://www.semantic-mediawiki.org/wiki/Help:API:ask
_SM_ASK: Dict[str, str] = {
"action": "ask",
"format": "json",
"formatversion": "2",
"api_version": "3",
}
 
_SM_ASK_REQUEST_BLOCK_SIZE = 500
 
 
@dataclass(frozen=True)
class Page:
# fulltext is the page's title, not the page content.
fulltext: str
fullurl: str
namespace: int
exists: str
displaytitle: str
 
 
@dataclass(frozen=True, eq=False)
class Lang(Page):
def __eq__(self, other: object) -> bool:
if isinstance(other, Lang):
return self.fullurl == other.fullurl
elif isinstance(other, str):
return self.fullurl == other
return False
 
def __hash__(self) -> int:
return hash(self.fullurl)
 
def unimplemented(self, tasks: Set["Task"]) -> Set["Task"]:
return {task for task in tasks if self.fullurl not in task.exclude}
 
def omitted_from(self, tasks: Set["Task"]) -> Set["Task"]:
return {task for task in tasks if self.fullurl in task.omitted_from}
 
 
@dataclass(frozen=True)
class Task(Page):
title: str
implemented_in: Set[Lang] = field(repr=False, compare=False)
omitted_from: Set[Lang] = field(repr=False, compare=False)
exclude: Set[Lang] = field(repr=False, compare=False)
 
def not_implemented_in(self, langs: Set[Lang]) -> Set[Lang]:
return langs.difference(self.exclude)
 
 
@dataclass
class TaskResponseBlock:
tasks: List[Task]
continue_offset: Optional[int] = None
 
 
@dataclass
class LanguageResponseBlock:
langs: List[Lang]
continue_offset: Optional[int] = None
 
 
def sm_ask_category(
session: requests.Session,
url: str,
category: str,
limit: int,
offset: int,
known_langs: Set[Lang],
) -> TaskResponseBlock:
query_params = {
**_SM_ASK,
"query": (
f"[[Category:{category}]]"
"|?Implemented in language"
"|?Omitted from language"
f"|limit={limit}"
f"|offset={offset}"
),
}
 
# Display some progress
log(f"ask [[Category:{category}]] offset={offset}")
 
response = session.get(url, params=query_params)
response.raise_for_status()
data = response.json()
handle_warnings_and_errors(data)
return _transform_implemented_in_response_data(data, known_langs)
 
 
def sm_ask_tasks(
session: requests.Session,
url: str,
limit: int,
offset: int,
known_langs: Set[Lang],
):
return sm_ask_category(
session, url, "Programming Tasks", limit, offset, known_langs
)
 
 
def sm_ask_drafts(
session: requests.Session,
url: str,
limit: int,
offset: int,
known_langs: Set[Lang],
):
return sm_ask_category(
session, url, "Draft Programming Tasks", limit, offset, known_langs
)
 
 
def sm_ask_languages(
session: requests.Session,
url: str,
limit: int,
offset: int,
) -> LanguageResponseBlock:
query_params = {
**_SM_ASK,
"query": (
"[[Is language::+]]"
"|?Implemented in language"
"|?Omitted from language"
f"|limit={limit}"
f"|offset={offset}"
),
}
 
# Display some progress
log(f"ask [[Is language::+]] offset={offset}")
 
response = session.get(url, params=query_params)
response.raise_for_status()
data = response.json()
handle_warnings_and_errors(data)
return _transform_language_response_data(data)
 
 
def sm_ask_all_tasks(
session: requests.Session, url: str, known_langs: Set[Lang]
) -> List[Task]:
block = sm_ask_tasks(
session,
url,
limit=_SM_ASK_REQUEST_BLOCK_SIZE,
offset=0,
known_langs=known_langs,
)
tasks = block.tasks
 
while block.continue_offset:
block = sm_ask_tasks(
session,
url,
limit=_SM_ASK_REQUEST_BLOCK_SIZE,
offset=block.continue_offset,
known_langs=known_langs,
)
tasks.extend(block.tasks)
 
return tasks
 
 
def sm_ask_all_drafts(
session: requests.Session, url: str, known_langs: Set[Lang]
) -> List[Task]:
block = sm_ask_drafts(
session,
url,
limit=_SM_ASK_REQUEST_BLOCK_SIZE,
offset=0,
known_langs=known_langs,
)
tasks = block.tasks
 
while block.continue_offset:
block = sm_ask_drafts(
session,
url,
limit=_SM_ASK_REQUEST_BLOCK_SIZE,
offset=block.continue_offset,
known_langs=known_langs,
)
tasks.extend(block.tasks)
 
return tasks
 
 
def sm_ask_all_languages(session: requests.Session, url: str) -> List[Lang]:
block = sm_ask_languages(
session,
url,
limit=_SM_ASK_REQUEST_BLOCK_SIZE,
offset=0,
)
langs = block.langs
 
while block.continue_offset:
block = sm_ask_languages(
session,
url,
limit=_SM_ASK_REQUEST_BLOCK_SIZE,
offset=block.continue_offset,
)
langs.extend(block.langs)
 
return langs
 
 
def _transform_implemented_in_response_data(
data: Any, known_langs: Set[Lang]
) -> TaskResponseBlock:
tasks: List[Task] = []
for result in data["query"]["results"]:
for task_title, task_page in result.items():
# We're excluding implementations that don't have a corresponding
# category page with an "Is Language" property.
implemented_in = {
Lang(**lang)
for lang in task_page["printouts"]["Implemented in language"]
}.intersection(known_langs)
 
omitted_from = (
{
Lang(**lang)
for lang in task_page["printouts"]["Omitted from language"]
}
.intersection(known_langs)
.difference(implemented_in)
)
 
tasks.append(
Task(
title=task_title,
implemented_in=implemented_in,
omitted_from=omitted_from,
fulltext=task_page["fulltext"],
fullurl=task_page["fullurl"],
namespace=task_page["namespace"],
exists=task_page["exists"],
displaytitle=task_page["displaytitle"],
exclude=implemented_in.union(omitted_from),
)
)
 
return TaskResponseBlock(
tasks=tasks, continue_offset=data.get("query-continue-offset", None)
)
 
 
def _transform_language_response_data(data: Any) -> LanguageResponseBlock:
langs: List[Lang] = []
for result in data["query"]["results"]:
for _, task_page in result.items():
langs.append(
Lang(
fulltext=task_page["fulltext"],
fullurl=task_page["fullurl"],
namespace=task_page["namespace"],
exists=task_page["exists"],
displaytitle=task_page["displaytitle"],
)
)
 
return LanguageResponseBlock(
langs=langs, continue_offset=data.get("query-continue-offset", None)
)
 
 
def get_session() -> requests.Session:
"""Setup a requests.Session with retries."""
retry_strategy = Retry(
total=5,
status_forcelist=[429, 500, 502, 503, 504],
allowed_methods=["HEAD", "GET", "OPTIONS"],
)
adapter = HTTPAdapter(max_retries=retry_strategy)
session = requests.Session()
session.mount("https://", adapter)
session.mount("http://", adapter)
return session
 
 
def log(msg: str) -> None:
print(f"{datetime.now().isoformat(' ', 'seconds')}: {msg}")
 
 
def handle_warnings_and_errors(data: Any) -> None:
if data.get("errors"):
for error in data["errors"]:
logging.error(json.dumps(error))
# legacy format
if data.get("error"):
logging.error(json.dumps(data["error"]))
if data.get("warnings"):
for warning in data["warnings"]:
logging.warning(json.dumps(warning))
 
 
def count_examples(url: str, n: int = 30) -> None:
"""Print a table to stdout containing implementation counts for the first
`n` tasks, sorted by number implementations (most to least)."""
session = get_session()
langs = set(sm_ask_all_languages(session, url))
tasks = sm_ask_all_tasks(session, url, langs)
drafts = sm_ask_all_drafts(session, url, langs)
all_tasks = [*tasks, *drafts]
 
# Map of task to (implemented in, not implemented in, omitted from)
counts: Dict[Task, Tuple[int, int, int]] = {}
 
# Running total of examples for all tasks. Where a language has multiple examples
# for a single tasks, we only count one example.
total: int = 0
 
for task in all_tasks:
total += len(task.implemented_in)
counts[task] = (
len(task.implemented_in),
len(task.not_implemented_in(langs)),
len(task.omitted_from),
)
 
# Pretty print
top = sorted(counts.items(), key=lambda it: it[1][0], reverse=True)[:n]
pad = max([len(task.fulltext) for task, _ in top])
 
print("\nKnown languages:", len(langs))
print("Total tasks:", len(all_tasks))
print("Total examples:", total)
print(f"{'Task':>{pad}} | Implemented In | Not Implemented In | Omitted From")
print("-" * (pad + 1), "+", "-" * 16, "+", "-" * 20, "+", "-" * 13, sep="")
 
for task, _counts in top:
implemented_in, not_implemented_in, omitted_from = _counts
print(
f"{task.fulltext:>{pad}} |"
f"{implemented_in:>15} |"
f"{not_implemented_in:>19} |"
f"{omitted_from:>13}"
)
 
 
if __name__ == "__main__":
import argparse
 
URL = "https://rosettacode.org/w/api.php"
parser = argparse.ArgumentParser(description="Count tasks on Rosetta Code.")
 
parser.add_argument(
"--rows",
"-n",
type=int,
default=30,
dest="n",
help="number of rows to display in the output table (default: 30)",
)
 
parser.add_argument(
"--url",
default=URL,
help=f"target MediaWiki URL (default: {URL})",
)
 
args = parser.parse_args()
count_examples(args.url, args.n)</syntaxhighlight>
 
{{out}}
<pre>
2023-02-11 11:09:34: ask [[Is language::+]] offset=0
2023-02-11 11:09:35: ask [[Is language::+]] offset=500
2023-02-11 11:09:36: ask [[Category:Programming Tasks]] offset=0
2023-02-11 11:09:47: ask [[Category:Programming Tasks]] offset=500
2023-02-11 11:10:04: ask [[Category:Programming Tasks]] offset=1000
2023-02-11 11:10:12: ask [[Category:Draft Programming Tasks]] offset=0
 
Known languages: 890
Total tasks: 1602
Total examples: 91075
Task | Implemented In | Not Implemented In | Omitted From
--------------------------------+----------------+--------------------+-------------
Hello world/Text | 498 | 392 | 0
99 bottles of beer | 371 | 519 | 0
100 doors | 334 | 555 | 1
FizzBuzz | 325 | 565 | 0
Fibonacci sequence | 308 | 582 | 0
Factorial | 302 | 588 | 0
Comments | 297 | 592 | 1
A+B | 293 | 597 | 0
Empty program | 274 | 616 | 0
Function definition | 254 | 634 | 2
Loops/Infinite | 254 | 635 | 1
Loops/For | 248 | 641 | 1
Loops/While | 244 | 645 | 1
Arrays | 237 | 652 | 1
Ackermann function | 234 | 653 | 3
Reverse a string | 231 | 657 | 2
Conditional structures | 223 | 666 | 1
Arithmetic/Integer | 213 | 677 | 0
Greatest common divisor | 213 | 677 | 0
Array concatenation | 208 | 682 | 0
Greatest element of a list | 208 | 682 | 0
Even or odd | 207 | 683 | 0
Loops/Downward for | 207 | 683 | 0
Sieve of Eratosthenes | 203 | 687 | 0
Increment a numerical string | 202 | 688 | 0
Integer comparison | 202 | 688 | 0
Repeat a string | 199 | 691 | 0
Boolean values | 198 | 691 | 1
Loops/For with a specified step | 198 | 691 | 1
Copy a string | 196 | 693 | 1
</pre>
 
=={{header|R}}==
Line 6,215 ⟶ 2,716:
 
{{libheader|RCurl}}
<syntaxhighlight lang="r">
<lang R>
library(XML)
library(RCurl)
Line 6,230 ⟶ 2,731:
}
cat("Total: ", length(unlist(counts)), "examples\n")
</syntaxhighlight>
</lang>
 
=={{header|Racket}}==
 
<langsyntaxhighlight lang="racket">
#lang racket
 
Line 6,260 ⟶ 2,761:
(printf "~a: ~a\n" task s)
s))
</syntaxhighlight>
</lang>
 
=={{header|Raku}}==
(formerly Perl 6)
{{works with|Rakudo|2018.12}}
Retrieves counts for both Tasks and Draft Tasks. Save / Display results as a sortable wikitable rather than a static list. Click on a column header to sort on that column. To do a secondary sort, hold down the shift key and click on a second column header. Tasks have a gray (default) background, Draft Tasks have a yellow background.
 
This example tracks the top 50 languages by number of examples completed but only generates reports in tiers of 10. More than 10 gets too heavy and difficult to navigate.
 
Feed it parameters to control behaviour:
* :nf or :no-fetch to use saved information to generate the different reports. Recommended for the second, third, fourth, whatever report you are generating at any one time as fetching from the site is ''by far'' the most time consuming part.
* :t=1 (or :tier=1). :t=2, :t=3, whatever, up to :t=5 to control which tier of results to generate.
 
Language names with spaces will have underscores inserted to make the results uniform. Some oddball languages (lookin' at you Icon and Unicon) make it very difficult to obtain accurate results. The whole "conglomerate all of the Basic dialects together" movement of a few years ago also complicates things, but this should be pretty close.
 
For a full output, see [[Rosetta_Code/Count_examples/Full_list|Top tier]], [[Rosetta_Code/Count_examples/Full_list/Tier_2|Second tier]], [[Rosetta_Code/Count_examples/Full_list/Tier_3|Third tier]], [[Rosetta_Code/Count_examples/Full_list/Tier_4|Fourth tier]]
<syntaxhighlight lang="raku" line>use HTTP::UserAgent;
use URI::Escape;
use JSON::Fast;
use Lingua::EN::Numbers :short;
 
unit sub MAIN ( Bool :nf(:$no-fetch) = False, :t(:$tier) = 1 );
 
# Friendlier descriptions for task categories
my %cat = (
'Programming_Tasks' => 'Task',
'Draft_Programming_Tasks' => 'Draft'
);
 
my $client = HTTP::UserAgent.new;
$client.timeout = 10;
 
my $url = 'https://rosettacode.org/w';
 
my $hashfile = './RC_Task_count.json';
my $tablefile = "./RC_Task_count-{$tier}.txt";
 
my %tasks;
 
my @places = <① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳ ㉑ ㉒ ㉓ ㉔ ㉕
㉖ ㉗ ㉘ ㉙ ㉚ ㉛ ㉜ ㉝ ㉞ ㉟ ㊱ ㊲ ㊳ ㊴ ㊵ ㊶ ㊷ ㊸ ㊹ ㊺ ㊺ ㊻ ㊼ ㊽ ㊾ ㊿>;
 
# clear screen
run($*DISTRO.is-win ?? 'cls' !! 'clear') unless $no-fetch;
 
my %counts =
mediawiki-query(
$url, 'pages',
:generator<categorymembers>,
:gcmtitle<Category:Programming Languages>,
:gcmlimit<350>,
:rawcontinue(),
:prop<categoryinfo>
)
.map({ .<title>.subst(/^'Category:'/, '') => .<categoryinfo><pages> || 0 });
 
my $per-tier = 10;
 
my $which = (^$per-tier) »+» $per-tier * ($tier - 1);
 
my @top-n = %counts.sort( {-.value, .key} )[|$which].map: *.key.trans(' ' => '_');
 
# dump a copy to STDOUT, mostly for debugging purposes
say "<pre>{tc $tier.&ord-n} {$per-tier.&card} programming languages by number of task examples completed:";
say ' ', join ' ', .map( {("{(@places[|$which])[$_]} {@top-n[$_]}").fmt("%-15s")} ) for (^@top-n).batch(5);
say "</pre>\n";
 
unless $no-fetch {
 
note 'Retrieving task information...';
 
mkdir('./pages') unless './pages'.IO.e;
 
@top-n = %counts.sort( {-.value, .key} )[^@places].map: *.key.trans(' ' => '_');;
 
for %cat.keys.sort -> $cat {
mediawiki-query(
$url, 'pages',
:generator<categorymembers>,
:gcmtitle("Category:$cat"),
:gcmlimit<350>,
:rawcontinue(),
:prop<title>
).map({
my $page;
my $response;
 
loop {
$response = $client.get("{ $url }/index.php?title={ uri-escape .<title> }&action=raw");
if $response.is-success {
$page = $response.content;
last;
} else {
redo;
}
}
 
"./pages/{ uri-escape .<title>.subst(/' '/, '_', :g) }".IO.spurt($page);
my $lc = $page.lc.trans(' ' => '_');
my $count = +$lc.comb(/ ^^'==' <-[\n=]>* '{{header|' <-[}]>+? '}}==' \h* $$ /);
%tasks{.<title>} = {'cat' => %cat{$cat}, :$count};
%tasks{.<title>}<top-n> = (^@top-n).map( {
($lc.contains("==\{\{header|{@top-n[$_].lc}}}") or
# Deal with 3 part headers - {{header|F_Sharp|F#}}, {{header|C_Sharp|C#}}, etc.
$lc.contains("==\{\{header|{@top-n[$_].lc}|") or
# Icon and Unicon are their own special flowers
$lc.contains("}}_and_\{\{header|{@top-n[$_].lc}}}==") or
# Language1 / Language2 for shared entries (e.g. C / C++)
$lc.contains(rx/'}}''_'*'/''_'*'{{header|'$(@top-n[$_].lc)'}}=='/)) ??
(@places[$_]) !!
# Check if the task was omitted
$lc.contains("\{\{omit_from|{@top-n[$_].lc}") ?? 'O' !!
# The task is neither done or omitted
' '
} ).join;
print clear, 1 + $++, ' ', %cat{$cat}, ' ', .<title>;
})
}
 
print clear;
 
note "\nTask information saved to local file: {$hashfile.IO.absolute}";
$hashfile.IO.spurt(%tasks.&to-json);
 
}
 
# Load information from local file
%tasks = $hashfile.IO.e ?? $hashfile.IO.slurp.&from-json !! ( );
 
@top-n = %counts.sort( {-.value, .key} )[|$which].map: *.key.trans(' ' => '_');
 
# Convert saved task info to a table
note "\nBuilding table...";
my $count = +%tasks;
my $taskcnt = +%tasks.grep: *.value.<cat> eq %cat<Programming_Tasks>;
my $draftcnt = $count - $taskcnt;
my $total = sum %tasks{*}»<count>;
 
# Dump table to a file
my $out = open($tablefile, :w) or die "$!\n";
 
$out.say: "<pre>{tc $tier.&ord-n} {$per-tier.&card} programming languages by number of task examples completed:";
$out.say: ' ', join ' ', .map( {("{(@places[|$which])[$_]} {@top-n[$_]}").fmt("%-15s")} ) for (^@top-n).batch(5);
$out.say: "</pre>\n\n<div style=\"height:40em;overflow:scroll;\">";
 
# Add table boilerplate and caption
$out.say:
'{|class="wikitable sortable"', "\n",
"|+ As of { DateTime.new(time) } :: Tasks: { $taskcnt } ::<span style=\"background-color:#ffd\"> Draft Tasks:",
"{ $draftcnt } </span>:: Total Tasks: { $count } :: Total Examples: { $total }\n",
"!Count!!Task!!{(@places[|$which]).join('!!')}"
;
 
# Sort tasks by count then add row
for %tasks.sort: { [-.value<count>, .key] } -> $task {
$out.say:
( $task.value<cat> eq 'Draft'
?? "|- style=\"background-color: #ffc\"\n"
!! "|-\n"
),
"| { $task.value<count> }\n",
( $task.key ~~ /\d/
?? "|data-sort-value=\"{ $task.key.&naturally }\"| [[{uri-escape $task.key}|{$task.key}]]\n"
!! "| [[{uri-escape $task.key}|{$task.key}]]\n"
),
"|{ $task.value<top-n>.comb[|$which].join('||') }"
}
 
$out.say( "|}\n</div>" );
$out.close;
 
note "Table file saved as: {$tablefile.IO.absolute}";
 
sub mediawiki-query ($site, $type, *%query) {
my $url = "$site/api.php?" ~ uri-query-string(
:action<query>, :format<json>, :formatversion<2>, |%query);
my $continue = '';
 
gather loop {
my $response = $client.get("$url&$continue");
my $data = from-json($response.content);
take $_ for $data.<query>.{$type}.values;
$continue = uri-query-string |($data.<query-continue>{*}».hash.hash or last);
}
}
 
sub uri-query-string (*%fields) { %fields.map({ "{.key}={uri-escape .value}" }).join("&") }
 
sub naturally ($a) { $a.lc.subst(/(\d+)/, ->$/ {0~(65+$0.chars).chr~$0},:g) }
 
sub clear { "\r" ~ ' ' x 116 ~ "\r" }</syntaxhighlight>
 
{{out|Abridged output}}
<pre>Top ten programming language by number of task examples completed:
① Go
② Perl 6
③ Kotlin
④ Python
⑤ Phix
⑥ Racket
⑦ Perl
⑧ C
⑨ Julia
⑩ Tcl
</pre>
 
<div style="height:40em;overflow:scroll;">
{|class="wikitable sortable"
|+ As of 2019-01-21T22:41:28Z :: Tasks: 924 ::<span style="background-color:#ffd"> Draft Tasks:215 </span>:: Total Tasks: 1139 :: Total Examples: 59984
!Count!!Task!!①!!②!!③!!④!!⑤!!⑥!!⑦!!⑧!!⑨!!⑩
|-
| 405
| [[Hello%20world%2FText|Hello world/Text]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 283
|data-sort-value="0C99 bottles of beer"| [[99%20Bottles%20of%20Beer|99 Bottles of Beer]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 276
| [[FizzBuzz|FizzBuzz]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 273
|data-sort-value="0D100 doors"| [[100%20doors|100 doors]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 251
| [[Fibonacci%20sequence|Fibonacci sequence]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 246
| [[Comments|Comments]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 239
| [[Factorial|Factorial]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 223
| [[Empty%20program|Empty program]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 222
| [[A%2BB|A+B]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|-
| 214
| [[Function%20definition|Function definition]]
|①||②||③||④||⑤||⑥||⑦||⑧||⑨||⑩
|}
</div>
 
=={{header|Ring}}==
<syntaxhighlight lang="ring">
# Project: Rosetta Code/Count examples
 
load "stdlib.ring"
ros= download("http://rosettacode.org/wiki/Category:Programming_Tasks")
pos = 1
num = 0
totalros = 0
rosname = ""
rostitle = ""
for n = 1 to len(ros)
nr = searchstring(ros,'<li><a href="/wiki/',pos)
if nr = 0
exit
else
pos = nr + 1
ok
nr = searchname(nr)
nr = searchtitle(nr)
next
see nl
see "Total: " + totalros + " examples." + nl
 
func searchstring(str,substr,n)
newstr=right(str,len(str)-n+1)
nr = substr(newstr, substr)
if nr = 0
return 0
else
return n + nr -1
ok
 
func searchname(sn)
nr2 = searchstring(ros,'">',sn)
nr3 = searchstring(ros,"</a></li>",sn)
rosname = substr(ros,nr2+2,nr3-nr2-2)
return sn
 
func searchtitle(sn)
st = searchstring(ros,"title=",sn)
rostitle = substr(ros,sn+19,st-sn-21)
rostitle = "rosettacode.org/wiki/" + rostitle
rostitle = download(rostitle)
sum = count(rostitle,"Edit section:")
num = num + 1
see "" + num + ". " + rosname + ": " + sum + " examples." + nl
totalros = totalros + sum
return sn
 
func count(cstring,dstring)
sum = 0
while substr(cstring,dstring) > 0
sum = sum + 1
cstring = substr(cstring,substr(cstring,dstring)+len(string(sum)))
end
return sum
</syntaxhighlight>
Output:
<pre>
1. 100 doors: 331 examples.
2. 15 Puzzle Game: 48 examples.
3. 15 puzzle solver: 18 examples.
4. 2048: 40 examples.
5. 24 game: 95 examples.
6. 24 game/Solve: 59 examples.
7. 4-rings or 4-squares puzzle: 42 examples.
8. 9 billion names of God the integer: 54 examples.
9. 99 Bottles of Beer: 393 examples.
10. A+B: 250 examples.
......
872. XML/XPath: 54 examples.
873. Y combinator: 88 examples.
874. Yahoo! search interface: 20 examples.
875. Yin and yang: 59 examples.
876. Zebra puzzle: 58 examples.
877. Zeckendorf arithmetic: 11 examples.
878. Zeckendorf number representation: 64 examples.
879. Zero to the zero power: 100 examples.
880. Zhang-Suen thinning algorithm: 26 examples.
881. Zig-zag matrix: 112 examples.
 
Total: 62677 examples.
</pre>
 
=={{header|Ruby}}==
{{libheader|REXML}}
First, a RosettaCode module, saved as <tt>rosettacode.rb</tt>:
<langsyntaxhighlight lang="ruby">require 'open-uri'
require 'rexml/document'
 
Line 6,315 ⟶ 3,152:
end
 
end</langsyntaxhighlight>
 
Then, we implement the task with:
<langsyntaxhighlight lang="ruby">require 'rosettacode'
 
total_examples = 0
Line 6,330 ⟶ 3,167:
 
puts
puts "Total: #{total_examples}"</langsyntaxhighlight>
 
=={{header|Run BASIC}}==
<syntaxhighlight lang="runbasic">html "<table border=1><tr bgcolor=wheat align=center><td>Num</td><td>Task</td><td>Examples</td></tr>"
 
a$ = httpGet$("http://rosettacode.org/wiki/Category:Programming_Tasks")
a$ = word$(a$,1,"</table></div>")
i = instr(a$,"<a href=""/wiki/")
i = instr(a$,"<a href=""/wiki/",i+1)
while i > 0
count = count + 1
i = instr(a$,"<a href=""/wiki/",i+1)
j = instr(a$,">",i+5)
a1$ = mid$(a$,i+15,j-i)
taskId$ = word$(a1$,1,"""")
task$ = word$(a1$,3,"""")
url$ = "http://rosettacode.org/wiki/";taskId$
a2$ = httpGet$(url$)
ii = instr(a2$,"<span class=""tocnumber"">")
jj = 0
while ii > 0
jj = ii
ii = instr(a2$,"<span class=""tocnumber"">",ii+10)
wend
if jj = 0 then
examp = 0
else
kk = instr(a2$,"<",jj+24)
examp = int(val(mid$(a2$,jj+24,kk-jj-24)))
end if
html "<tr><td align=right>";count;"</td><td>";task$;"</td><td align=right>";examp;"</td></tr>"
totExamp = totExamp + examp
wend
html "<tr bgcolor=wheat><td>**</td><td>** Total **</td><td align=right>";totExamp;"</td></tr></table>"
end</syntaxhighlight>
<table border=1><tr bgcolor=wheat align=center><td>Num</td><td>Task</td><td>Examples</td></tr>
<tr><td align=right>1</td><td>100 doors</td><td align=right>165</td></tr>
<tr><td align=right>2</td><td>24 game</td><td align=right>56</td></tr>
<tr><td align=right>3</td><td>24 game/Solve</td><td align=right>34</td></tr>
<tr><td align=right>4</td><td>99 Bottles of Beer</td><td align=right>192</td></tr>
<tr><td align=right>5</td><td>A+B</td><td align=right>129</td></tr>
<tr><td align=right>6</td><td>Abstract type</td><td align=right>51</td></tr>
<tr><td align=right>7</td><td>Accumulator factory</td><td align=right>65</td></tr>
<tr><td align=right>8</td><td>Ackermann function</td><td align=right>132</td></tr>
<tr><td align=right>9</td><td>Active Directory/Connect</td><td align=right>13</td></tr>
<tr><td align=right>10</td><td>Active Directory/Search for a user</td><td align=right>13</td></tr>
<tr><td align=right>11</td><td>Active object</td><td align=right>22</td></tr>
<tr><td align=right>12</td><td>Add a variable to a class instance at runtime</td><td align=right>37</td></tr>
<tr><td align=right>...</td><td>...</td><td align=right>...</td></tr>
<tr><td align=right>655</td><td>Y combinator</td><td align=right>53</td></tr>
<tr><td align=right>656</td><td>Yahoo! search interface</td><td align=right>16</td></tr>
<tr><td align=right>657</td><td>Yin and yang</td><td align=right>38</td></tr>
<tr><td align=right>658</td><td>Zebra puzzle</td><td align=right>12</td></tr>
<tr><td align=right>659</td><td>Zeckendorf number representation</td><td align=right>18</td></tr>
<tr><td align=right>660</td><td>Zig-zag matrix</td><td align=right>65</td></tr>
<tr bgcolor=wheat><td>**</td><td>** Total **</td><td align=right>28611</td></tr></table>
 
=={{header|Rust}}==
<langsyntaxhighlight lang="rust">extern crate reqwest;
extern crate url;
extern crate rustc_serialize;
Line 6,444 ⟶ 3,336:
let json: Json = query_api(query).unwrap();
count_number_examples(&json, task.page_id).unwrap()
}</langsyntaxhighlight>
 
The function is then run using the following:
<langsyntaxhighlight lang="rust">
extern crate count_examples;
fn main() {
Line 6,455 ⟶ 3,347:
println!("Task: {} has {} examples", task.title, count);
}
}</langsyntaxhighlight>
 
=={{header|Run BASIC}}==
<lang runbasic>html "<table border=1><tr bgcolor=wheat align=center><td>Num</td><td>Task</td><td>Examples</td></tr>"
 
a$ = httpGet$("http://rosettacode.org/wiki/Category:Programming_Tasks")
a$ = word$(a$,1,"</table></div>")
i = instr(a$,"<a href=""/wiki/")
i = instr(a$,"<a href=""/wiki/",i+1)
while i > 0
count = count + 1
i = instr(a$,"<a href=""/wiki/",i+1)
j = instr(a$,">",i+5)
a1$ = mid$(a$,i+15,j-i)
taskId$ = word$(a1$,1,"""")
task$ = word$(a1$,3,"""")
url$ = "http://rosettacode.org/wiki/";taskId$
a2$ = httpGet$(url$)
ii = instr(a2$,"<span class=""tocnumber"">")
jj = 0
while ii > 0
jj = ii
ii = instr(a2$,"<span class=""tocnumber"">",ii+10)
wend
if jj = 0 then
examp = 0
else
kk = instr(a2$,"<",jj+24)
examp = int(val(mid$(a2$,jj+24,kk-jj-24)))
end if
html "<tr><td align=right>";count;"</td><td>";task$;"</td><td align=right>";examp;"</td></tr>"
totExamp = totExamp + examp
wend
html "<tr bgcolor=wheat><td>**</td><td>** Total **</td><td align=right>";totExamp;"</td></tr></table>"
end</lang>
<table border=1><tr bgcolor=wheat align=center><td>Num</td><td>Task</td><td>Examples</td></tr>
<tr><td align=right>1</td><td>100 doors</td><td align=right>165</td></tr>
<tr><td align=right>2</td><td>24 game</td><td align=right>56</td></tr>
<tr><td align=right>3</td><td>24 game/Solve</td><td align=right>34</td></tr>
<tr><td align=right>4</td><td>99 Bottles of Beer</td><td align=right>192</td></tr>
<tr><td align=right>5</td><td>A+B</td><td align=right>129</td></tr>
<tr><td align=right>6</td><td>Abstract type</td><td align=right>51</td></tr>
<tr><td align=right>7</td><td>Accumulator factory</td><td align=right>65</td></tr>
<tr><td align=right>8</td><td>Ackermann function</td><td align=right>132</td></tr>
<tr><td align=right>9</td><td>Active Directory/Connect</td><td align=right>13</td></tr>
<tr><td align=right>10</td><td>Active Directory/Search for a user</td><td align=right>13</td></tr>
<tr><td align=right>11</td><td>Active object</td><td align=right>22</td></tr>
<tr><td align=right>12</td><td>Add a variable to a class instance at runtime</td><td align=right>37</td></tr>
<tr><td align=right>...</td><td>...</td><td align=right>...</td></tr>
<tr><td align=right>655</td><td>Y combinator</td><td align=right>53</td></tr>
<tr><td align=right>656</td><td>Yahoo! search interface</td><td align=right>16</td></tr>
<tr><td align=right>657</td><td>Yin and yang</td><td align=right>38</td></tr>
<tr><td align=right>658</td><td>Zebra puzzle</td><td align=right>12</td></tr>
<tr><td align=right>659</td><td>Zeckendorf number representation</td><td align=right>18</td></tr>
<tr><td align=right>660</td><td>Zig-zag matrix</td><td align=right>65</td></tr>
<tr bgcolor=wheat><td>**</td><td>** Total **</td><td align=right>28611</td></tr></table>
 
=={{header|Scala}}==
{{libheader|Scala}}<langsyntaxhighlight Scalalang="scala">import scala.language.postfixOps
 
object TaskCount extends App {
Line 6,537 ⟶ 3,374:
counts map (_.apply) map Function.tupled("%s: %d examples." format (_, _)) foreach println
println("\nTotal: %d examples." format (counts map (_.apply._2) sum))
}</langsyntaxhighlight>
 
=={{header|Sidef}}==
{{trans|Perl}}
<langsyntaxhighlight lang="ruby">var lwp = require('LWP::UserAgent').new(agent => 'Mozilla/5.0');
 
var site = 'http://rosettacode.org';
Line 6,553 ⟶ 3,390:
var count = lwp.get("#{site}/wiki/#{slug}").decoded_content.count(/toclevel-1/g);
say "#{m[0]}: #{count} examples";
}</langsyntaxhighlight>
{{out}}
<pre>
100 doors: 2180278 examples
2415 gamePuzzle Game: 76050 examples
2415 game/Solvepuzzle solver: 45010 examples
9 billion names of God the integer2048: 32041 examples
9924 Bottles of Beergame: 233091 examples
A+B24 game/Solve: 180056 examples
ABC4-rings Problemor 4-squares puzzle: 72044 examples
Abstract9 typebillion names of God the integer: 68048 examples
99 Bottles of Beer: 287 examples
A+B: 228 examples
...
</pre>
Line 6,569 ⟶ 3,408:
=={{header|Tcl}}==
{{tcllib|json}}
<langsyntaxhighlight lang="tcl">package require Tcl 8.5
package require http
package require json
Line 6,633 ⟶ 3,472:
}
 
puts "\nTotal: $total examples"</langsyntaxhighlight>
 
=={{header|TUSCRIPT}}==
<langsyntaxhighlight lang="tuscript">$$ MODE TUSCRIPT
url="http://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"
data=REQUEST (url)
Line 6,675 ⟶ 3,514:
 
FILE "tasks" = line
</syntaxhighlight>
</lang>
Output in file "tasks":
<pre style='height:30ex;overflow:scroll'>
Line 6,694 ⟶ 3,533:
Zig-zag matrix=46 members
2011-01-15 03:41:30: 455 Programing Tasks: 16009 solutions
</pre>
 
=={{header|UNIX Shell}}==
{{works with|Bourne Again Shell}}
{{trans|Python}}
Requires the <tt>curl</tt> and <tt>jq</tt> command-line utilities.
 
<syntaxhighlight lang="sh">#!/usr/bin/env bash
SITE=https://www.rosettacode.org
API=$SITE/mw/api.php
PAGES=$SITE/mw/index.php
query="$API?action=query"
query+=$(printf '&%s' \
list=categorymembers \
cmtitle=Category:Programming_Tasks \
cmlimit=500)
total=0
while read title; do
t=${title// /_}
tasks=$(curl -s "$PAGES?title=$t&action=raw" \
| grep -c '{{header|')
printf '%s: %d examples.\n' "$title" "$tasks"
let total+=tasks
done < <(curl -s "$query&format=json" \
| jq -r '.query.categorymembers[].title')
 
printf '\nTotal: %d examples.\n' "$total"</syntaxhighlight>
 
=={{header|Wren}}==
{{libheader|libcurl}}
{{libheader|Wren-pattern}}
An embedded program so we can use the libcurl library.
<syntaxhighlight lang="wren">/* Rosetta_Code_Count_examples.wren */
 
import "./pattern" for Pattern
 
var CURLOPT_URL = 10002
var CURLOPT_FOLLOWLOCATION = 52
var CURLOPT_WRITEFUNCTION = 20011
var CURLOPT_WRITEDATA = 10001
 
foreign class Buffer {
construct new() {} // C will allocate buffer of a suitable size
 
foreign value // returns buffer contents as a string
}
 
foreign class Curl {
construct easyInit() {}
 
foreign easySetOpt(opt, param)
 
foreign easyPerform()
 
foreign easyCleanup()
}
 
var curl = Curl.easyInit()
 
var getContent = Fn.new { |url|
var buffer = Buffer.new()
curl.easySetOpt(CURLOPT_URL, url)
curl.easySetOpt(CURLOPT_FOLLOWLOCATION, 1)
curl.easySetOpt(CURLOPT_WRITEFUNCTION, 0) // write function to be supplied by C
curl.easySetOpt(CURLOPT_WRITEDATA, buffer)
curl.easyPerform()
return buffer.value
}
 
var url = "https://www.rosettacode.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Programming_Tasks&cmlimit=500&format=xml"
var content = getContent.call(url)
var p = Pattern.new("title/=\"[+1^\"]\"")
var matches = p.findAll(content)
for (m in matches) {
var title = m.capsText[0].replace("&#039;", "'").replace("&quot;", "\"")
var title2 = title.replace(" ", "_").replace("+", "\%252B")
var taskUrl = "https://www.rosettacode.org/w/index.php?title=%(title2)&action=raw"
var taskContent = getContent.call(taskUrl)
var lines = taskContent.split("\n")
var count = lines.count { |line| line.trim().startsWith("=={{header|") }
System.print("%(title) : %(count) examples")
}
 
curl.easyCleanup()</syntaxhighlight>
<br>
which we now embed in the following C program, build and run.
<syntaxhighlight lang="c">/* gcc Rosetta_Code_Count_examples.c -o Rosetta_Code_Count_examples -lcurl -lwren -lm */
 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#include "wren.h"
 
struct MemoryStruct {
char *memory;
size_t size;
};
 
/* C <=> Wren interface functions */
 
static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp) {
size_t realsize = size * nmemb;
struct MemoryStruct *mem = (struct MemoryStruct *)userp;
char *ptr = realloc(mem->memory, mem->size + realsize + 1);
if(!ptr) {
/* out of memory! */
printf("not enough memory (realloc returned NULL)\n");
return 0;
}
 
mem->memory = ptr;
memcpy(&(mem->memory[mem->size]), contents, realsize);
mem->size += realsize;
mem->memory[mem->size] = 0;
return realsize;
}
 
void C_bufferAllocate(WrenVM* vm) {
struct MemoryStruct *ms = (struct MemoryStruct *)wrenSetSlotNewForeign(vm, 0, 0, sizeof(struct MemoryStruct));
ms->memory = malloc(1);
ms->size = 0;
}
 
void C_bufferFinalize(void* data) {
struct MemoryStruct *ms = (struct MemoryStruct *)data;
free(ms->memory);
}
 
void C_curlAllocate(WrenVM* vm) {
CURL** pcurl = (CURL**)wrenSetSlotNewForeign(vm, 0, 0, sizeof(CURL*));
*pcurl = curl_easy_init();
}
 
void C_value(WrenVM* vm) {
struct MemoryStruct *ms = (struct MemoryStruct *)wrenGetSlotForeign(vm, 0);
wrenSetSlotString(vm, 0, ms->memory);
}
 
void C_easyPerform(WrenVM* vm) {
CURL* curl = *(CURL**)wrenGetSlotForeign(vm, 0);
curl_easy_perform(curl);
}
 
void C_easyCleanup(WrenVM* vm) {
CURL* curl = *(CURL**)wrenGetSlotForeign(vm, 0);
curl_easy_cleanup(curl);
}
 
void C_easySetOpt(WrenVM* vm) {
CURL* curl = *(CURL**)wrenGetSlotForeign(vm, 0);
CURLoption opt = (CURLoption)wrenGetSlotDouble(vm, 1);
if (opt < 10000) {
long lparam = (long)wrenGetSlotDouble(vm, 2);
curl_easy_setopt(curl, opt, lparam);
} else if (opt < 20000) {
if (opt == CURLOPT_WRITEDATA) {
struct MemoryStruct *ms = (struct MemoryStruct *)wrenGetSlotForeign(vm, 2);
curl_easy_setopt(curl, opt, (void *)ms);
} else if (opt == CURLOPT_URL) {
const char *url = wrenGetSlotString(vm, 2);
curl_easy_setopt(curl, opt, url);
}
} else if (opt < 30000) {
if (opt == CURLOPT_WRITEFUNCTION) {
curl_easy_setopt(curl, opt, &WriteMemoryCallback);
}
}
}
 
WrenForeignClassMethods bindForeignClass(WrenVM* vm, const char* module, const char* className) {
WrenForeignClassMethods methods;
methods.allocate = NULL;
methods.finalize = NULL;
if (strcmp(module, "main") == 0) {
if (strcmp(className, "Buffer") == 0) {
methods.allocate = C_bufferAllocate;
methods.finalize = C_bufferFinalize;
} else if (strcmp(className, "Curl") == 0) {
methods.allocate = C_curlAllocate;
}
}
return methods;
}
 
WrenForeignMethodFn bindForeignMethod(
WrenVM* vm,
const char* module,
const char* className,
bool isStatic,
const char* signature) {
if (strcmp(module, "main") == 0) {
if (strcmp(className, "Buffer") == 0) {
if (!isStatic && strcmp(signature, "value") == 0) return C_value;
} else if (strcmp(className, "Curl") == 0) {
if (!isStatic && strcmp(signature, "easySetOpt(_,_)") == 0) return C_easySetOpt;
if (!isStatic && strcmp(signature, "easyPerform()") == 0) return C_easyPerform;
if (!isStatic && strcmp(signature, "easyCleanup()") == 0) return C_easyCleanup;
}
}
return NULL;
}
 
static void writeFn(WrenVM* vm, const char* text) {
printf("%s", text);
}
 
void errorFn(WrenVM* vm, WrenErrorType errorType, const char* module, const int line, const char* msg) {
switch (errorType) {
case WREN_ERROR_COMPILE:
printf("[%s line %d] [Error] %s\n", module, line, msg);
break;
case WREN_ERROR_STACK_TRACE:
printf("[%s line %d] in %s\n", module, line, msg);
break;
case WREN_ERROR_RUNTIME:
printf("[Runtime Error] %s\n", msg);
break;
}
}
 
char *readFile(const char *fileName) {
FILE *f = fopen(fileName, "r");
fseek(f, 0, SEEK_END);
long fsize = ftell(f);
rewind(f);
char *script = malloc(fsize + 1);
fread(script, 1, fsize, f);
fclose(f);
script[fsize] = 0;
return script;
}
 
static void loadModuleComplete(WrenVM* vm, const char* module, WrenLoadModuleResult result) {
if( result.source) free((void*)result.source);
}
 
WrenLoadModuleResult loadModule(WrenVM* vm, const char* name) {
WrenLoadModuleResult result = {0};
if (strcmp(name, "random") != 0 && strcmp(name, "meta") != 0) {
result.onComplete = loadModuleComplete;
char fullName[strlen(name) + 6];
strcpy(fullName, name);
strcat(fullName, ".wren");
result.source = readFile(fullName);
}
return result;
}
 
int main(int argc, char **argv) {
WrenConfiguration config;
wrenInitConfiguration(&config);
config.writeFn = &writeFn;
config.errorFn = &errorFn;
config.bindForeignClassFn = &bindForeignClass;
config.bindForeignMethodFn = &bindForeignMethod;
config.loadModuleFn = &loadModule;
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "Rosetta_Code_Count_examples.wren";
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
switch (result) {
case WREN_RESULT_COMPILE_ERROR:
printf("Compile Error!\n");
break;
case WREN_RESULT_RUNTIME_ERROR:
printf("Runtime Error!\n");
break;
case WREN_RESULT_SUCCESS:
break;
}
wrenFreeVM(vm);
free(script);
return 0;
}</syntaxhighlight>
 
{{out}}
Just showing the first 25 'full' tasks:
<pre>
100 doors : 355 examples
100 prisoners : 85 examples
15 puzzle game : 86 examples
15 puzzle solver : 27 examples
2048 : 65 examples
21 game : 52 examples
24 game : 107 examples
24 game/Solve : 64 examples
4-rings or 4-squares puzzle : 74 examples
9 billion names of God the integer : 66 examples
99 bottles of beer : 376 examples
A+B : 296 examples
Abbreviations, automatic : 58 examples
Abbreviations, easy : 50 examples
Abbreviations, simple : 46 examples
ABC problem : 150 examples
Abelian sandpile model : 40 examples
Abelian sandpile model/Identity : 28 examples
Abstract type : 93 examples
Abundant odd numbers : 72 examples
Abundant, deficient and perfect number classifications : 110 examples
Accumulator factory : 115 examples
Achilles numbers : 25 examples
Ackermann function : 243 examples
Active Directory/Connect : 29 examples
....
</pre>
 
=={{header|zkl}}==
Uses shared libraries YAJL and cURL and handles "continue" responses.
<langsyntaxhighlight lang="zkl">var [const] YAJL=Import("zklYAJL")[0], CURL=Import("zklCurl");
 
fcn getTasks(language){
Line 6,717 ⟶ 3,863:
tasks
}
re:=RegExp(0'!\s+==\s*{{\s*header\s*\|!); // == {{ header | zkl
foreach task in (getTasks("Programming_Tasks")){
page:=CURL().get(
Line 6,725 ⟶ 3,871:
cnt,n:=0,0; while(re.search(page,True,n)){ cnt+=1; n=re.matched[0].sum(0); }
"%4d: %s".fmt(cnt,task).println();
}</langsyntaxhighlight>
{{out}}
<pre>
9,479

edits