Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JS Bin</title>
  6. </head>
  7. <body>
  8.  
  9. <script id="jsbin-javascript">
  10. var bookname = [
  11. 'Gen',50,
  12. 'Ex',40,
  13. 'Lev',27,
  14. 'Num',36,
  15. 'Deut',34,
  16. 'Josh',24,
  17. 'Judg',21,
  18. 'Ruth',4,
  19. '1 Sam',31,
  20. '2 Sam',24,
  21. '1 Kin',22,
  22. '2 Kin',25,
  23. '1 Chr',29,
  24. '2 Chr',36,
  25. 'Ezra',10,
  26. 'Neh',13,
  27. 'Esth',10,
  28. 'Job',42,
  29. 'Ps',150,
  30. 'Prov',31,
  31. 'Eccl',12,
  32. 'Song',8,
  33. 'Is',66,
  34. 'Jer',52,
  35. 'Lam',5,
  36. 'Ezek',48,
  37. 'Dan',12,
  38. 'Hos',14,
  39. 'Joel',3,
  40. 'Amos',9,
  41. 'Obad',1,
  42. 'Jon',4,
  43. 'Mic',7,
  44. 'Nah',3,
  45. 'Hab',3,
  46. 'Zeph',3,
  47. 'Hag',2,
  48. 'Zech',14,
  49. 'Mal',4,
  50. 'Matt',28,
  51. 'Mark',16,
  52. 'Luke',24,
  53. 'John',21,
  54. 'Acts',28,
  55. 'Rom',16,
  56. '1 Cor',16,
  57. '2 Cor',13,
  58. 'Gal',6,
  59. 'Eph',6,
  60. 'Phil',4,
  61. 'Col',4,
  62. '1 Thess',5,
  63. '2 Thess',3,
  64. '1 Tim',6,
  65. '2 Tim',4,
  66. 'Titus',3,
  67. 'Philem',1,
  68. 'Heb',13,
  69. 'James',5,
  70. '1 Pet',5,
  71. '2 Pet',3,
  72. '1 John',5,
  73. '2 John',1,
  74. '3 John',1,
  75. 'Jude',1,
  76. 'Rev',22
  77. ];
  78.  
  79. console.log(bookname);
  80. var bar=[];
  81. var rindex = [];
  82. for(i=0; i< bookname.length; i+=2){
  83. rindex[bookname[i]] = i/2;
  84. temp = new Array(bookname[i+1]);
  85. for (j=0; j< temp.length; j++){ temp[j]= false;}
  86. bar[bookname[i]] = temp;
  87. }
  88.  
  89. for (key in bar){
  90. console.debug(key);
  91. }
  92. bar['Gen'][0]= true;
  93. console.log(bar['Gen']);
  94. console.debug(rindex['Rev']);
  95. </script>
  96.  
  97.  
  98.  
  99. <script id="jsbin-source-javascript" type="text/javascript">
  100.  
  101. var bookname = [
  102. 'Gen',50,
  103. 'Ex',40,
  104. 'Lev',27,
  105. 'Num',36,
  106. 'Deut',34,
  107. 'Josh',24,
  108. 'Judg',21,
  109. 'Ruth',4,
  110. '1 Sam',31,
  111. '2 Sam',24,
  112. '1 Kin',22,
  113. '2 Kin',25,
  114. '1 Chr',29,
  115. '2 Chr',36,
  116. 'Ezra',10,
  117. 'Neh',13,
  118. 'Esth',10,
  119. 'Job',42,
  120. 'Ps',150,
  121. 'Prov',31,
  122. 'Eccl',12,
  123. 'Song',8,
  124. 'Is',66,
  125. 'Jer',52,
  126. 'Lam',5,
  127. 'Ezek',48,
  128. 'Dan',12,
  129. 'Hos',14,
  130. 'Joel',3,
  131. 'Amos',9,
  132. 'Obad',1,
  133. 'Jon',4,
  134. 'Mic',7,
  135. 'Nah',3,
  136. 'Hab',3,
  137. 'Zeph',3,
  138. 'Hag',2,
  139. 'Zech',14,
  140. 'Mal',4,
  141. 'Matt',28,
  142. 'Mark',16,
  143. 'Luke',24,
  144. 'John',21,
  145. 'Acts',28,
  146. 'Rom',16,
  147. '1 Cor',16,
  148. '2 Cor',13,
  149. 'Gal',6,
  150. 'Eph',6,
  151. 'Phil',4,
  152. 'Col',4,
  153. '1 Thess',5,
  154. '2 Thess',3,
  155. '1 Tim',6,
  156. '2 Tim',4,
  157. 'Titus',3,
  158. 'Philem',1,
  159. 'Heb',13,
  160. 'James',5,
  161. '1 Pet',5,
  162. '2 Pet',3,
  163. '1 John',5,
  164. '2 John',1,
  165. '3 John',1,
  166. 'Jude',1,
  167. 'Rev',22
  168. ];
  169.  
  170. console.log(bookname);
  171. var bar=[];
  172. var rindex = [];
  173. for(i=0; i< bookname.length; i+=2){
  174. rindex[bookname[i]] = i/2;
  175. temp = new Array(bookname[i+1]);
  176. for (j=0; j< temp.length; j++){ temp[j]= false;}
  177. bar[bookname[i]] = temp;
  178. }
  179.  
  180. for (key in bar){
  181. console.debug(key);
  182. }
  183. bar['Gen'][0]= true;
  184. console.log(bar['Gen']);
  185. console.debug(rindex['Rev']);
  186.  
  187. </script></body>
  188. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement