How to resolve the algorithm Terminal control/Coloured text step by step in the BaCon programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Terminal control/Coloured text step by step in the BaCon 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 BaCon programming language

Source code in the bacon programming language

' ANSI terminal coloured text
COLOR FG TO BLACK
PRINT "a word"

COLOR FG TO RED
PRINT "a word"

COLOR FG TO GREEN
PRINT "a word"

' Other colours include YELLOW, BLUE, MAGENTA, CYAN, WHITE
' Second keyword can be BG for background colour control
' The COLOR command also accepts keywords of NORMAL, INTENSE, INVERSE, RESET

  

You may also check:How to resolve the algorithm Caesar cipher step by step in the C programming language
You may also check:How to resolve the algorithm First-class functions step by step in the TXR programming language
You may also check:How to resolve the algorithm Pi step by step in the Yabasic programming language
You may also check:How to resolve the algorithm Filter step by step in the REBOL programming language
You may also check:How to resolve the algorithm Day of the week step by step in the zonnon programming language