Skip to main content
Commonmark migration
Source Link

#Ruby, 114 113 106 bytes

Ruby, 114 113 106 bytes

Because Ruby doesn't have 32-bit arithmetic, the extra mod operations caused it to almost tie with Javascript anyways despite the other byte-saving operations Ruby has...

  • (-1 byte from extra semicolon)
  • (-7 bytes from trimming out unnecessary mod operations and shifting stuff around)

Try it online!

->v,w,a,b,c,d{s=0
32.times{s+=0x9e3779b9;v+=w*16+a^w+s^w/32+b;v%=m=2**32;w+=v*16+c^v+s^v/32+d;w%=m}
[v,w]}

#Ruby, 114 113 106 bytes

Because Ruby doesn't have 32-bit arithmetic, the extra mod operations caused it to almost tie with Javascript anyways despite the other byte-saving operations Ruby has...

  • (-1 byte from extra semicolon)
  • (-7 bytes from trimming out unnecessary mod operations and shifting stuff around)

Try it online!

->v,w,a,b,c,d{s=0
32.times{s+=0x9e3779b9;v+=w*16+a^w+s^w/32+b;v%=m=2**32;w+=v*16+c^v+s^v/32+d;w%=m}
[v,w]}

Ruby, 114 113 106 bytes

Because Ruby doesn't have 32-bit arithmetic, the extra mod operations caused it to almost tie with Javascript anyways despite the other byte-saving operations Ruby has...

  • (-1 byte from extra semicolon)
  • (-7 bytes from trimming out unnecessary mod operations and shifting stuff around)

Try it online!

->v,w,a,b,c,d{s=0
32.times{s+=0x9e3779b9;v+=w*16+a^w+s^w/32+b;v%=m=2**32;w+=v*16+c^v+s^v/32+d;w%=m}
[v,w]}
added 93 characters in body
Source Link
Value Ink
  • 12.6k
  • 1
  • 17
  • 42

#Ruby, 114 113113 106 bytes

Because Ruby doesn't have 32-bit arithmetic, the extra mod operations caused it to almost tie with Javascript anyways despite the other byte-saving operations Ruby has...

(-1 byte from extra semicolon)

  • (-1 byte from extra semicolon)
  • (-7 bytes from trimming out unnecessary mod operations and shifting stuff around)

Try it online!

->v,w,a,b,c,d{s=0;m=2**32s=0
32.times{s+=0x9e3779b9;s%=m;v+=w*16+a^w+s^ws+=0x9e3779b9;v+=w*16+a^w+s^w/32+b;v%=m;w+=v*16+c^v+s^v32+b;v%=m=2**32;w+=v*16+c^v+s^v/32+d;w%=m}
[v,w]}

#Ruby, 114 113 bytes

Because Ruby doesn't have 32-bit arithmetic, the extra mod operations caused it to almost tie with Javascript anyways despite the other byte-saving operations Ruby has...

(-1 byte from extra semicolon)

Try it online!

->v,w,a,b,c,d{s=0;m=2**32
32.times{s+=0x9e3779b9;s%=m;v+=w*16+a^w+s^w/32+b;v%=m;w+=v*16+c^v+s^v/32+d;w%=m}
[v,w]}

#Ruby, 114 113 106 bytes

Because Ruby doesn't have 32-bit arithmetic, the extra mod operations caused it to almost tie with Javascript anyways despite the other byte-saving operations Ruby has...

  • (-1 byte from extra semicolon)
  • (-7 bytes from trimming out unnecessary mod operations and shifting stuff around)

Try it online!

->v,w,a,b,c,d{s=0
32.times{s+=0x9e3779b9;v+=w*16+a^w+s^w/32+b;v%=m=2**32;w+=v*16+c^v+s^v/32+d;w%=m}
[v,w]}
Source Link
Value Ink
  • 12.6k
  • 1
  • 17
  • 42

#Ruby, 114 113 bytes

Because Ruby doesn't have 32-bit arithmetic, the extra mod operations caused it to almost tie with Javascript anyways despite the other byte-saving operations Ruby has...

(-1 byte from extra semicolon)

Try it online!

->v,w,a,b,c,d{s=0;m=2**32
32.times{s+=0x9e3779b9;s%=m;v+=w*16+a^w+s^w/32+b;v%=m;w+=v*16+c^v+s^v/32+d;w%=m}
[v,w]}