How to resolve the algorithm Unix/ls step by step in the FunL programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Unix/ls step by step in the FunL programming language

Table of Contents

Problem Statement

Write a program that will list everything in the current folder,   similar to:

The output must be sorted, but printing extended details and producing multi-column output is not required.

For the list of paths:

When the program is executed in   /foo,   it should print: and when the program is executed in   /foo/bar,   it should print:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Unix/ls step by step in the FunL programming language

Source code in the funl programming language

import io.File

for f <- sort( list(File( "." ).list()).filterNot(s -> s.startsWith(".")) )
    println( f )

  

You may also check:How to resolve the algorithm Factors of an integer step by step in the C# programming language
You may also check:How to resolve the algorithm Mind boggling card trick step by step in the Mathematica/Wolfram Language programming language
You may also check:How to resolve the algorithm Loops/Foreach step by step in the Prolog programming language
You may also check:How to resolve the algorithm Create an HTML table step by step in the F# programming language
You may also check:How to resolve the algorithm Box the compass step by step in the Racket programming language