Rosetta Code/Count examples: Difference between revisions

m
→‎{{header|Wren}}: Minor changes (though see Talk Page re encoding of '+')
m (→‎{{header|Python}}: More readable logging)
m (→‎{{header|Wren}}: Minor changes (though see Talk Page re encoding of '+'))
Line 3,565:
{{libheader|Wren-pattern}}
An embedded program so we can use the libcurl library.
<syntaxhighlight lang="ecmascriptwren">/* rc_count_examplesRosetta_Code_Count_examples.wren */
 
import "./pattern" for Pattern
Line 3,608:
for (m in matches) {
var title = m.capsText[0].replace("&#039;", "'").replace("&quot;", "\"")
var title2 = title.replace(" ", "_").replace("+", "\%2B252B")
var taskUrl = "https://www.rosettacode.org/w/index.php?title=%(title2)&action=raw"
var taskContent = getContent.call(taskUrl)
Line 3,619:
<br>
which we now embed in the following C program, build and run.
<syntaxhighlight lang="c">/* gcc rc_count_examplesRosetta_Code_Count_examples.c -o rc_count_examplesRosetta_Code_Count_examples -lcurl -lwren -lm */
 
#include <stdio.h>
Line 3,793:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "rc_count_examplesRosetta_Code_Count_examples.wren";
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
Line 3,814:
Just showing the first 25 'full' tasks:
<pre>
100 doors : 334355 examples
100 prisoners : 7885 examples
15 puzzle game : 7886 examples
15 puzzle solver : 2527 examples
2048 : 6265 examples
21 game : 4852 examples
24 game : 105107 examples
24 game/Solve : 6364 examples
4-rings or 4-squares puzzle : 6574 examples
9 billion names of God the integer : 6566 examples
99 bottles of beer : 354376 examples
A+B : 282296 examples
Abbreviations, automatic : 5558 examples
Abbreviations, easy : 4850 examples
Abbreviations, simple : 4446 examples
ABC problem : 137150 examples
Abelian sandpile model : 3140 examples
Abelian sandpile model/Identity : 2528 examples
Abstract type : 9093 examples
Abundant odd numbers : 6972 examples
Abundant, deficient and perfect number classifications : 104110 examples
Accumulator factory : 111115 examples
Achilles numbers : 1725 examples
Ackermann function : 237243 examples
Active Directory/Connect : 29 examples
....
9,485

edits