-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFootball.squares.R
More file actions
47 lines (33 loc) · 822 Bytes
/
Football.squares.R
File metadata and controls
47 lines (33 loc) · 822 Bytes
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
rm(list=ls())
grid<- matrix(nrow=10, ncol=10)
colnames(grid)<-sample(0:9)
rownames(grid)<-sample(0:9)
grid<- as.data.frame(grid)
people<- c("Greg", "Eric", "Luke", "Bryan", "Colin")
n.name<- length(people)
math<-floor(100/n.name)
zip <- 1
for(sss in 1:length(people)){
if(zip == 1){
people.one<- c(rep(people[sss], math))
} else{
sample<- c(rep(people[sss], math))
people.one <- c(people.one, sample)
}
zip <- zip + 1
}
counter <- 1
for (iii in 1:20000)
{
dims.1<- sample(0:9, 1)
dims.2<- sample(0:9, 1)
row.fill<- paste(dims.1[1])
col.fill <- paste(dims.2[1])
if (is.na(grid[row.fill, col.fill])==TRUE){
grid[row.fill, col.fill] <- print(people.one[counter])
counter<- counter + 1
} else {
grid[row.fill, col.fill] <- grid[row.fill, col.fill]
}
}
print(grid)