Skip to main content
Save 53 bytes
Source Link
ollien
  • 151
  • 3

Go, 219 217 192 210 209209 156 bytes

Saved 25 bytes thanks to @Lynn! Saved 53 bytes thanks to @ovs!

Had to lose 18 bytes because of a bug with strings with no underscores :(

func p(s string){b:=0;n:=0;r:=g.Index(s,"_");if r==-1{r=0};for=0;for _,c:=range s[0:r]s{if IsLetter(c){x:=0;ifb+=b;if IsUpper(c){x=1};b+=b+x;n++b+=1};if n==5{n=0;s=g;n++;s=g.Replace(s,"_",string('a'+b%32),1(5-n%5);b=0/5)}};Print(g.ToLower(s))}

Try it online!

Go, 219 217 192 210 209 bytes

Saved 25 bytes thanks to @Lynn!

Had to lose 18 bytes because of a bug with strings with no underscores :(

func p(s string){b:=0;n:=0;r:=g.Index(s,"_");if r==-1{r=0};for _,c:=range s[0:r]{if IsLetter(c){x:=0;if IsUpper(c){x=1};b+=b+x;n++};if n==5{n=0;s=g.Replace(s,"_",string('a'+b%32),1);b=0}};Print(g.ToLower(s))}

Try it online!

Go, 219 217 192 210 209 156 bytes

Saved 25 bytes thanks to @Lynn! Saved 53 bytes thanks to @ovs!

Had to lose 18 bytes because of a bug with strings with no underscores :(

func p(s string){b:=0;n:=0;for _,c:=range s{if IsLetter(c){b+=b;if IsUpper(c){b+=1};n++;s=g.Replace(s,"_",string('a'+b%32),(5-n%5)/5)}};Print(g.ToLower(s))}

Try it online!

added 20 characters in body
Source Link
ollien
  • 151
  • 3

Go, 219 217 192 210210 209 bytes

Saved 25 bytes thanks to @Lynn!

Had to lose 18 bytes because of a bug with strings with no underscores :(

func p(s string){b:=0;n:=0;=0;r:=g.Index(s,"_");if forr==-1{r=0};for _,c:=range s[0:g.Index(s,"_")] r]{if IsLetter(c){x:=0;if IsUpper(c){x=1};b+=b+x;n++};if n==5{n=0;s=g.Replace(s,"_",string('a'+b%32),1);b=0}};Print(g.ToLower(s))}

Try it online!Try it online!

Go, 219 217 192 210 bytes

Saved 25 bytes thanks to @Lynn!

Had to lose 18 bytes because of a bug with strings with no underscores :(

func p(s string){b:=0;n:=0; for _,c:=range s[0:g.Index(s,"_")] {if IsLetter(c){x:=0;if IsUpper(c){x=1};b+=b+x;n++};if n==5{n=0;s=g.Replace(s,"_",string('a'+b%32),1);b=0}};Print(g.ToLower(s))}

Try it online!

Go, 219 217 192 210 209 bytes

Saved 25 bytes thanks to @Lynn!

Had to lose 18 bytes because of a bug with strings with no underscores :(

func p(s string){b:=0;n:=0;r:=g.Index(s,"_");if r==-1{r=0};for _,c:=range s[0:r]{if IsLetter(c){x:=0;if IsUpper(c){x=1};b+=b+x;n++};if n==5{n=0;s=g.Replace(s,"_",string('a'+b%32),1);b=0}};Print(g.ToLower(s))}

Try it online!

lost bytes
Source Link
ollien
  • 151
  • 3

Go, 219 217217 192 210 bytes

Saved 25 bytes thanks to @Lynn!

Had to lose 18 bytes because of a bug with strings with no underscores :(

func p(s string){b:=""; n=0;n:=0;for=0; for _,c :=range s[0:g.Index(s,"_")] {if IsLetter(c){x:="0";if=0;if IsUpper(c){x="1"x=1};b+=x;n++;b+=b+x;n++};if n==5{n=0;o,_:=v.ParseInt(b,2,64);s=gn=0;s=g.Replace(s,"_",string('a'+o'a'+b%32),1);b="";b=0}};Print(g.ToLower(s))}

Try it online!Try it online!

Go, 219 217 bytes

func p(s string){b:=""; n:=0;for _,c :=range s[0:g.Index(s,"_")] {if IsLetter(c){x:="0";if IsUpper(c){x="1"};b+=x;n++};if n==5{n=0;o,_:=v.ParseInt(b,2,64);s=g.Replace(s,"_",string('a'+o),1);b=""}};Print(g.ToLower(s))}

Try it online!

Go, 219 217 192 210 bytes

Saved 25 bytes thanks to @Lynn!

Had to lose 18 bytes because of a bug with strings with no underscores :(

func p(s string){b:=0;n:=0; for _,c:=range s[0:g.Index(s,"_")] {if IsLetter(c){x:=0;if IsUpper(c){x=1};b+=b+x;n++};if n==5{n=0;s=g.Replace(s,"_",string('a'+b%32),1);b=0}};Print(g.ToLower(s))}

Try it online!

Drop 2 bytes
Source Link
ollien
  • 151
  • 3
Loading
Saved two bytes
Source Link
ollien
  • 151
  • 3
Loading
Source Link
ollien
  • 151
  • 3
Loading