Sha256: dcb37e2c3ac029cf44fc68e17af601b972e9f3884d514d0de2c71a136560218e

Contents?: true

Size: 399 Bytes

Versions: 219

Compression:

Stored size: 399 Bytes

Contents

handshake <- function(n) {
  
  # 1 = wink
  # 10 = double blink
  # 100 = close your eyes
  # 1000 = jump
  # 10000 = reverse
  actions <- c("wink", "double blink", "close your eyes", "jump")
  
  bin <- intToBits(n)
  
  events <- c()
  
  for (i in 1:4) {
    if (bin[i] > 0) {
      events <- c(events, actions[i])
    }
  }
  
  if (bin[5] > 0) {
    events <- rev(events)
  }
  
  events
  
}

Version data entries

219 entries across 219 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.179 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.178 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.177 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.176 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.175 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.174 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.173 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.172 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.171 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.170 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.169 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.167 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.166 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.165 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.164 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.163 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.162 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.161 tracks/r/exercises/secret-handshake/example.R
trackler-2.2.1.160 tracks/r/exercises/secret-handshake/example.R