R/hlp.R

Defines functions cnt_holes

# Numărul de biți '0' aflați între biți '1' ("ferestre")
cnt_holes <- function(sb) { # sb: șablonul binar al orelor profesorului
    bits <- which(bitwAnd(sb, h2bin) > 0) # rangurile biților '1'
    n <- length(bits)
    bits[n] - bits[1] + 1 - n
}

Try the hours2lessons package in your browser

Any scripts or data that you put into this service are public.

hours2lessons documentation built on June 10, 2025, 9:14 a.m.