Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
automat komorkowy
#tworzymy nową funkcję, w której ustalamy warunki x1,x2,x3 dla naszej reguły i to co zwraca w przypadku prawdy. Tutaj 190 rule190 <- function(x1,x2,x3) { if(x1=="x" && x2=="x" && x3=="x") { return("x"); } if(x1=="x" && x2=="x" && x3==" ") { return(" "); } if(x1=="x" && x2==" " && x3=="x") { return("x"); } if(x1=="x" && x2==" " && x3==" ") { return("x"); } if(x1==" " && x2=="x" && x3=="x") { return("x"); } if(x1==" " && x2=="x" && x3==" ") { return("x"); } else if(x1==" " && x2==" " && x3=="x") { return("x"); } if(x1==" " && x2==" " && x3==" ") { return(" "); } } #tworzymy macierz o rozmiarach 31x31 ca <- matrix(rep(" ",31),ncol=31); #tu cos wypełniamy x ? ca[ceiling(31/2)] <- "x"; for(i in 2:31){ row <-rep(" ",31); for(j in 1:31){ if(j==1){ row[j] <- rule190(ca[i-1,31],ca[i-1,1],ca[i-1,2] ); } if(j==31){ row[j] <- rule190(ca[i-1,30],ca[i-1,31],ca[i-1,1] ); } if(j>1 && j<31){ row[j] <- rule190(ca[i-1,j-1],ca[i-1,j],ca[i-1,j+1] ); } } ca <- rbind(ca, row); } for(i in 1:31){ cat(ca[i,], "\n") }
run
|
edit
|
history
|
help
0
Multiple linear regression modals
28-09-2020Int-poli-inter
Gab1A(resumido)
matrix
R
Grad-sistema
ECO Stat
direct_assignment
26-08-2020AjusteCurvab
14-09-2020GRam