task_url
stringlengths
30
116
task_name
stringlengths
2
86
task_description
stringlengths
0
14.4k
language_url
stringlengths
2
53
language_name
stringlengths
1
52
code
stringlengths
0
61.9k
http://rosettacode.org/wiki/Ternary_logic
Ternary logic
This page uses content from Wikipedia. The original article was at Ternary logic. The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on variance) In logic, a three-valued logic (also trivalent, ternary, or trinary...
#Ada
Ada
package Logic is type Ternary is (True, Unknown, False);   -- logic functions function "and"(Left, Right: Ternary) return Ternary; function "or"(Left, Right: Ternary) return Ternary; function "not"(T: Ternary) return Ternary; function Equivalent(Left, Right: Ternary) return Ternary; function Impli...
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#ACL2
ACL2
(cw "£")
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#Action.21
Action!
PROC Main() BYTE CHBAS=$02F4 ;Character Base Register   CHBAS=$CC ;set the international character set Position(2,2) Put(8) ;print the GBP currency sign RETURN
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#Ada
Ada
with Ada.Text_IO; use Ada.Text_IO; with Ada.Characters.Latin_1;   procedure Pound is begin Put(Ada.Characters.Latin_1.Pound_Sign); end Pound;
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#Arturo
Arturo
print "£"
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#AWK
AWK
BEGIN { print "£" }
http://rosettacode.org/wiki/Text_processing/1
Text processing/1
This task has been flagged for clarification. Code on this page in its current state may be flagged incorrect once this task has been clarified. See this page's Talk page for discussion. Often data is produced by one program, in the wrong format for later use by another program or person. In these situations another pr...
#AutoHotkey
AutoHotkey
# Author AlephX Aug 17 2011   SetFormat, float, 4.2 SetFormat, FloatFast, 4.2   data = %A_scriptdir%\readings.txt result = %A_scriptdir%\results.txt totvalid := 0 totsum := 0 totavg:= 0   Loop, Read, %data%, %result% { sum := 0 Valid := 0 Couples := 0 Lines := A_Index Loop, parse, A_LoopReadLine, %A_Tab% { ...
http://rosettacode.org/wiki/Terminal_control/Positional_read
Terminal control/Positional read
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, r...
#Ksh
Ksh
  #!/bin/ksh   # Determine the character displayed on the screen at column 3, row 6 and # store that character in a variable. # # Use a group of functions "shellcurses"   # # Variables: # FPATH="/usr/local/functions/shellcurses/"   rst="�[0m" red="�[31m" whi="�[37m"   integer row=${1:-6} col=${2:-3} # Allow command l...
http://rosettacode.org/wiki/Terminal_control/Positional_read
Terminal control/Positional read
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, r...
#Nim
Nim
import random, sequtils, strutils import ncurses   randomize()   let win = initscr() assert not win.isNil, "Unable to initialize."   for y in 0..9: mvaddstr(y.cint, 0, newSeqWith(10, sample({'0'..'9', 'a'..'z'})).join())   let row = rand(9).cint let col = rand(9).cint let ch = win.mvwinch(row, col)   mvaddstr(row, co...
http://rosettacode.org/wiki/Terminal_control/Positional_read
Terminal control/Positional read
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, r...
#Perl
Perl
# 20200917 added Perl programming solution   use strict; use warnings;   use Curses;   initscr or die;   my $win = Curses->new;   foreach my $row (0..9) { $win->addstr( $row , 0, join('', map { chr(int(rand(50)) + 41) } (0..9))) };   my $icol = 3 - 1; my $irow = 6 - 1;   my $ch = $win->inch($irow,$icol);   $win->add...
http://rosettacode.org/wiki/The_ISAAC_Cipher
The ISAAC Cipher
ISAAC is a cryptographically secure pseudo-random number generator (CSPRNG) and stream cipher. It was developed by Bob Jenkins from 1993 (http://burtleburtle.net/bob/rand/isaac.html) and placed in the Public Domain. ISAAC is fast - especially when optimised - and portable to most architectures in nearly all programming...
#Haskell
Haskell
import Data.Array (Array, (!), (//), array, elems) import Data.Word (Word, Word32) import Data.Bits (shift, xor) import Data.Char (toUpper) import Data.List (unfoldr) import Numeric (showHex)   type IArray = Array Word32 Word32   data IsaacState = IState { randrsl :: IArray , randcnt :: Word32 , mm :: IArray , ...
http://rosettacode.org/wiki/Test_integerness
Test integerness
Mathematically, the integers Z are included in the rational numbers Q, which are included in the real numbers R, which can be generalized to the complex numbers C. This means that each of those larger sets, and the data types used to represent them, include some integers. Task[edit] Given a rational, real, or co...
#Haskell
Haskell
import Data.Decimal import Data.Ratio import Data.Complex
http://rosettacode.org/wiki/Test_integerness
Test integerness
Mathematically, the integers Z are included in the rational numbers Q, which are included in the real numbers R, which can be generalized to the complex numbers C. This means that each of those larger sets, and the data types used to represent them, include some integers. Task[edit] Given a rational, real, or co...
#J
J
isInt =: (= <.) *. (= {.@+.)
http://rosettacode.org/wiki/Text_processing/Max_licenses_in_use
Text processing/Max licenses in use
A company currently pays a fixed sum for the use of a particular licensed software package.   In determining if it has a good deal it decides to calculate its maximum use of the software from its license management log file. Assume the software's licensing daemon faithfully records a checkout event when a copy of the ...
#OCaml
OCaml
let () = let out = ref 0 in let max_out = ref(-1) in let max_times = ref [] in   let ic = open_in "mlijobs.txt" in try while true do let line = input_line ic in let io, date, n = Scanf.sscanf line "License %3[IN OUT] %_c %19[0-9/:_] for job %d" (fun io date n -> (io, date, n)) ...
http://rosettacode.org/wiki/Test_a_function
Test a function
Task Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in Palindrome. If your language does not have a testing specific library well known to the language's community then state this or omit the language.
#FreeBASIC
FreeBASIC
  Sub StrReverse(Byref text As String) Dim As Integer x, lt = Len(text) For x = 0 To lt Shr 1 - 1 Swap text[x], text[lt - x - 1] Next x   End Sub   Sub Replace(Byref T As String, Byref I As String, Byref S As String, Byval A As Integer = 1) Var p = Instr(A, T, I), li = Len(I), ls = Len(S) : If l...
http://rosettacode.org/wiki/Text_processing/2
Text processing/2
The following task concerns data that came from a pollution monitoring station with twenty-four instruments monitoring twenty-four aspects of pollution in the air. Periodically a record is added to the file, each record being a line of 49 fields separated by white-space, which can be one or more space or tab characters...
#Sidef
Sidef
var good_records = 0; var dates = Hash();   ARGF.each { |line| var m = /^(\d\d\d\d-\d\d-\d\d)((?:\h+\d+\.\d+\h+-?\d+){24})\s*$/.match(line); m || (warn "Bad format at line #{$.}"; next); dates{m[0]} := 0 ++; var i = 0; m[1].words.all{|n| i++.is_even || (n.to_num >= 1) } && ++good_records; }   say "#...
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#Objeck
Objeck
7->As(Char)->PrintLine();
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#PARI.2FGP
PARI/GP
\\ Ringing the terminal bell. \\ 8/14/2016 aev Strchr(7) \\ press <Enter>
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#Pascal
Pascal
print "\a";
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#Perl
Perl
print "\a";
http://rosettacode.org/wiki/The_Twelve_Days_of_Christmas
The Twelve Days of Christmas
Task Write a program that outputs the lyrics of the Christmas carol The Twelve Days of Christmas. The lyrics can be found here. (You must reproduce the words in the correct order, but case, format, and punctuation are left to your discretion.) Other tasks related to string operations: Metrics Array length Stri...
#AutoHotkey
AutoHotkey
nth := ["first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth"] lines := ["A partridge in a pear tree." ,"Two turtle doves and" ,"Three french hens" ,"Four calling birds" ,"Five golden rings" ,"Six geese a-laying" ,"Seven swans a-swimming" ,"Eight maids a...
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Racket
Racket
  #lang racket   (require racket/system) (define (flash str) (system "tput smcup") (displayln str) (sleep 2) (system "tput rmcup") (void))   (flash "Hello world.")  
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Raku
Raku
print "\e[?1049h\e[H"; say "Alternate buffer!";   for 5,4...1 { print "\rGoing back in: $_"; sleep 1; }   print "\e[?1049l";
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#REXX
REXX
/*REXX program saves the screen contents and also the cursor location, then clears the */ /*──── screen, writes a half screen of ~~~ lines, and then restores the original screen.*/   parse value scrsize() with sd sw . /*determine the size of terminal screen*/ parse value cursor(1,1) with curRow curCol...
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Rust
Rust
use std::io::{stdout, Write}; use std::time::Duration;   fn main() { let mut output = stdout();   print!("\x1b[?1049h\x1b[H"); println!("Alternate screen buffer");   for i in (1..=5).rev() { print!("\rgoing back in {}...", i); output.flush().unwrap(); std::thread::sleep(Duration:...
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#C
C
  /* Please note that curs_set is terminal dependent. */   #include<curses.h> #include<stdio.h>   int main () { printf ("At the end of this line you will see the cursor, process will sleep for 5 seconds."); napms (5000); curs_set (0); printf ("\nAt the end of this line you will NOT see the cursor, proce...
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#C.23
C#
static void Main(string[] args) { Console.Write("At the end of this line you will see the cursor, process will sleep for 5 seconds."); System.Threading.Thread.Sleep(5000); Console.CursorVisible = false; Console.WriteLine(); Console.Write("At the end of this line you will not see the cursor, process ...
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#C.2B.2B
C++
  #include <Windows.h> int main() { bool showCursor = false;   HANDLE std_out = GetStdHandle(STD_OUTPUT_HANDLE); // Get standard output CONSOLE_CURSOR_INFO cursorInfo; // GetConsoleCursorInfo(out, &cursorInfo); // Get cursorinfo from output cursorInfo.bVisible = showCursor; ...
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#BaCon
BaCon
COLOR INVERSE PRINT "a word" COLOR RESET PRINT "a word"
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#BASIC
BASIC
INVERSE:?"ROSETTA";:NORMAL:?" CODE"
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#Befunge
Befunge
0"lamroNm["39*"esrevnIm7["39*>:#,_$@
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#C
C
#include <stdio.h>   int main() { printf("\033[7mReversed\033[m Normal\n");   return 0; }
http://rosettacode.org/wiki/Ternary_logic
Ternary logic
This page uses content from Wikipedia. The original article was at Ternary logic. The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on variance) In logic, a three-valued logic (also trivalent, ternary, or trinary...
#ALGOL_68
ALGOL 68
# -*- coding: utf-8 -*- #   INT trit width = 1, trit base = 3; MODE TRIT = STRUCT(BITS trit); CO FORMAT trit fmt = $c("?","⌈","⌊",#|"~"#)$; CO   # These values treated are as per "Balanced ternary" # # eg true=1, maybe=0, false=-1 # TRIT true =INITTRIT 4r1, maybe=INITTRIT 4r0, false=INITTRIT 4r2;   # Warning: rede...
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#BaCon
BaCon
' Display extended character, pound sterling LET c$ = UTF8$(0xA3) PRINT c$
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#BASIC
BASIC
10 DATA 56,68,4,14,4,4,122,0 20 HGR 30 FOR I = 8192 TO 16383 STEP 1024 40 READ B: POKE I,B: NEXT
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#BBC_BASIC
BBC BASIC
PRINT "£"
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#bc
bc
"£ " quit
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#beeswax
beeswax
_4~9P.P.M}
http://rosettacode.org/wiki/Text_processing/1
Text processing/1
This task has been flagged for clarification. Code on this page in its current state may be flagged incorrect once this task has been clarified. See this page's Talk page for discussion. Often data is produced by one program, in the wrong format for later use by another program or person. In these situations another pr...
#AWK
AWK
BEGIN{ nodata = 0; # Current run of consecutive flags<0 in lines of file nodata_max=-1; # Max consecutive flags<0 in lines of file nodata_maxline="!"; # ... and line number(s) where it occurs } FNR==1 { # Accumulate input file names if(infiles){ infiles = infiles "," infiles } ...
http://rosettacode.org/wiki/Terminal_control/Positional_read
Terminal control/Positional read
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, r...
#Phix
Phix
-- -- demo\rosetta\Positional_read.exw -- ================================ -- without js -- (position, get_screen_char) position(6,1) -- line 6 column 1 (1-based) puts(1,"abcdef") integer {ch,attr} = get_screen_char(6,3) printf(1,"\n\n=>%c",ch) {} = wait_key()
http://rosettacode.org/wiki/Terminal_control/Positional_read
Terminal control/Positional read
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, r...
#PowerShell
PowerShell
  $coord = [System.Management.Automation.Host.Coordinates]::new(3, 6) $rect = [System.Management.Automation.Host.Rectangle]::new($coord, $coord) $char = $Host.UI.RawUI.GetBufferContents($rect).Character  
http://rosettacode.org/wiki/Terminal_control/Positional_read
Terminal control/Positional read
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, r...
#Python
Python
import curses from random import randint     # Print random text in a 10x10 grid stdscr = curses.initscr() for rows in range(10): line = ''.join([chr(randint(41, 90)) for i in range(10)]) stdscr.addstr(line + '\n')   # Read icol = 3 - 1 irow = 6 - 1 ch = stdscr.instr(irow, icol, 1).decode(encoding="utf-8")   # ...
http://rosettacode.org/wiki/The_ISAAC_Cipher
The ISAAC Cipher
ISAAC is a cryptographically secure pseudo-random number generator (CSPRNG) and stream cipher. It was developed by Bob Jenkins from 1993 (http://burtleburtle.net/bob/rand/isaac.html) and placed in the Public Domain. ISAAC is fast - especially when optimised - and portable to most architectures in nearly all programming...
#Haxe
Haxe
  package src ; import haxe.Int32; import haxe.macro.Expr; import haxe.ds.Vector;   typedef Ub4 = Int32;   enum Ciphermode { mEncipher; mDecipher; mNone; }   class Isaac { public var randrsl = new Vector<Ub4>(256); public var randcnt:Ub4;   var mm = new Vector<Ub4>(256); var aa:Ub4 = 0; var bb:Ub4 = 0; var cc...
http://rosettacode.org/wiki/Test_integerness
Test integerness
Mathematically, the integers Z are included in the rational numbers Q, which are included in the real numbers R, which can be generalized to the complex numbers C. This means that each of those larger sets, and the data types used to represent them, include some integers. Task[edit] Given a rational, real, or co...
#Java
Java
import java.math.BigDecimal; import java.util.List;   public class TestIntegerness { private static boolean isLong(double d) { return isLong(d, 0.0); }   private static boolean isLong(double d, double tolerance) { return (d - Math.floor(d)) <= tolerance || (Math.ceil(d) - d) <= tolerance; ...
http://rosettacode.org/wiki/Text_processing/Max_licenses_in_use
Text processing/Max licenses in use
A company currently pays a fixed sum for the use of a particular licensed software package.   In determining if it has a good deal it decides to calculate its maximum use of the software from its license management log file. Assume the software's licensing daemon faithfully records a checkout event when a copy of the ...
#Oz
Oz
declare fun {MaxLicenses Filename ?Times} InUse = {NewCell 0} MaxInUse = {NewCell 0} MaxTimes = {NewCell nil} in for Job in {ReadLines Filename} do case {List.take Job 11} of "License OUT" then InUse := @InUse + 1 if @InUse > @MaxInUse then MaxInUse := @InUse Ma...
http://rosettacode.org/wiki/Test_a_function
Test a function
Task Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in Palindrome. If your language does not have a testing specific library well known to the language's community then state this or omit the language.
#Go
Go
package pal   import "testing"   func TestPals(t *testing.T) { pals := []string{ "", ".", "11", "ere", "ingirumimusnocteetconsumimurigni", } for _, s := range pals { if !IsPal(s) { t.Error("IsPal returned false on palindrome,", s) } } }...
http://rosettacode.org/wiki/Text_processing/2
Text processing/2
The following task concerns data that came from a pollution monitoring station with twenty-four instruments monitoring twenty-four aspects of pollution in the air. Periodically a record is added to the file, each record being a line of 49 fields separated by white-space, which can be one or more space or tab characters...
#Snobol4
Snobol4
* Read text/2   v = array(24) f = array(24) tos = char(9) " " ;* break characters are both tab and space pat1 = break(tos) . dstamp pat2 = span(tos) break(tos) . *v[i] span(tos) (break(tos) | (len(1) rem)) . *f[i] rowcount = 0 hold_dstamp = "" num_bad_rows = 0 num_invalid_rows = 0   in0 row = input :f(endinpu...
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#Phix
Phix
puts(1,"\x07")
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#PHP
PHP
<?php echo "\007";
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#PicoLisp
PicoLisp
(beep)
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#PL.2FI
PL/I
declare bell character (1); unspec (bell) = '00000111'b; put edit (bell) (a);
http://rosettacode.org/wiki/The_Twelve_Days_of_Christmas
The Twelve Days of Christmas
Task Write a program that outputs the lyrics of the Christmas carol The Twelve Days of Christmas. The lyrics can be found here. (You must reproduce the words in the correct order, but case, format, and punctuation are left to your discretion.) Other tasks related to string operations: Metrics Array length Stri...
#AWK
AWK
  # syntax: GAWK -f THE_TWELVE_DAYS_OF_CHRISTMAS.AWK BEGIN { gifts[++i] = "a partridge in a pear tree." gifts[++i] = "two turtle doves, and" gifts[++i] = "three french hens," gifts[++i] = "four calling birds," gifts[++i] = "five golden rings," gifts[++i] = "six geese a-laying," gifts[++i] = ...
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Scala
Scala
print("\033[?1049h\033[H") println("Alternate buffer!")   for (i <- 5 to 0 by -1) { println(s"Going back in: $i") Thread.sleep(1000) }   print("\033[?1049l")
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Sidef
Sidef
print "\e[?1049h\e[H"; say "Alternate buffer!";   3.downto(1).each { |i| say "Going back in: #{i}"; Sys.sleep(1); }   print "\e[?1049l";
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Swift
Swift
  public let CSI = ESC+"[" // Control Sequence Introducer func write(_ text: String...) { for txt in text { write(STDOUT_FILENO, txt, txt.utf8.count) } } write(CSI,"?1049h") // open alternate screen print("Alternate screen buffer\n") for n in (1...5).reversed() { print("Going back in \(n)...") sleep(1) } wr...
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Tcl
Tcl
# A helper to make code more readable proc terminal {args} { exec /usr/bin/tput {*}$args >/dev/tty }   # Save the screen with the "enter_ca_mode" capability, a.k.a. 'smcup' terminal smcup # Some indication to users what is happening... puts "This is the top of a blank screen. Press Return/Enter to continue..." gets...
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#Common_Lisp
Common Lisp
  (defun sh (cmd) #+clisp (shell cmd) #+ecl (si:system cmd) #+sbcl (sb-ext:run-program "/bin/sh" (list "-c" cmd) :input nil :output *standard-output*) #+clozure (ccl:run-program "/bin/sh" (list "-c" cmd) :input nil :output *standard-output*))   (defun show-cursor (x) (if x (sh "tput cvvis") (sh "tput civis"))...
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#FunL
FunL
import time.* import console.*   hide() sleep( 2 Second ) show()
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#Furor
Furor
  cursoroff  
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#Go
Go
package main   import ( "os" "os/exec" "time" )   func main() { tput("civis") // hide time.Sleep(3 * time.Second) tput("cvvis") // show time.Sleep(3 * time.Second) }   func tput(arg string) error { cmd := exec.Command("tput", arg) cmd.Stdout = os.Stdout return cmd.Run() }
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#COBOL
COBOL
IDENTIFICATION DIVISION. PROGRAM-ID. terminal-reverse-video.   PROCEDURE DIVISION. DISPLAY "Reverse-Video" WITH REVERSE-VIDEO DISPLAY "Normal"   GOBACK .
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#Common_Lisp
Common Lisp
(defun reverse-attribute () (with-screen (scr :input-blocking t :input-echoing nil :cursor-visible nil) (add-string scr "Reverse" :attributes '(:reverse)) (add-string scr " Normal" :attributes '()) (refresh scr) (get-char scr)))
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#Forth
Forth
: Reverse #27 emit "[7m" type ; : Normal #27 emit "[m" type ;   : test cr Reverse ." Reverse " cr Normal ." Normal " ; test  
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#FunL
FunL
import console.*   println( "${REVERSED}This is reversed.$RESET This is normal." )
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#Go
Go
package main   import ( "fmt" "os" "os/exec" )   func main() { tput("rev") fmt.Print("Rosetta") tput("sgr0") fmt.Println(" Code") }   func tput(arg string) error { cmd := exec.Command("tput", arg) cmd.Stdout = os.Stdout return cmd.Run() }
http://rosettacode.org/wiki/Terminal_control/Dimensions
Terminal control/Dimensions
Determine the height and width of the terminal, and store this information into variables for subsequent use.
#AArch64_Assembly
AArch64 Assembly
  /* ARM assembly AARCH64 Raspberry PI 3B */ /* program terminalSize64.s */   /*******************************************/ /* Constantes file */ /*******************************************/ /* for this file see task include a file in language AArch64 assembly*/ .include "../includeConstante...
http://rosettacode.org/wiki/Terminal_control/Cursor_positioning
Terminal control/Cursor positioning
Task Move the cursor to column   3,   row   6,   and display the word   "Hello"   (without the quotes),   so that the letter   H   is in column   3   on row   6.
#AArch64_Assembly
AArch64 Assembly
  /* ARM assembly AARCH64 Raspberry PI 3B */ /* program cursorPos64.s */   /*******************************************/ /* Constantes file */ /*******************************************/ /* for this file see task include a file in language AArch64 assembly*/ .include "../includeConstantesAR...
http://rosettacode.org/wiki/Ternary_logic
Ternary logic
This page uses content from Wikipedia. The original article was at Ternary logic. The list of authors can be seen in the page history. As with Rosetta Code, the text of Wikipedia is available under the GNU FDL. (See links for details on variance) In logic, a three-valued logic (also trivalent, ternary, or trinary...
#Arturo
Arturo
vals: @[true maybe false]   loop vals 'v -> print ["NOT" v "=>" not? v] print "" loop vals 'v1 [ loop vals 'v2 -> print [v1 "AND" v2 "=>" and? v1 v2] ] print "" loop vals 'v1 [ loop vals 'v2 -> print [v1 "OR" v2 "=>" or? v1 v2] ] print "" loop vals 'v1 [ loop vals 'v2 -> print [v1...
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#Befunge
Befunge
"| "+,@
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#Bracmat
Bracmat
put$£
http://rosettacode.org/wiki/Terminal_control/Display_an_extended_character
Terminal control/Display an extended character
Task Display an extended (non ASCII) character onto the terminal. Specifically, display a   £   (GBP currency sign).
#C
C
#include <stdio.h>   int main() { puts("£"); puts("\302\243"); /* if your terminal is utf-8 */ return 0; }
http://rosettacode.org/wiki/Text_processing/1
Text processing/1
This task has been flagged for clarification. Code on this page in its current state may be flagged incorrect once this task has been clarified. See this page's Talk page for discussion. Often data is produced by one program, in the wrong format for later use by another program or person. In these situations another pr...
#Batch_File
Batch File
@echo off setlocal ENABLEDELAYEDEXPANSION set maxrun= 0 set maxstart= set maxend= set notok=0 set inputfile=%1 for /F "tokens=1,*" %%i in (%inputfile%) do ( set date=%%i call :processline %%j )   echo\ echo max false: %maxrun% from %maxstart% until %maxend%   goto :EOF   :processline set sum=0000 set count...
http://rosettacode.org/wiki/Terminal_control/Positional_read
Terminal control/Positional read
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, r...
#Racket
Racket
  #lang racket (require ffi/unsafe ffi/unsafe/define) (define-ffi-definer defwin #f) (defwin GetStdHandle (_fun _int -> _pointer)) (defwin ReadConsoleOutputCharacterA (_fun _pointer _pointer _uint _uint [len : (_ptr o _uint)] -> _bool))   (define b (make-bytes 1 32)) (and (ReadConsoleOutputCharacterA (GetStdHandle -1...
http://rosettacode.org/wiki/Terminal_control/Positional_read
Terminal control/Positional read
Determine the character displayed on the screen at column 3, row 6 and store that character in a variable. Note that it is permissible to utilize system or language provided methods or system provided facilities, system maintained records or available buffers or system maintained display records to achieve this task, r...
#Raku
Raku
use NCurses;   # Reference: # https://github.com/azawawi/perl6-ncurses   # Initialize curses window my $win = initscr() or die "Failed to initialize ncurses\n";   # Print random text in a 10x10 grid   for ^10 { mvaddstr($_ , 0, (for ^10 {(41 .. 90).roll.chr}).join )};   # Read   my $icol = 3 - 1; my $irow = 6 - 1;   my...
http://rosettacode.org/wiki/The_ISAAC_Cipher
The ISAAC Cipher
ISAAC is a cryptographically secure pseudo-random number generator (CSPRNG) and stream cipher. It was developed by Bob Jenkins from 1993 (http://burtleburtle.net/bob/rand/isaac.html) and placed in the Public Domain. ISAAC is fast - especially when optimised - and portable to most architectures in nearly all programming...
#Java
Java
import java.io.UnsupportedEncodingException; import java.util.Arrays; import java.util.Random;     public class IsaacRandom extends Random {   private static final long serialVersionUID = 1L;   private final int[] randResult = new int[256]; // output of last generation private int valuesUsed; ...
http://rosettacode.org/wiki/Test_integerness
Test integerness
Mathematically, the integers Z are included in the rational numbers Q, which are included in the real numbers R, which can be generalized to the complex numbers C. This means that each of those larger sets, and the data types used to represent them, include some integers. Task[edit] Given a rational, real, or co...
#jq
jq
def is_integral: if type == "number" then . == floor elif type == "array" then length == 2 and .[1] == 0 and (.[0] | is_integral) else type == "object" and .type == "rational" and .q != 0 and (.q | is_integral) and ((.p / .q) | is_integral) end ;
http://rosettacode.org/wiki/Test_integerness
Test integerness
Mathematically, the integers Z are included in the rational numbers Q, which are included in the real numbers R, which can be generalized to the complex numbers C. This means that each of those larger sets, and the data types used to represent them, include some integers. Task[edit] Given a rational, real, or co...
#Julia
Julia
# v0.6.0   @show isinteger(25.000000) @show isinteger(24.999999) @show isinteger(25.000100) @show isinteger(-2.1e120) @show isinteger(-5e-2) @show isinteger(NaN) @show isinteger(Inf) @show isinteger(complex(5.0, 0.0)) @show isinteger(complex(5, 5))  
http://rosettacode.org/wiki/Text_processing/Max_licenses_in_use
Text processing/Max licenses in use
A company currently pays a fixed sum for the use of a particular licensed software package.   In determining if it has a good deal it decides to calculate its maximum use of the software from its license management log file. Assume the software's licensing daemon faithfully records a checkout event when a copy of the ...
#PARI.2FGP
PARI/GP
license()={ my(v=externstr("type mlijobs.txt"),u,cur,rec,t); for(i=1,#v, u=Vec(v[i]); if(#u>9 && u[9] == "O", if(cur++>rec, rec=cur; t=[v[i]] , if(cur == rec,t=concat(t,[v[i]])) ) , cur-- ...
http://rosettacode.org/wiki/Test_a_function
Test a function
Task Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in Palindrome. If your language does not have a testing specific library well known to the language's community then state this or omit the language.
#Haskell
Haskell
import Test.QuickCheck   isPalindrome :: String -> Bool isPalindrome x = x == reverse x   {- There is no built-in definition of how to generate random characters; here we just specify ASCII characters. Generating strings then automatically follows from the definition of String as list of Char. -} instance Arbitra...
http://rosettacode.org/wiki/Test_a_function
Test a function
Task Using a well-known testing-specific library/module/suite for your language, write some tests for your language's entry in Palindrome. If your language does not have a testing specific library well known to the language's community then state this or omit the language.
#Icon_and_Unicon
Icon and Unicon
procedure main() s := "ablewasiereisawelba" assert{"test1",palindrome(s)} assertFailure{"test2",palindrome(s)} s := "un"||s assert{"test3",palindrome(s)} assertFailure{"test4",palindrome(s)} end   procedure palindrome(s) return s == reverse(s) end   procedure assert(A) if not @A[2] then ...
http://rosettacode.org/wiki/Text_processing/2
Text processing/2
The following task concerns data that came from a pollution monitoring station with twenty-four instruments monitoring twenty-four aspects of pollution in the air. Periodically a record is added to the file, each record being a line of 49 fields separated by white-space, which can be one or more space or tab characters...
#Tcl
Tcl
set data [lrange [split [read [open "readings.txt" "r"]] "\n"] 0 end-1] set total [llength $data] set correct $total set datestamps {}   foreach line $data { set formatOk true set hasAllMeasurements true   set date [lindex $line 0] if {[llength $line] != 49} { set formatOk false } if {![regexp {\d{4...
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#PostScript
PostScript
(\007) print
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#PowerShell
PowerShell
"`a"
http://rosettacode.org/wiki/Terminal_control/Ringing_the_terminal_bell
Terminal control/Ringing the terminal bell
Task 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 usua...
#PureBasic
PureBasic
Print(#BEL$)
http://rosettacode.org/wiki/The_Twelve_Days_of_Christmas
The Twelve Days of Christmas
Task Write a program that outputs the lyrics of the Christmas carol The Twelve Days of Christmas. The lyrics can be found here. (You must reproduce the words in the correct order, but case, format, and punctuation are left to your discretion.) Other tasks related to string operations: Metrics Array length Stri...
#Batch_File
Batch File
:: The Twelve Days of Christmas :: Batch File Implementation   @echo off ::Pseudo-array for Days set "day1=First" set "day2=Second" set "day3=Third" set "day4=Fourth" set "day5=Fifth" set "day6=Sixth" set "day7=Seventh" set "day8=Eighth" set "day9=Nineth" set "day10=Tenth" set "day11=Eleventh" set "day12=Twelveth" ::...
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#UNIX_Shell
UNIX Shell
#!/bin/sh tput smcup # Save the display echo 'Hello' sleep 5 # Wait five seconds tput rmcup # Restore the display
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Wren
Wren
import "io" for Stdout import "timer" for Timer   System.write("\e[?1049h\e[H") System.print("Alternate screen buffer") for (i in 5..1) { var s = (i != 1) ? "s" : "" System.write("\rGoing back in %(i) second%(s)...") Stdout.flush() Timer.sleep(1000) } System.write("\e[?1049l")
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#XPL0
XPL0
include c:\cxpl\codes; \intrinsic 'code' declarations   proc SetPage(P); \Select active display page for video screen int P; int CpuReg; [CpuReg:= GetReg; \access CPU registers CpuReg(0):= $0500 + P; \call BIOS interrupt $10, function 5 SoftInt($10); ]; \SetPage   [SetPage(1); \enable page 1...
http://rosettacode.org/wiki/Terminal_control/Preserve_screen
Terminal control/Preserve screen
Task Clear the screen, output something on the display, and then restore the screen to the preserved state that it was in before the task was carried out. There is no requirement to change the font or kerning in this task, however character decorations and attributes are expected to be preserved.   If the implement...
#Z80_Assembly
Z80 Assembly
org $3000   txt_output: equ $bb5a scr_clear: equ $bc14 wait_char: equ $bb06 scr_get_loc: equ $bc0b scr_set_off: equ $bc05   push bc push de push hl push af   call scr_get_loc ; save this value just in case the push hl ; original screen has been scrolled vertically   ld hl,$c000 ; copy screen ...
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#J
J
smoutput HIDECURSOR usleep(4e6) NB. wait 4 seconds smoutput SHOWCURSOR  
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#Julia
Julia
const ESC = "\u001B" # escape code print("$ESC[?25l") # hide the cursor print("Enter anything, press RETURN: ") # prompt shown input = readline() # but no cursor print("$ESC[0H$ESC[0J$ESC[?25h") # reset, visible again sleep(3) println()  
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#Kotlin
Kotlin
// version 1.1.2   fun main(args: Array<String>) { print("\u001B[?25l") // hide cursor Thread.sleep(2000) // wait 2 seconds before redisplaying cursor print("\u001B[?25h") // display cursor Thread.sleep(2000) // wait 2 more seconds before exiting }
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#Lasso
Lasso
#!/usr/bin/lasso9   local( esc = decode_base64('Gw==') )   // hide the cursor stdout(#esc + '[?25l')   // wait for 4 seconds to give time discover the cursor is gone sleep(4000)   // show the cursor stdout(#esc + '[?25h')   // wait for 4 seconds to give time discover the cursor is back sleep(4000)
http://rosettacode.org/wiki/Terminal_control/Hiding_the_cursor
Terminal control/Hiding the cursor
The task is to hide the cursor and show it again.
#Locomotive_Basic
Locomotive Basic
10 CURSOR 0: REM hide cursor 20 FOR l = 1 TO 2000: REM delay 30 NEXT l 40 CURSOR 1: REM show cursor
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#J
J
   ;:';:,#.*."3,(C.A.)/\/&.:;:' NB. some output beforehand attributes REVERSEVIDEO NB. does as it says 2 o.^:a:0 NB. solve the fixed point equation cos(x) == x attributes OFF NB. no more blinky flashy parseFrench=:;:,#.*."3,(C.A.)/\/&.:;: NB. just kidding! More outp...
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#Julia
Julia
using Crayons.Box   println(WHITE_FG, BLACK_BG, "Normal") println(WHITE_BG, BLACK_FG, "Reversed") println(WHITE_FG, BLACK_BG, "Normal")  
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#Kotlin
Kotlin
// version 1.1.2   fun main(args: Array<String>) { println("\u001B[7mInverse\u001B[m Normal") }
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#Lasso
Lasso
local(esc = decode_base64('Gw=='))   stdout( #esc + '[7m Reversed Video ' + #esc + '[0m Normal Video ')
http://rosettacode.org/wiki/Terminal_control/Inverse_video
Terminal control/Inverse video
Task Display a word in inverse video   (or reverse video)   followed by a word in normal video.
#Mathematica.2FWolfram_Language
Mathematica/Wolfram Language
Run["tput mr"] Run["echo foo"] (* is displayed in reverse mode *) Run["tput me"] Run["echo bar"]
http://rosettacode.org/wiki/Terminal_control/Dimensions
Terminal control/Dimensions
Determine the height and width of the terminal, and store this information into variables for subsequent use.
#Action.21
Action!
PROC Main() BYTE ROWCRS=$0054 ;Current cursor row CARD COLCRS=$0055 ;Current cursor column CARD width BYTE height   Graphics(0) Position(0,0) ;go to the top-left corner Put(28) Put(30) ;go up and left - the bottom-right corner width=COLCRS+1 height=ROWCRS+1   Position(2,1) PrintF("Number of colums...