This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Game of Life, by Vadim Vinichenko https://github.com/vvinichenko | |
# I've pasted his 2 functions here with no experiment at the bottom in order to be able to source this code | |
# straight from R like this: | |
# source("http://raw.github.com/gist/1899814/881e5f92c9413a5e1800c8a274d177982d796a8c/life2.r") | |
# that line loads the 2 functions automatically. Experiment Gist to follow | |
shiftMatrix <- function(mx, dr, dc) { | |
#Shift the matrix by dr (delta r) rows and dc columns | |
#by adding e.g. dr rows of zeros and removing dr rows from the other side | |