Learn R Programming

Rbeast (version 0.9.5)

tetris: The Tetris game in R

Description

A poor man's implementation of the Tetris game in R. Yes, you are right again: it has nothing to do with time series decomposition, changepoint detection, and time series segmentation. Its only remote connection to Rbeast is that this is a practice script I wrote to learn R graphics for implementing Rbeast.

Usage

tetris(height=25, width=14, speed=0.6)

Value

Instructions:

  • Left arrow to move left.

  • Right arrow to move right.

  • Up arrow to rotate.

  • Down arrow to speed up.

  • Space key to sink to the bottom.

Arguments

height

integer; number of rows of the mine grid along the vertical direction.

width

integer; number of columns of the mine grid along the horizontal direction.

speed

numeric; a time interval between 0.05 and 2 seconds, specifying how fast the tetriminos moves down. The smaller, the faster.

References

  1. Zhao, K., Wulder, M.A., Hu, T., Bright, R., Wu, Q., Qin, H., Li, Y., Toman, E., Mallick, B., Zhang, X. and Brown, M., 2019. Detecting change-point, trend, and seasonality in satellite time series data to track abrupt changes and nonlinear dynamics: A Bayesian ensemble algorithm. Remote Sensing of Environment, 232, p.111181 (the beast algorithm paper).

  2. Zhao, K., Valle, D., Popescu, S., Zhang, X. and Mallick, B., 2013. Hyperspectral remote sensing of plant biochemistry using Bayesian model averaging with variable and band selection. Remote Sensing of Environment, 132, pp.102-119 (the Bayesian MCMC scheme used in beast).

  3. Hu, T., Toman, E.M., Chen, G., Shao, G., Zhou, Y., Li, Y., Zhao, K. and Feng, Y., 2021. Mapping fine-scale human disturbances in a working landscape with Landsat time series on Google Earth Engine. ISPRS Journal of Photogrammetry and Remote Sensing, 176, pp.250-261(a beast application paper).

See Also

beast, beast.irreg, beast123, minesweeper, geeLandsat

Examples

Run this code
# \donttest{

 library(Rbeast)
 
 if (FALSE) {
 tetris() 
 
 # A  field of size 20x25 with blocks moving down every 0.1 sec.
 tetris(20,25,0.1)  
 }
 
# }

Run the code above in your browser using DataLab