Advertisement
4ndertheker

Dota 2 Battle Pass Level Calculator

May 31st, 2017
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 0.69 KB | None | 0 0
  1. a = 1000;            % start of search interval
  2. b = 1000;           % end of search interval
  3. lvls = [24,11,5]; % possible level steps in reverse order
  4. for n = (a:b)
  5.   res = [0,0,0];
  6.   found=false;
  7.   for x = (floor(n/lvls(1)):-1:0)
  8.     for y = (floor(n/lvls(2)):-1:0)
  9.       for z = (floor(n/lvls(3)):-1:0)
  10.         if (dot([x,y,z], lvls) == n)
  11.           res = [x,y,z];
  12.           found = true;
  13.           break;
  14.         end
  15.       end
  16.       if (found) break; end
  17.     end
  18.     if (found) break; end
  19.   end
  20.   display('-----');
  21.   display(n);
  22.   if (found)
  23.     display(res);
  24.     display('cost (in EUR):')
  25.     display(dot([8.95,4.50,2.25],res))
  26.   else
  27.     display("Nothing found");
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement