Computer Games Written in R

These computer games were written by Marek Hlavac [personal website], currently a doctoral student at Harvard University.

Hangman
My adaptation of the classic paper and pencil guessing game [wikipedia]:

Hangman for R



DOWNLOAD:
The game consists of two files: an .R source file, and an .Rdata database of words to be guessed, and their categories.

You can download the two files separately here:

hangman.R
[download]
hangman.Rdata [download]

Alternatively, you can download [this .zip archive], which contains both files.

In-game commands:
new.game()     begins a new game of hangman
guess(x)          guesses a letter 'x' from the alphabet, e.g.: guess("b")

Note: When you run the .R file, please make sure your working directory contains hangman.Rdata. You can do this by using R's setwd() command.
Comments