How to resolve the algorithm Keyboard input/Obtain a Y or N response step by step in the Axe programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Keyboard input/Obtain a Y or N response step by step in the Axe programming language

Table of Contents

Problem Statement

Obtain a valid   Y   or   N   response from the keyboard. The keyboard should be flushed, so that any outstanding key-presses are removed, preventing any existing   Y   or   N   key-press from being evaluated. The response should be obtained as soon as   Y   or   N   are pressed, and there should be no need to press an   enter   key.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Keyboard input/Obtain a Y or N response step by step in the Axe programming language

Source code in the axe programming language

While getKey(0)
End

While 1
If getKey(15)
 Disp "N",i
 Return
ElseIf getKey(54)
 Disp "Y",i
 Return
End
End

  

You may also check:How to resolve the algorithm Thue-Morse step by step in the Objeck programming language
You may also check:How to resolve the algorithm Bitwise operations step by step in the F# programming language
You may also check:How to resolve the algorithm Sorting algorithms/Insertion sort step by step in the SASL programming language
You may also check:How to resolve the algorithm Commatizing numbers step by step in the Python programming language
You may also check:How to resolve the algorithm URL encoding step by step in the AWK programming language