No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GetCombinatoricHash.b93 665B

12345678910111213141516171819202122232425262728293031323334353637
  1. v
  2. > "!!!"** 0\v v\-1 <
  3. v+55:<>\1>9*\:|
  4. >%\:#^|#/+55\$<
  5. >$ #\>#<>\# :#+_+ .@
  6. Calculates a combinatoric hash value (the digit order is ignored).
  7. hash = 9^1 * amountOf(0)
  8. + 9^2 * amountOf(1)
  9. + 9^3 * amountOf(2)
  10. + 9^4 * amountOf(3)
  11. + ...
  12. (stack) -> (stack)
  13. uses no [get] or [put]
  14. long GetCubeHash(long value)
  15. {
  16. long sum = 0;
  17. while (value > 0)
  18. {
  19. sum += (long)Math.Pow((long)9, (1 + value%10));
  20. value /= 10;
  21. }
  22. return sum;
  23. }