add1 = function(x){
pos = 1
while(x[pos] == 2){
x[pos] = 0
pos = pos + 1
}
x[pos] = x[pos] + 1
x
}
x = rep(0,5)
(x <- add1(x))
V1 = c(0,0,0,0,0)
V2 = c(0,0,0,0,0)
add1.alt = function(V1, V2){
pos = 1
while(V2[pos] == 1){
V2[pos] = 0
pos = pos + 1
}
if(V1[pos] == 0){
V1[pos] = 1
}else{
V1[pos] = 0
V2[pos] = 1
}
list(V1,V2)
}
V1 = c(0,0,0,0,0)
V2 = c(0,0,0,0,0)
######
(res <- add1.alt(V1,V2))
V1 = res[[1]]
V2 = res[[2]]
1-1
c(1,-1, 0, 0, 0)
c(1, 0,-1, 0, 0)
c(1, 0, 0,-1, 0)
c(1, 0, 0, 0,-1)
c(0, 1,-1, 0, 0)
c(0, 1, 0,-1, 0)
c(0, 1, 0, 0,-1)
c(0, 0, 1,-1, 0)
c(0, 0, 1, 0,-1)
c(0, 0, 0, 1,-1)
2-1
c(1, 1,-1, 0, 0)
c(1, 1, 0,-1, 0)
c(1, 1, 0, 0,-1)
c(0, 1, 1,-1, 0)
c(0, 1, 1, 0,-1)
c(0, 0, 1, 1,-1)
3-1
c(1, 1, 1,-1, 0)
c(1, 1, 1, 0,-1)
c(0, 1, 1, 1,-1)
4-1
c(1, 1, 1, 1,-1)
1-2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.