How to resolve the algorithm Rosetta Code/Find unimplemented tasks step by step in the zkl programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Rosetta Code/Find unimplemented tasks step by step in the zkl programming language

Table of Contents

Problem Statement

Given the name of a language on Rosetta Code, find all tasks which are not implemented in that language.

Note: Implementations should allow for fetching more data than can be returned in one request to Rosetta Code. You'll need to use the Media Wiki API, which you can find out about locally, here, or in Media Wiki's API documentation at, API:Query

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Rosetta Code/Find unimplemented tasks step by step in the zkl programming language

Source code in the zkl programming language

var [const] YAJL=Import("zklYAJL")[0], CURL=Import("zklCurl");

fcn getTasks(language){
   continueValue,tasks:="",Data(0,String);  // "nm\0nm\0...."
   do{
      page:=CURL().get(("http://rosettacode.org/mw/api.php?"
         "action=query&cmlimit=500"
	 "&format=json"
	 "&list=categorymembers"
	 "&cmtitle=Category:%s"
	 "&cmcontinue=%s").fmt(language,continueValue));
      page=page[0].del(0,page[1]);  // get rid of HTML header
      json:=YAJL().write(page).close();
      json["query"]["categorymembers"].pump(tasks,T("get","title"));
      continueValue=json.find("continue") //continue:-||,cmcontinue:page|954|19)
          .toList().apply("concat","=").concat("&");
   }while(continueValue);
   tasks
}

allTasks:=getTasks.future("Programming_Tasks");  // thread

language:="zkl";
tasks:=getTasks(language);
langTasks:=Dictionary(); tasks.pump(Void,langTasks.add.fp1(Void));
unimplementedTasks:=allTasks.filter('wrap(nm){ (not langTasks.holds(nm)) });
println("Found %d unimplemented tasks for %s:"
      .fmt(unimplementedTasks.len(1),language));
unimplementedTasks.pump(Console.println);

  

You may also check:How to resolve the algorithm Fibonacci word/fractal step by step in the Mathematica / Wolfram Language programming language
You may also check:How to resolve the algorithm ISBN13 check digit step by step in the Excel programming language
You may also check:How to resolve the algorithm System time step by step in the HolyC programming language
You may also check:How to resolve the algorithm Copy a string step by step in the Kotlin programming language
You may also check:How to resolve the algorithm Tokenize a string step by step in the Lang programming language