X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-core%2Fsrc%2Fio%2Fintcode.rs;h=a8437e8afeb7663ab0a98fada140eb3e108ad964;hb=9da33f04bbd89f18942bbafc6d135b5d3f102953;hp=1c52d81efb3cad72fabce801a7937262eb57cdb0;hpb=e243ceb4d694cc08767ad70027bb6963f4cefea3;p=nihav.git diff --git a/nihav-core/src/io/intcode.rs b/nihav-core/src/io/intcode.rs index 1c52d81..a8437e8 100644 --- a/nihav-core/src/io/intcode.rs +++ b/nihav-core/src/io/intcode.rs @@ -7,6 +7,8 @@ pub enum UintCodeType { Unary012, Unary210, LimitedUnary(u32, u32), + LimitedZeroes(u32), + LimitedOnes(u32), Golomb(u8), Rice(u8), Gamma, @@ -101,6 +103,8 @@ impl<'a> IntCodeReader for BitReader<'a> { match t { UintCodeType::UnaryOnes => read_unary(self, 0), UintCodeType::UnaryZeroes => read_unary(self, 1), + UintCodeType::LimitedZeroes(len) => read_unary_lim(self, len, 1), + UintCodeType::LimitedOnes(len) => read_unary_lim(self, len, 0), UintCodeType::LimitedUnary(len, term) => read_unary_lim(self, len, term), UintCodeType::Unary012 => read_unary_lim(self, 2, 0), UintCodeType::Unary210 => read_unary210(self),