-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
55 lines (42 loc) · 1.29 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# inkr
<!-- badges: start -->
<!-- badges: end -->
This is an R port of inkle's [ink](https://github.com/inkle/ink), a scripting language for writing interactive narrative. The port is not written in native R but instead provides an interface to [inkjs](https://github.com/y-lohse/inkjs) due to its ease of use and feature completeness.
## Installation
You can install the released version of inkr from [github]() with:
```r
remotes::install_github("zamorarr/inkr")
```
## Example
Playing a JSON version of an Ink story in R:
```r
library(inkr)
storyfile <- system.file("examples", "the-intercept.json", package = "inkr")
play_story(storyfile)
## They are keeping me waiting.
##
## [1] Hut 14
##
## Choice: 1
## ---------------------------------
## Hut 14. The door was locked after I sat down.
## I don't even have a pen to do any work. There's a copy of the morning's intercept in my pocket, but staring at the jumbled letters will only drive me mad.
## I am not a machine, whatever they say about me.
##
## [1] Think
## [2] Plan
## [3] Wait
## Choice:
```