Skip to main content
added 104 characters in body
Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 141141 135 bytes

function(x,y="I":"A":"O")intToUtf8(matrix(match(el(strsplit(gsub("D","",x),"B"))[-1],paste0(rep(c("",y<-c("I","A","O")):y,e=4),c(y,:"U")))-1,,2,T)%*%16^(1%*%16:0)1)
":"=c

Try it online!Try it online!

Thanks to JayCe for saving 6 bytes!

Using some modular magic is likely to be shorter, but I'm pretty happy with this as a naive first pass.

R, 141 bytes

function(x)intToUtf8(matrix(match(el(strsplit(gsub("D","",x),"B"))[-1],paste0(rep(c("",y<-c("I","A","O")),e=4),c(y,"U")))-1,,2,T)%*%16^(1:0))

Try it online!

Using some modular magic is likely to be shorter, but I'm pretty happy with this as a naive first pass.

R, 141 135 bytes

function(x,y="I":"A":"O")intToUtf8(matrix(match(el(strsplit(gsub("D","",x),"B"))[-1],paste0(rep("":y,e=4),y:"U"))-1,,2,T)%*%16:1)
":"=c

Try it online!

Thanks to JayCe for saving 6 bytes!

Using some modular magic is likely to be shorter, but I'm pretty happy with this as a naive first pass.

Source Link
Giuseppe
  • 28.8k
  • 3
  • 31
  • 105

R, 141 bytes

function(x)intToUtf8(matrix(match(el(strsplit(gsub("D","",x),"B"))[-1],paste0(rep(c("",y<-c("I","A","O")),e=4),c(y,"U")))-1,,2,T)%*%16^(1:0))

Try it online!

Using some modular magic is likely to be shorter, but I'm pretty happy with this as a naive first pass.