How to resolve the algorithm Terminal control/Ringing the terminal bell step by step in the Action! programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Terminal control/Ringing the terminal bell step by step in the Action! programming language
Table of Contents
Problem Statement
Make the terminal running the program ring its "bell".
On modern terminal emulators, this may be done by playing some other sound which might or might not be configurable, or by flashing the title bar or inverting the colors of the screen, but was classically a physical bell within the terminal. It is usually used to indicate a problem where a wrong character has been typed. In most terminals, if the Bell character (ASCII code 7, \a in C) is printed by the program, it will cause the terminal to ring its bell. This is a function of the terminal, and is independent of the programming language of the program, other than the ability to print a particular character to standard out.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Terminal control/Ringing the terminal bell step by step in the Action! programming language
Source code in the action! programming language
PROC Wait(BYTE frames)
BYTE RTCLOK=$14
frames==+RTCLOK
WHILE frames#RTCLOK DO OD
RETURN
PROC Main()
BYTE
i,n=[3],
CH=$02FC ;Internal hardware value for last key pressed
PrintF("Press any key to hear %B bells...",n)
DO UNTIL CH#$FF OD
CH=$FF
FOR i=1 TO n
DO
Put(253) ;buzzer
Wait(20)
OD
Wait(100)
RETURN
You may also check:How to resolve the algorithm Formatted numeric output step by step in the V (Vlang) programming language
You may also check:How to resolve the algorithm Word wheel step by step in the Python programming language
You may also check:How to resolve the algorithm Loops/While step by step in the AmbientTalk programming language
You may also check:How to resolve the algorithm Find the last Sunday of each month step by step in the K programming language
You may also check:How to resolve the algorithm String append step by step in the Asymptote programming language