Learn R Programming

twenty48 (version 0.2.1)

play_2048: Play 2048 in the console

Description

Interact with the game by typing commands into the console and pressing enter.

Usage

play_2048(size = 4, dynamic = rstudioapi::isAvailable())

resume_2048()

Value

Generates an interactive game of 2048 in the console.

Arguments

size

An integer giving the grid's dimensions. Defaults to 4, which generates a 4-by-4 grid.

dynamic

If dynamic is TRUE, commands can be input without pressing enter, creating a more seamless game experience. Note that dynamic commands currently only work in RStudio.

Examples

Run this code
play_2048()
play_2048(size = 5)

Run the code above in your browser using DataLab