How to resolve the algorithm Rosetta Code/Rank languages by popularity step by step in the Lasso 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 Lasso 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 Lasso programming language

Source code in the lasso programming language

[
sys_listtraits !>> 'xml_tree_trait' ? include('xml_tree.lasso')
local(lang = array)
local(f = curl('http://rosettacode.org/mw/index.php?title=Special:Categories&limit=5000')->result->asString)
local(ff) = xml_tree(#f)  
local(lis = #ff->body->div(3)->div(3)->div(3)->div->ul->getnodes)
with li in #lis do => {
	local(title = #li->a->attribute('title'))
	#title->removeLeading('Category:')
	local(num = #li->asString->split('(')->last)
	#num->removeTrailing(')')
	#num->removeTrailing('members')
	#num->removeTrailing('member')
	#num->trim
	#num = integer(#num)
	#lang->insert(#title = #num)
}
local(c = 1)
with l in #lang
order by #l->second descending
do => {^
	#c++
	'. '+#l->second + '  - ' + #l->first+'\r'
^}
]

You may also check:How to resolve the algorithm Sudoku step by step in the VBScript programming language
You may also check:How to resolve the algorithm Create an HTML table step by step in the Ring programming language
You may also check:How to resolve the algorithm Least common multiple step by step in the Vala programming language
You may also check:How to resolve the algorithm Summarize primes step by step in the Julia programming language
You may also check:How to resolve the algorithm Rock-paper-scissors step by step in the Ring programming language