Learn R Programming

cursr (version 0.1.0)

Cursor and Terminal Manipulation

Description

A toolbox for developing applications, games, simulations, or agent-based models in the R terminal. Included functions allow users to move the cursor around the terminal screen, change text colors and attributes, clear the screen, hide and show the cursor, map key presses to functions, draw shapes and curves, among others. Most functionalities require users to be in a terminal (not the R GUI).

Copy Link

Version

Install

install.packages('cursr')

Monthly Downloads

207

Version

0.1.0

License

MIT + file LICENSE

Maintainer

Chris Mann

Last Published

January 11th, 2021

Functions in cursr (0.1.0)

color_pair

Create Background & Foreground Color Combination
clear

Clear Text
box_at

Draw Box
attr_on

Attributes On
bg_off

Turn Off Background Color
attr_off

Attributes Off
color_off

Turn Off Colors in Terminal
bg_on

Turn On Background Color
Sym

Unicode Symbols
draw_arc

Draw an Arc
draw_bezier

Draw a Bezier Curve
fill_rect

Draw a Filled-In Rectangle
hline_at

Draw Horizontal Line
erase

Erase Text
draw_shape

Draw a Shape
path_fill

Fill In Path
fill_ellipse

Draw a Filled-In Ellipse
path_ellipse

Ellipse Path
hline

Horizontal Line
draw_ray

Draw a Ray
draw_ellipse

Draw Ellipse
draw_circle

Draw a Circle
fg_on

Turn On Foreground Color
fill_circle

Draw a Filled-In Circle
style

Add Color & Attributes to a Character
in.term

Determine whether in Terminal
draw_path

Draw Path
draw_lerp

Draw a Line
path_bezier

Bezier Curve Path
path_rect

Rectangle Path
load_cursor

Load Cursor
path_circle

Path of a Circle
path_shape

Path along a Shape
getkpl

Loop a Keypress
grid_mat

Create a Character Grid Matrix
draw_fn

Draw a Function
fill_shape

Draw a Filled-In Shape
draw_rect

Draw a Rectangle
term_dim

Determine Terminal Size
fg_off

Turn Off Foreground Color
example_luckynumber

Example Program From Vignette
mv_to

Move Cursor to Specified Location
grid_at

Draw a Character Grid Matrix
mv_col

Move Cursor to Column
hide_cursor

Hide Cursor
path_arc

Arc Path
make_fg

Create Foreground Color
make_bg

Create Background Color
repch

Repeat a Character
wrkpl

Echo Keypress to Screen in a Loop
reset

Reset Console Style
getkp

Get Keypress
mv

Move Cursor
make_style

Create Color & Attribute Style
path_fn

Function Path
path_intersection

Intersection between Two Paths
path_ray

Ray Path
wrchat

Write Character to Terminal at Specified Location
path_lerp

Linear Interpolation Path
vline

Vertical Line
vline_at

Draw Vertical Line
wrkp

Echo Keypress to Screen
wrapup

Return Screen to Blank State
wr

Write String to Terminal
mv_row

Move Cursor to Row
show_cursor

Show Cursor
wrch

Write Character to Terminal
save_cursor

Save Cursor Position
wrat

Write At a Specific Location