Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.86 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta charset="utf-8">
  5.     </head>
  6.     <body>
  7.         <script>
  8.             function dictionary(tab){
  9.                 var novbroj= 0;
  10.                 dict = Object ();
  11.                 var vrednost = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];
  12.                 var kluc = [0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F'];
  13.                 for(i=0; i<vrednost.length; i++){
  14.                    dict.insert(kluc[i],vrednost[i]);
  15.                }
  16.                var broj = 0;
  17.                for(i=0, tab[i]!=-1; i++){
  18.                    broj++;
  19.                }
  20.                for(i=0;tab[i]!=-1; i++){
  21.                    novbroj = novbroj + dict.lookup(tab[i])*Math.pow(16,broj-1);
  22.                    broj--;
  23.                }
  24.                
  25.  
  26.            }
  27.        </script>
  28.     </body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement