How to resolve the algorithm Rosetta Code/Rank languages by popularity step by step in the SNOBOL4 programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Rosetta Code/Rank languages by popularity step by step in the SNOBOL4 programming language

Table of Contents

Problem Statement

Sort the most popular computer programming languages based in number of members in Rosetta Code categories. Sample output on 02 August 2022 at 09:50 +02

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Rosetta Code/Rank languages by popularity step by step in the SNOBOL4 programming language

Source code in the snobol4 programming language

-include "url.sno"
        http.recl = "K,32767"  ;* Read next 32767 characters
                               ;*   of very long lines.

        rclangs = "http://rosettacode.org/mw/api.php?"
+          "format=xml&action=query&generator=categorymembers&"
+          "gcmtitle=Category:Programming%20Languages&"
+          "gcmlimit=500&prop=categoryinfo"

        languagepat = arb "+          break('"') . lang arb 'pages="' break('"') . count

        langtable = table(500, 20)

        url.open(.fin, rclangs, http.recl)          :s(read)
        output = "Cannot open rosettacode site."    :(end)

read    line = line fin                             :f(done)
get     line languagepat =                          :f(read)
        langtable = langtable + count   :(get)
        
done    langarray = rsort(langtable,2)              :s(write)
        output = "No languages found."              :(end)

write   n = n + 1 
        output = lpad(n ". ", 5) lpad(langarray, 4)
+          " - " langarray                     :s(write)
       
        url.close(.fin)
end

  

You may also check:How to resolve the algorithm Abelian sandpile model/Identity step by step in the C++ programming language
You may also check:How to resolve the algorithm Department numbers step by step in the Modula-2 programming language
You may also check:How to resolve the algorithm N-smooth numbers step by step in the D programming language
You may also check:How to resolve the algorithm Recaman's sequence step by step in the Wren programming language
You may also check:How to resolve the algorithm Date format step by step in the REXX programming language