How to resolve the algorithm Terminal control/Coloured text step by step in the F# programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Terminal control/Coloured text step by step in the F# programming language
Table of Contents
Problem Statement
Display a word in various colours on the terminal. The system palette, or colours such as Red, Green, Blue, Magenta, Cyan, and Yellow can be used.
Optionally demonstrate:
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Terminal control/Coloured text step by step in the F# programming language
Source code in the fsharp programming language
open System
Console.ForegroundColor <- ConsoleColor.Red
Console.BackgroundColor <- ConsoleColor.Yellow
Console.WriteLine("Red on Yellow")
Console.ForegroundColor <- ConsoleColor.White
Console.BackgroundColor <- ConsoleColor.Black
Console.WriteLine("White on Black")
Console.ForegroundColor <- ConsoleColor.Green
Console.BackgroundColor <- ConsoleColor.Blue
Console.WriteLine("Green on Blue")
Console.ResetColor()
Console.WriteLine("Back to normal")
Console.ReadKey()
You may also check:How to resolve the algorithm Sierpinski carpet step by step in the Elixir programming language
You may also check:How to resolve the algorithm Sum digits of an integer step by step in the Logo programming language
You may also check:How to resolve the algorithm Loops/Break step by step in the Arturo programming language
You may also check:How to resolve the algorithm Average loop length step by step in the Phixmonti programming language
You may also check:How to resolve the algorithm Pi step by step in the J programming language