Skip to main content

Timeline for Programming with Bits and Bytes

Current License: CC BY-SA 3.0

3 events
when toggle format what by license comment
Apr 20, 2016 at 7:17 comment added plannapus The resulting b=readline();A=rep(0,8);s=strsplit(b,"")[[1]];for(r in s)A=switch(r,"!"=(A+1)%%2,">"=c(0,A)[1:length(A)],"<"=c(A,0)[-1],"@"=c(A[5:8],A[1:4]),A);print(sum(A*(2^(7:0)))) is 167 bytes.
Apr 20, 2016 at 7:08 comment added plannapus All the <- can be replaced by = here, thus reducing the code by 7 bytes. Additionally you might be able to replace the series of if statements by one call to switch (as in A=switch(r,"!"=(A+1)%%2, ...))
Sep 8, 2015 at 13:02 history answered mawir CC BY-SA 3.0