euler-manager 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +37 -0
  6. data/Rakefile +1 -0
  7. data/bin/euler +145 -0
  8. data/data/answers.yml +456 -0
  9. data/data/problems/1.yml +7 -0
  10. data/data/problems/10.yml +8 -0
  11. data/data/problems/100.yml +13 -0
  12. data/data/problems/101.yml +49 -0
  13. data/data/problems/102.yml +16 -0
  14. data/data/problems/103.yml +26 -0
  15. data/data/problems/104.yml +15 -0
  16. data/data/problems/105.yml +21 -0
  17. data/data/problems/106.yml +19 -0
  18. data/data/problems/107.yml +20 -0
  19. data/data/problems/108.yml +32 -0
  20. data/data/problems/109.yml +33 -0
  21. data/data/problems/11.yml +33 -0
  22. data/data/problems/110.yml +19 -0
  23. data/data/problems/111.yml +21 -0
  24. data/data/problems/112.yml +15 -0
  25. data/data/problems/113.yml +13 -0
  26. data/data/problems/114.yml +106 -0
  27. data/data/problems/115.yml +17 -0
  28. data/data/problems/116.yml +76 -0
  29. data/data/problems/117.yml +82 -0
  30. data/data/problems/118.yml +9 -0
  31. data/data/problems/119.yml +11 -0
  32. data/data/problems/12.yml +13 -0
  33. data/data/problems/120.yml +17 -0
  34. data/data/problems/121.yml +15 -0
  35. data/data/problems/122.yml +42 -0
  36. data/data/problems/123.yml +13 -0
  37. data/data/problems/124.yml +58 -0
  38. data/data/problems/125.yml +12 -0
  39. data/data/problems/126.yml +17 -0
  40. data/data/problems/127.yml +31 -0
  41. data/data/problems/128.yml +18 -0
  42. data/data/problems/129.yml +12 -0
  43. data/data/problems/13.yml +6 -0
  44. data/data/problems/130.yml +19 -0
  45. data/data/problems/131.yml +12 -0
  46. data/data/problems/132.yml +12 -0
  47. data/data/problems/133.yml +13 -0
  48. data/data/problems/134.yml +19 -0
  49. data/data/problems/135.yml +20 -0
  50. data/data/problems/136.yml +17 -0
  51. data/data/problems/137.yml +36 -0
  52. data/data/problems/138.yml +20 -0
  53. data/data/problems/139.yml +15 -0
  54. data/data/problems/14.yml +28 -0
  55. data/data/problems/140.yml +29 -0
  56. data/data/problems/141.yml +14 -0
  57. data/data/problems/142.yml +14 -0
  58. data/data/problems/143.yml +20 -0
  59. data/data/problems/144.yml +30 -0
  60. data/data/problems/145.yml +11 -0
  61. data/data/problems/146.yml +9 -0
  62. data/data/problems/147.yml +14 -0
  63. data/data/problems/148.yml +11 -0
  64. data/data/problems/149.yml +41 -0
  65. data/data/problems/15.yml +11 -0
  66. data/data/problems/150.yml +34 -0
  67. data/data/problems/151.yml +19 -0
  68. data/data/problems/152.yml +12 -0
  69. data/data/problems/153.yml +57 -0
  70. data/data/problems/154.yml +16 -0
  71. data/data/problems/155.yml +22 -0
  72. data/data/problems/156.yml +27 -0
  73. data/data/problems/157.yml +34 -0
  74. data/data/problems/158.yml +19 -0
  75. data/data/problems/159.yml +29 -0
  76. data/data/problems/16.yml +6 -0
  77. data/data/problems/160.yml +8 -0
  78. data/data/problems/161.yml +15 -0
  79. data/data/problems/162.yml +15 -0
  80. data/data/problems/163.yml +19 -0
  81. data/data/problems/164.yml +8 -0
  82. data/data/problems/165.yml +32 -0
  83. data/data/problems/166.yml +15 -0
  84. data/data/problems/167.yml +17 -0
  85. data/data/problems/168.yml +13 -0
  86. data/data/problems/169.yml +10 -0
  87. data/data/problems/17.yml +11 -0
  88. data/data/problems/170.yml +16 -0
  89. data/data/problems/171.yml +13 -0
  90. data/data/problems/172.yml +6 -0
  91. data/data/problems/173.yml +12 -0
  92. data/data/problems/174.yml +20 -0
  93. data/data/problems/175.yml +21 -0
  94. data/data/problems/176.yml +9 -0
  95. data/data/problems/177.yml +16 -0
  96. data/data/problems/178.yml +9 -0
  97. data/data/problems/179.yml +10 -0
  98. data/data/problems/18.yml +21 -0
  99. data/data/problems/180.yml +34 -0
  100. data/data/problems/181.yml +7 -0
  101. data/data/problems/182.yml +35 -0
  102. data/data/problems/183.yml +27 -0
  103. data/data/problems/184.yml +18 -0
  104. data/data/problems/185.yml +22 -0
  105. data/data/problems/186.yml +28 -0
  106. data/data/problems/187.yml +16 -0
  107. data/data/problems/188.yml +10 -0
  108. data/data/problems/189.yml +15 -0
  109. data/data/problems/19.yml +12 -0
  110. data/data/problems/190.yml +13 -0
  111. data/data/problems/191.yml +15 -0
  112. data/data/problems/192.yml +27 -0
  113. data/data/problems/193.yml +7 -0
  114. data/data/problems/194.yml +18 -0
  115. data/data/problems/195.yml +13 -0
  116. data/data/problems/196.yml +25 -0
  117. data/data/problems/197.yml +16 -0
  118. data/data/problems/198.yml +21 -0
  119. data/data/problems/199.yml +14 -0
  120. data/data/problems/2.yml +10 -0
  121. data/data/problems/20.yml +22 -0
  122. data/data/problems/200.yml +12 -0
  123. data/data/problems/201.yml +20 -0
  124. data/data/problems/202.yml +14 -0
  125. data/data/problems/203.yml +21 -0
  126. data/data/problems/204.yml +11 -0
  127. data/data/problems/205.yml +10 -0
  128. data/data/problems/206.yml +6 -0
  129. data/data/problems/207.yml +20 -0
  130. data/data/problems/208.yml +12 -0
  131. data/data/problems/209.yml +27 -0
  132. data/data/problems/21.yml +13 -0
  133. data/data/problems/210.yml +10 -0
  134. data/data/problems/211.yml +11 -0
  135. data/data/problems/212.yml +41 -0
  136. data/data/problems/213.yml +11 -0
  137. data/data/problems/214.yml +15 -0
  138. data/data/problems/215.yml +18 -0
  139. data/data/problems/216.yml +14 -0
  140. data/data/problems/217.yml +27 -0
  141. data/data/problems/218.yml +14 -0
  142. data/data/problems/219.yml +19 -0
  143. data/data/problems/22.yml +13 -0
  144. data/data/problems/220.yml +24 -0
  145. data/data/problems/221.yml +20 -0
  146. data/data/problems/222.yml +7 -0
  147. data/data/problems/223.yml +12 -0
  148. data/data/problems/224.yml +12 -0
  149. data/data/problems/225.yml +11 -0
  150. data/data/problems/226.yml +16 -0
  151. data/data/problems/227.yml +13 -0
  152. data/data/problems/228.yml +23 -0
  153. data/data/problems/229.yml +30 -0
  154. data/data/problems/23.yml +19 -0
  155. data/data/problems/230.yml +23 -0
  156. data/data/problems/231.yml +16 -0
  157. data/data/problems/232.yml +14 -0
  158. data/data/problems/233.yml +10 -0
  159. data/data/problems/234.yml +23 -0
  160. data/data/problems/235.yml +9 -0
  161. data/data/problems/236.yml +32 -0
  162. data/data/problems/237.yml +13 -0
  163. data/data/problems/238.yml +42 -0
  164. data/data/problems/239.yml +9 -0
  165. data/data/problems/24.yml +10 -0
  166. data/data/problems/240.yml +11 -0
  167. data/data/problems/241.yml +17 -0
  168. data/data/problems/242.yml +16 -0
  169. data/data/problems/243.yml +19 -0
  170. data/data/problems/244.yml +32 -0
  171. data/data/problems/245.yml +36 -0
  172. data/data/problems/246.yml +17 -0
  173. data/data/problems/247.yml +21 -0
  174. data/data/problems/248.yml +6 -0
  175. data/data/problems/249.yml +7 -0
  176. data/data/problems/25.yml +15 -0
  177. data/data/problems/250.yml +7 -0
  178. data/data/problems/251.yml +13 -0
  179. data/data/problems/252.yml +31 -0
  180. data/data/problems/253.yml +36 -0
  181. data/data/problems/254.yml +21 -0
  182. data/data/problems/255.yml +59 -0
  183. data/data/problems/256.yml +43 -0
  184. data/data/problems/257.yml +18 -0
  185. data/data/problems/258.yml +13 -0
  186. data/data/problems/259.yml +16 -0
  187. data/data/problems/26.yml +11 -0
  188. data/data/problems/260.yml +30 -0
  189. data/data/problems/261.yml +19 -0
  190. data/data/problems/262.yml +20 -0
  191. data/data/problems/263.yml +19 -0
  192. data/data/problems/264.yml +20 -0
  193. data/data/problems/265.yml +16 -0
  194. data/data/problems/266.yml +10 -0
  195. data/data/problems/267.yml +14 -0
  196. data/data/problems/268.yml +8 -0
  197. data/data/problems/269.yml +15 -0
  198. data/data/problems/27.yml +25 -0
  199. data/data/problems/270.yml +17 -0
  200. data/data/problems/271.yml +13 -0
  201. data/data/problems/272.yml +15 -0
  202. data/data/problems/273.yml +21 -0
  203. data/data/problems/274.yml +23 -0
  204. data/data/problems/275.yml +19 -0
  205. data/data/problems/276.yml +11 -0
  206. data/data/problems/277.yml +24 -0
  207. data/data/problems/278.yml +32 -0
  208. data/data/problems/279.yml +6 -0
  209. data/data/problems/28.yml +17 -0
  210. data/data/problems/280.yml +13 -0
  211. data/data/problems/281.yml +17 -0
  212. data/data/problems/282.yml +10 -0
  213. data/data/problems/283.yml +11 -0
  214. data/data/problems/284.yml +22 -0
  215. data/data/problems/285.yml +17 -0
  216. data/data/problems/286.yml +12 -0
  217. data/data/problems/287.yml +36 -0
  218. data/data/problems/288.yml +15 -0
  219. data/data/problems/289.yml +19 -0
  220. data/data/problems/29.yml +24 -0
  221. data/data/problems/290.yml +8 -0
  222. data/data/problems/291.yml +10 -0
  223. data/data/problems/292.yml +13 -0
  224. data/data/problems/293.yml +15 -0
  225. data/data/problems/294.yml +10 -0
  226. data/data/problems/295.yml +26 -0
  227. data/data/problems/296.yml +15 -0
  228. data/data/problems/297.yml +19 -0
  229. data/data/problems/298.yml +46 -0
  230. data/data/problems/299.yml +31 -0
  231. data/data/problems/3.yml +7 -0
  232. data/data/problems/30.yml +12 -0
  233. data/data/problems/300.yml +24 -0
  234. data/data/problems/301.yml +25 -0
  235. data/data/problems/302.yml +18 -0
  236. data/data/problems/303.yml +11 -0
  237. data/data/problems/304.yml +19 -0
  238. data/data/problems/305.yml +14 -0
  239. data/data/problems/306.yml +29 -0
  240. data/data/problems/307.yml +12 -0
  241. data/data/problems/308.yml +34 -0
  242. data/data/problems/309.yml +17 -0
  243. data/data/problems/31.yml +18 -0
  244. data/data/problems/310.yml +19 -0
  245. data/data/problems/311.yml +21 -0
  246. data/data/problems/312.yml +15 -0
  247. data/data/problems/313.yml +17 -0
  248. data/data/problems/314.yml +29 -0
  249. data/data/problems/315.yml +49 -0
  250. data/data/problems/316.yml +25 -0
  251. data/data/problems/317.yml +11 -0
  252. data/data/problems/318.yml +61 -0
  253. data/data/problems/319.yml +23 -0
  254. data/data/problems/32.yml +14 -0
  255. data/data/problems/320.yml +12 -0
  256. data/data/problems/321.yml +18 -0
  257. data/data/problems/322.yml +12 -0
  258. data/data/problems/323.yml +19 -0
  259. data/data/problems/324.yml +17 -0
  260. data/data/problems/325.yml +25 -0
  261. data/data/problems/326.yml +12 -0
  262. data/data/problems/327.yml +39 -0
  263. data/data/problems/328.yml +36 -0
  264. data/data/problems/329.yml +17 -0
  265. data/data/problems/33.yml +13 -0
  266. data/data/problems/330.yml +40 -0
  267. data/data/problems/331.yml +28 -0
  268. data/data/problems/332.yml +16 -0
  269. data/data/problems/333.yml +25 -0
  270. data/data/problems/334.yml +39 -0
  271. data/data/problems/335.yml +16 -0
  272. data/data/problems/336.yml +24 -0
  273. data/data/problems/337.yml +15 -0
  274. data/data/problems/338.yml +41 -0
  275. data/data/problems/339.yml +17 -0
  276. data/data/problems/34.yml +7 -0
  277. data/data/problems/340.yml +14 -0
  278. data/data/problems/341.yml +18 -0
  279. data/data/problems/342.yml +17 -0
  280. data/data/problems/343.yml +29 -0
  281. data/data/problems/344.yml +21 -0
  282. data/data/problems/345.yml +26 -0
  283. data/data/problems/346.yml +11 -0
  284. data/data/problems/347.yml +16 -0
  285. data/data/problems/348.yml +12 -0
  286. data/data/problems/349.yml +13 -0
  287. data/data/problems/35.yml +8 -0
  288. data/data/problems/350.yml +18 -0
  289. data/data/problems/351.yml +13 -0
  290. data/data/problems/352.yml +49 -0
  291. data/data/problems/353.yml +25 -0
  292. data/data/problems/354.yml +16 -0
  293. data/data/problems/355.yml +8 -0
  294. data/data/problems/356.yml +10 -0
  295. data/data/problems/357.yml +9 -0
  296. data/data/problems/358.yml +31 -0
  297. data/data/problems/359.yml +26 -0
  298. data/data/problems/36.yml +8 -0
  299. data/data/problems/360.yml +12 -0
  300. data/data/problems/361.yml +20 -0
  301. data/data/problems/362.yml +32 -0
  302. data/data/problems/363.yml +33 -0
  303. data/data/problems/364.yml +15 -0
  304. data/data/problems/365.yml +17 -0
  305. data/data/problems/366.yml +26 -0
  306. data/data/problems/367.yml +20 -0
  307. data/data/problems/368.yml +39 -0
  308. data/data/problems/369.yml +15 -0
  309. data/data/problems/37.yml +10 -0
  310. data/data/problems/370.yml +16 -0
  311. data/data/problems/371.yml +13 -0
  312. data/data/problems/372.yml +16 -0
  313. data/data/problems/373.yml +10 -0
  314. data/data/problems/374.yml +25 -0
  315. data/data/problems/375.yml +23 -0
  316. data/data/problems/376.yml +25 -0
  317. data/data/problems/377.yml +11 -0
  318. data/data/problems/378.yml +15 -0
  319. data/data/problems/379.yml +15 -0
  320. data/data/problems/38.yml +18 -0
  321. data/data/problems/380.yml +22 -0
  322. data/data/problems/381.yml +21 -0
  323. data/data/problems/382.yml +23 -0
  324. data/data/problems/383.yml +13 -0
  325. data/data/problems/384.yml +28 -0
  326. data/data/problems/385.yml +22 -0
  327. data/data/problems/386.yml +16 -0
  328. data/data/problems/387.yml +19 -0
  329. data/data/problems/388.yml +12 -0
  330. data/data/problems/389.yml +12 -0
  331. data/data/problems/39.yml +10 -0
  332. data/data/problems/390.yml +18 -0
  333. data/data/problems/391.yml +29 -0
  334. data/data/problems/392.yml +22 -0
  335. data/data/problems/393.yml +12 -0
  336. data/data/problems/394.yml +22 -0
  337. data/data/problems/395.yml +19 -0
  338. data/data/problems/396.yml +28 -0
  339. data/data/problems/397.yml +20 -0
  340. data/data/problems/398.yml +13 -0
  341. data/data/problems/399.yml +22 -0
  342. data/data/problems/4.yml +8 -0
  343. data/data/problems/40.yml +18 -0
  344. data/data/problems/400.yml +18 -0
  345. data/data/problems/401.yml +11 -0
  346. data/data/problems/402.yml +25 -0
  347. data/data/problems/403.yml +19 -0
  348. data/data/problems/404.yml +21 -0
  349. data/data/problems/405.yml +15 -0
  350. data/data/problems/406.yml +46 -0
  351. data/data/problems/407.yml +20 -0
  352. data/data/problems/408.yml +14 -0
  353. data/data/problems/409.yml +12 -0
  354. data/data/problems/41.yml +8 -0
  355. data/data/problems/410.yml +19 -0
  356. data/data/problems/411.yml +23 -0
  357. data/data/problems/412.yml +19 -0
  358. data/data/problems/413.yml +13 -0
  359. data/data/problems/414.yml +40 -0
  360. data/data/problems/415.yml +19 -0
  361. data/data/problems/416.yml +13 -0
  362. data/data/problems/417.yml +21 -0
  363. data/data/problems/418.yml +17 -0
  364. data/data/problems/419.yml +22 -0
  365. data/data/problems/42.yml +14 -0
  366. data/data/problems/420.yml +13 -0
  367. data/data/problems/421.yml +29 -0
  368. data/data/problems/422.yml +22 -0
  369. data/data/problems/423.yml +22 -0
  370. data/data/problems/424.yml +37 -0
  371. data/data/problems/425.yml +16 -0
  372. data/data/problems/426.yml +29 -0
  373. data/data/problems/427.yml +18 -0
  374. data/data/problems/428.yml +32 -0
  375. data/data/problems/429.yml +10 -0
  376. data/data/problems/43.yml +17 -0
  377. data/data/problems/430.yml +20 -0
  378. data/data/problems/431.yml +33 -0
  379. data/data/problems/432.yml +13 -0
  380. data/data/problems/433.yml +18 -0
  381. data/data/problems/434.yml +32 -0
  382. data/data/problems/435.yml +21 -0
  383. data/data/problems/436.yml +21 -0
  384. data/data/problems/437.yml +22 -0
  385. data/data/problems/438.yml +29 -0
  386. data/data/problems/439.yml +17 -0
  387. data/data/problems/44.yml +16 -0
  388. data/data/problems/440.yml +21 -0
  389. data/data/problems/441.yml +23 -0
  390. data/data/problems/442.yml +9 -0
  391. data/data/problems/443.yml +13 -0
  392. data/data/problems/444.yml +28 -0
  393. data/data/problems/445.yml +37 -0
  394. data/data/problems/446.yml +29 -0
  395. data/data/problems/447.yml +31 -0
  396. data/data/problems/448.yml +14 -0
  397. data/data/problems/449.yml +17 -0
  398. data/data/problems/45.yml +15 -0
  399. data/data/problems/450.yml +26 -0
  400. data/data/problems/451.yml +15 -0
  401. data/data/problems/452.yml +8 -0
  402. data/data/problems/453.yml +16 -0
  403. data/data/problems/454.yml +17 -0
  404. data/data/problems/455.yml +16 -0
  405. data/data/problems/456.yml +15 -0
  406. data/data/problems/46.yml +18 -0
  407. data/data/problems/47.yml +21 -0
  408. data/data/problems/48.yml +7 -0
  409. data/data/problems/49.yml +10 -0
  410. data/data/problems/5.yml +8 -0
  411. data/data/problems/50.yml +10 -0
  412. data/data/problems/51.yml +15 -0
  413. data/data/problems/52.yml +8 -0
  414. data/data/problems/53.yml +28 -0
  415. data/data/problems/54.yml +43 -0
  416. data/data/problems/55.yml +21 -0
  417. data/data/problems/56.yml +11 -0
  418. data/data/problems/57.yml +15 -0
  419. data/data/problems/58.yml +22 -0
  420. data/data/problems/59.yml +23 -0
  421. data/data/problems/6.yml +13 -0
  422. data/data/problems/60.yml +10 -0
  423. data/data/problems/61.yml +30 -0
  424. data/data/problems/62.yml +9 -0
  425. data/data/problems/63.yml +7 -0
  426. data/data/problems/64.yml +130 -0
  427. data/data/problems/65.yml +62 -0
  428. data/data/problems/66.yml +27 -0
  429. data/data/problems/67.yml +17 -0
  430. data/data/problems/68.yml +23 -0
  431. data/data/problems/69.yml +14 -0
  432. data/data/problems/7.yml +6 -0
  433. data/data/problems/70.yml +16 -0
  434. data/data/problems/71.yml +17 -0
  435. data/data/problems/72.yml +16 -0
  436. data/data/problems/73.yml +16 -0
  437. data/data/problems/74.yml +41 -0
  438. data/data/problems/75.yml +16 -0
  439. data/data/problems/76.yml +8 -0
  440. data/data/problems/77.yml +8 -0
  441. data/data/problems/78.yml +12 -0
  442. data/data/problems/79.yml +11 -0
  443. data/data/problems/8.yml +6 -0
  444. data/data/problems/80.yml +11 -0
  445. data/data/problems/81.yml +19 -0
  446. data/data/problems/82.yml +19 -0
  447. data/data/problems/83.yml +23 -0
  448. data/data/problems/84.yml +63 -0
  449. data/data/problems/85.yml +9 -0
  450. data/data/problems/86.yml +15 -0
  451. data/data/problems/87.yml +12 -0
  452. data/data/problems/88.yml +53 -0
  453. data/data/problems/89.yml +18 -0
  454. data/data/problems/9.yml +13 -0
  455. data/data/problems/90.yml +23 -0
  456. data/data/problems/91.yml +19 -0
  457. data/data/problems/92.yml +29 -0
  458. data/data/problems/93.yml +21 -0
  459. data/data/problems/94.yml +11 -0
  460. data/data/problems/95.yml +23 -0
  461. data/data/problems/96.yml +46 -0
  462. data/data/problems/97.yml +14 -0
  463. data/data/problems/98.yml +16 -0
  464. data/data/problems/99.yml +16 -0
  465. data/euler-manager.gemspec +31 -0
  466. data/euler-manager.sublime-project +12 -0
  467. data/example/1/README.md +6 -0
  468. data/example/1/ruby/1.rb +5 -0
  469. data/example/1/scala/1.scala +9 -0
  470. data/example/2/README.md +9 -0
  471. data/example/2/python/2.py +5 -0
  472. data/example/2/python/euler.py +0 -0
  473. data/example/Eulerfile.rb +87 -0
  474. data/example/README.md +26 -0
  475. data/example/lib/euler.py +0 -0
  476. data/example/lib/euler.rb +0 -0
  477. data/example/lib/euler.scala +5 -0
  478. data/lib/euler.rb +190 -0
  479. data/lib/euler/errors.rb +7 -0
  480. data/lib/euler/languages.rb +12 -0
  481. data/lib/euler/languages/coffeescript.rb +25 -0
  482. data/lib/euler/languages/javascript.rb +25 -0
  483. data/lib/euler/languages/python.rb +27 -0
  484. data/lib/euler/languages/ruby.rb +25 -0
  485. data/lib/euler/languages/scala.rb +27 -0
  486. data/lib/euler/languages/templates/coffeescript.coffee +5 -0
  487. data/lib/euler/languages/templates/javascript.js +5 -0
  488. data/lib/euler/languages/templates/python.py +5 -0
  489. data/lib/euler/languages/templates/ruby.rb +5 -0
  490. data/lib/euler/languages/templates/scala.scala +9 -0
  491. data/lib/euler/problem.rb +60 -0
  492. data/lib/euler/solution.rb +98 -0
  493. data/lib/euler/version.rb +3 -0
  494. data/scripts/update_problems +68 -0
  495. data/spec/euler/problem_spec.rb +5 -0
  496. data/spec/euler/solution_spec.rb +69 -0
  497. data/spec/euler_spec.rb +27 -0
  498. data/spec/spec_helper.rb +3 -0
  499. metadata +644 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a66f937a7db77dee0b93afb1901cc8e7552e5e50
4
+ data.tar.gz: 02a5b19312496652bec335e2416b49501d0a4cfc
5
+ SHA512:
6
+ metadata.gz: d4e35c6b4693742fcf8628aeaaf2d71a60ff2a30fc1facc41b3601d1351afea8fe99f1b1f64255b8c2ca32d4d81ee1e9939f2369c9efdcde0cfb8c96b4973e2e
7
+ data.tar.gz: 1701fc64ca3ab0361d9bdf9e15014f79f1d438c458a6e73f037f01302ef31ca2567a6dcb95be4cd563b8b788315bb45dbe4758ff0215d2209b3706b94b11c4c5
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.sublime-workspace
19
+
20
+ *.pyc
21
+ *.class
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in euler.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 William Yaworsky
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Euler Manager
2
+
3
+ Manage [Project Euler](https://projecteuler.net/) problems form the command line.
4
+
5
+ ## Usage
6
+
7
+ Euler manager has 4 commands:
8
+
9
+ $ euler new [problem_id] [language]
10
+
11
+ `new` initializes a solution.
12
+
13
+ $ euler desc [problem_id]
14
+
15
+ `desc` shows a problem's prompt.
16
+
17
+ $ euler run [problem_id] [language]
18
+
19
+ `run` executes a solution.
20
+
21
+ $ euler test [problem_id] [language]
22
+
23
+ `test` runs a solution to see if it is correct.
24
+
25
+ If you do not pass a problem id and language to the `desc`, `run`, or `test`
26
+ commands Euler manager will use the directory it was invoked from to try to
27
+ guess which problem id and language to use. So if you want to run the ruby
28
+ solution for problem number 1 then you can just run `$ euelr run` from `1/ruby`
29
+ (by default) and Euler manager will run the ruby solution for problem 1.
30
+
31
+ ## Configuring Euler Manager
32
+
33
+ TODO
34
+
35
+ ### Registering Additional Languages
36
+
37
+ TODO
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/euler ADDED
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+
5
+ require 'commander/import'
6
+ require 'colorize'
7
+
8
+ require_relative '../lib/euler'
9
+
10
+ program :version, Euler::VERSION
11
+ program :description, 'Project Euler solution manager.'
12
+
13
+ command :run do |c|
14
+ c.syntax = 'euler run [problem_id] [language]'
15
+ c.summary = 'Runs a solution.'
16
+ c.description = c.summary
17
+ c.example 'Runs the ruby solution for problem #1', 'euler run 1 ruby'
18
+ c.action do |args, options|
19
+ problem_id, language = Euler.params_from_dir_or_args args
20
+ solution = Euler::Solution.new(problem_id, language)
21
+
22
+ puts
23
+ puts solution.run
24
+ puts
25
+ end
26
+ end
27
+
28
+ command :test do |c|
29
+ c.syntax = 'euler test [problem_id] [language]'
30
+ c.summary = 'Tests a solution.'
31
+ c.description = c.summary
32
+ c.example 'Tests the ruby solution for problem #1', 'euler test 1 ruby'
33
+ c.action do |args, options|
34
+ problem_id, language = Euler.params_from_dir_or_args args
35
+
36
+ solution = Euler::Solution.new(problem_id, language)
37
+ problem = solution.problem
38
+
39
+ correct = solution.correct?
40
+
41
+ puts
42
+ puts "Testing #{solution.language} solution to"
43
+ puts "##{problem.id} - #{problem.name}".bold
44
+ puts
45
+ puts "Expected: " + problem.answer.cyan
46
+ puts "Result: " + solution.result.cyan
47
+ puts
48
+
49
+ if solution.correct?
50
+ puts " PASS ".bold.on_green
51
+ else
52
+ puts " FAIL ".bold.on_red
53
+ end
54
+
55
+ puts
56
+ end
57
+ end
58
+
59
+ command :test_all do |c|
60
+ c.syntax = 'euler test_all'
61
+ c.summary = 'Tests all solutions.'
62
+ c.description = c.summary
63
+ c.action do |args, options|
64
+ solutions = Euler::Solution.all
65
+
66
+ failures = []
67
+
68
+ puts
69
+ puts "Testing all solutions."
70
+ puts
71
+ Euler::Solution.all.each do |solution|
72
+ if solution.correct?
73
+ print ".".green
74
+ else
75
+ failures << solution
76
+ print "X".bold.red
77
+ end
78
+ end
79
+ puts
80
+ puts
81
+ if failures.empty?
82
+ print " ".bold.on_green
83
+ print "All TESTS PASSED".bold.on_green
84
+ puts " ".bold.on_green
85
+ else
86
+ print " ".bold.on_red
87
+ print "THERE WERE #{failures.length} FAILURE#{failures.length != 1 ? 'S' : ''}".bold.on_red
88
+ puts " ".bold.on_red
89
+ failures.each do |failure|
90
+ puts
91
+ puts "#{failure.problem.to_s} (#{failure.language})".bold
92
+ puts "Expected: " + failure.problem.answer.cyan
93
+ puts "Result: " + failure.result.cyan
94
+ end
95
+ end
96
+ puts
97
+
98
+ # fail if not failures.empty?
99
+ end
100
+ end
101
+
102
+ command :new do |c|
103
+ c.syntax = 'euler new [problem_id] [language]'
104
+ c.summary = 'Initialize a solution.'
105
+ c.description = c.summary
106
+ c.example 'Initialize a ruby solution for problem #1', 'euler new 1 ruby'
107
+ c.action do |args, options|
108
+ problem_id = args.shift
109
+ language = args.shift
110
+
111
+ solution = Euler::Solution.new(problem_id, language)
112
+ problem = solution.problem
113
+
114
+ solution.init
115
+
116
+ puts
117
+ puts "Done initializing empty #{solution.language} solution for"
118
+ puts "##{problem.id} - #{problem.name}".bold
119
+ puts
120
+ end
121
+ end
122
+
123
+ command :desc do |c|
124
+ c.syntax = 'euler desc [problem_id]'
125
+ c.summary = 'View the description for a problem.'
126
+ c.description = c.summary
127
+ c.example 'View the for description for problem #1', 'euler desc 1'
128
+ c.action do |args, options|
129
+ problem_id, language = Euler.params_from_dir_or_args args
130
+
131
+ problem = Euler::Problem.find(problem_id)
132
+
133
+ puts
134
+ puts "##{problem.id} - #{problem.name}".bold
135
+ puts
136
+ puts problem.content
137
+ puts
138
+ if problem.has_answer?
139
+ puts "The solution to this problem is: " + problem.answer.bold
140
+ else
141
+ puts "This problem does not have an answer yet.".on_red
142
+ end
143
+ puts
144
+ end
145
+ end
data/data/answers.yml ADDED
@@ -0,0 +1,456 @@
1
+ 1: 233168
2
+ 2: 4613732
3
+ 3: 6857
4
+ 4: 906609
5
+ 5: 232792560
6
+ 6: 25164150
7
+ 7: 104743
8
+ 8: 40824
9
+ 9: 31875000
10
+ 10: 142913828922
11
+ 11: 70600674
12
+ 12: 76576500
13
+ 13: 5537376230
14
+ 14: 837799
15
+ 15: 137846528820
16
+ 16: 1366
17
+ 17: 21124
18
+ 18: 1074
19
+ 19: 171
20
+ 20: 648
21
+ 21: 31626
22
+ 22: 871198282
23
+ 23: 4179871
24
+ 24: 2783915460
25
+ 25: 4782
26
+ 26: 983
27
+ 27: -59231
28
+ 28: 669171001
29
+ 29: 9183
30
+ 30: 443839
31
+ 31: 73682
32
+ 32: 45228
33
+ 33: 100
34
+ 34: 40730
35
+ 35: 55
36
+ 36: 872187
37
+ 37: 748317
38
+ 38: 932718654
39
+ 39: 840
40
+ 40: 210
41
+ 41: 7652413
42
+ 42: 162
43
+ 43: 16695334890
44
+ 44: 5482660
45
+ 45: 1533776805
46
+ 46: 5777
47
+ 47: 134043
48
+ 48: 9110846700
49
+ 49: 296962999629
50
+ 50: 997651
51
+ 51: 121313
52
+ 52: 142857
53
+ 53: 4075
54
+ 54: 376
55
+ 55: 249
56
+ 56: 972
57
+ 57: 153
58
+ 58: 26241
59
+ 59: 107359
60
+ 60: 26033
61
+ 61: 28684
62
+ 62: 127035954683
63
+ 63: 49
64
+ 64: 1322
65
+ 65: 272
66
+ 66: 661
67
+ 67: 7273
68
+ 68: 6531031914842725
69
+ 69: 510510
70
+ 70: 8319823
71
+ 71: 428570
72
+ 72: 303963552391
73
+ 73: 7295372
74
+ 74: 402
75
+ 75: 161667
76
+ 76: 190569291
77
+ 77: 71
78
+ 78: 55374
79
+ 79: 73162890
80
+ 80: 40886
81
+ 81: 427337
82
+ 82: 260324
83
+ 83: 425185
84
+ 84: 101524
85
+ 85: 2772
86
+ 86: 1818
87
+ 87: 1097343
88
+ 88: 7587457
89
+ 89: 743
90
+ 90: 1217
91
+ 91: 14234
92
+ 92: 8581146
93
+ 93: 1258
94
+ 94: 518408346
95
+ 95: 14316
96
+ 96: 24702
97
+ 97: 8739992577
98
+ 98: 18769
99
+ 99: 709
100
+ 100: 756872327473
101
+ 101: 37076114526
102
+ 102: 228
103
+ 103: 20313839404245
104
+ 104: 329468
105
+ 105: 73702
106
+ 106: 21384
107
+ 107: 259679
108
+ 108: 180180
109
+ 109: 38182
110
+ 110: 9350130049860600
111
+ 111: 612407567715
112
+ 112: 1587000
113
+ 113: 51161058134250
114
+ 114: 16475640049
115
+ 115: 168
116
+ 116: 20492570929
117
+ 117: 100808458960497
118
+ 118: 44680
119
+ 119: 248155780267521
120
+ 120: 333082500
121
+ 121: 2269
122
+ 122: 1582
123
+ 123: 21035
124
+ 124: 21417
125
+ 125: 2906969179
126
+ 126: 18522
127
+ 127: 18407904
128
+ 128: 14516824220
129
+ 129: 1000023
130
+ 130: 149253
131
+ 131: 173
132
+ 132: 843296
133
+ 133: 453647705
134
+ 134: 18613426663617118
135
+ 135: 4989
136
+ 136: 2544559
137
+ 137: 1120149658760
138
+ 138: 1118049290473932
139
+ 139: 10057761
140
+ 140: 5673835352990
141
+ 141: 878454337159
142
+ 142: 1006193
143
+ 143: 30758397
144
+ 144: 354
145
+ 145: 608720
146
+ 146: 676333270
147
+ 147: 846910284
148
+ 148: 2129970655314432
149
+ 149: 52852124
150
+ 150: -271248680
151
+ 151: 0.464399
152
+ 152: 301
153
+ 153: 17971254122360635
154
+ 154: 479742450
155
+ 155: 3857447
156
+ 156: 21295121502550
157
+ 157: 53490
158
+ 158: 409511334375
159
+ 159: 14489159
160
+ 160: 16576
161
+ 161: 20574308184277971
162
+ 162: 3D58725572C62302
163
+ 163: 343047
164
+ 164: 378158756814587
165
+ 165: 2868868
166
+ 166: 7130034
167
+ 167: 3916160068885
168
+ 168: 59206
169
+ 169: 178653872807
170
+ 170: 9857164023
171
+ 171: 142989277
172
+ 172: 227485267000992000
173
+ 173: 1572729
174
+ 174: 209566
175
+ 175: 1,13717420,8
176
+ 176: 96818198400000
177
+ 177: 129325
178
+ 178: 126461847755
179
+ 179: 986262
180
+ 180: 285196020571078987
181
+ 181: 83735848679360680
182
+ 182: 399788195976
183
+ 183: 48861552
184
+ 184: 1725323624056
185
+ 185: 4640261571849533
186
+ 186: 2325629
187
+ 187: 17427258
188
+ 188: 95962097
189
+ 189: 10834893628237824
190
+ 190: 371048281
191
+ 191: 1918080160
192
+ 192: 57060635927998347
193
+ 193: 684465067343069
194
+ 194: 61190912
195
+ 195: 75085391
196
+ 196: 322303240771079935
197
+ 197: 1.710637717
198
+ 198: 52374425
199
+ 199: 0.00396087
200
+ 200: 229161792008
201
+ 201: 115039000
202
+ 202: 1209002624
203
+ 203: 34029210557338
204
+ 204: 2944730
205
+ 205: 0.5731441
206
+ 206: 1389019170
207
+ 207: 44043947822
208
+ 208: 331951449665644800
209
+ 209: 15964587728784
210
+ 210: 1598174770174689458
211
+ 211: 1922364685
212
+ 212: 328968937309
213
+ 213: 330.721154
214
+ 214: 1677366278943
215
+ 215: 806844323190414
216
+ 216: 5437849
217
+ 217: 6273134
218
+ 218: 0
219
+ 219: 64564225042
220
+ 220: 139776,963904
221
+ 221: 1884161251122450
222
+ 222: 1590933
223
+ 223: 61614848
224
+ 224: 4137330
225
+ 225: 2009
226
+ 226: 0.11316017
227
+ 227: 3780.618622
228
+ 228: 86226
229
+ 229: 11325263
230
+ 230: 850481152593119296
231
+ 231: 7526965179680
232
+ 232: 0.83648556
233
+ 233: 271204031455541309
234
+ 234: 1259187438574927161
235
+ 235: 1.002322108633
236
+ 236: 123/59
237
+ 237: 15836928
238
+ 238: 9922545104535661
239
+ 239: 0.001887854841
240
+ 240: 7448717393364181966
241
+ 241: 482316491800641154
242
+ 242: 997104142249036713
243
+ 243: 892371480
244
+ 244: 96356848
245
+ 245: 288084712410001
246
+ 246: 810834388
247
+ 247: 782252
248
+ 248: 23507044290
249
+ 249: 9275262564250418
250
+ 250: 1425480602091519
251
+ 251: 18946051
252
+ 252: 104924.0
253
+ 253: 11.492847
254
+ 254: 8184523820510
255
+ 255: 4.4474011180
256
+ 256: 85765680
257
+ 257: 139012411
258
+ 258: 12747994
259
+ 259: 20101196798
260
+ 260: 167542057
261
+ 261: 238890850232021
262
+ 262: 2531.205
263
+ 263: 2039506520
264
+ 264: 2816417.1055
265
+ 265: 209110240768
266
+ 266: 1096883702440585
267
+ 267: 0.999992836187
268
+ 268: 785478606870985
269
+ 269: 1311109198529286
270
+ 270: 82282080
271
+ 271: 4617456485273129588
272
+ 272: 8495585919506151122
273
+ 273: 2032447591196869022
274
+ 274: 1601912348822
275
+ 275: 15030564
276
+ 276: 5777137137739632912
277
+ 277: 1125977393124310
278
+ 278: 1228215747273908452
279
+ 279: 416577688
280
+ 280: 430.088247
281
+ 281: 1485776387445623
282
+ 282: 1098988351
283
+ 283: 28038042525570324
284
+ 284: 5a411d7b
285
+ 285: 157055.80999
286
+ 286: 52.6494571953
287
+ 287: 313135496
288
+ 288: 605857431263981935
289
+ 289: 6567944538
290
+ 290: 20444710234716473
291
+ 291: 4037526
292
+ 292: 3600060866
293
+ 293: 2209
294
+ 294: 789184709
295
+ 295: 4884650818
296
+ 296: 1137208419
297
+ 297: 2252639041804718029
298
+ 298: 1.76882294
299
+ 299: 549936643
300
+ 300: 8.0540771484375
301
+ 301: 2178309
302
+ 302: 1170060
303
+ 303: 1111981904675169
304
+ 304: 283988410192
305
+ 305: 18174995535140
306
+ 306: 852938
307
+ 307: 0.7311720251
308
+ 308: 1539669807660924
309
+ 309: 210139
310
+ 310: 2586528661783
311
+ 311: 2466018557
312
+ 312: 324681947
313
+ 313: 2057774861813004
314
+ 314: 132.52756426
315
+ 315: 13625242
316
+ 316: 542934735751917735
317
+ 317: 1856532.8455
318
+ 318: 709313889
319
+ 319: 268457129
320
+ 320: 278157919195482643
321
+ 321: 2470433131948040
322
+ 322: 999998760323313995
323
+ 323: 6.3551758451
324
+ 324: 96972774
325
+ 325: 54672965
326
+ 326: 1966666166408794329
327
+ 327: 34315549139516
328
+ 328: 260511850222
329
+ 329: 199740353/29386561536000
330
+ 330: 15955822
331
+ 331: 467178235146843549
332
+ 332: 2717.751525
333
+ 333: 3053105
334
+ 334: 150320021261690835
335
+ 335: 5032316
336
+ 336: CAGBIHEFJDK
337
+ 337: 85068035
338
+ 338: 15614292
339
+ 339: 19823.542204
340
+ 340: 291504964
341
+ 341: 56098610614277014
342
+ 342: 5943040885644
343
+ 343: 269533451410884183
344
+ 344: 65579304332
345
+ 345: 13938
346
+ 346: 336108797689259276
347
+ 347: 11109800204052
348
+ 348: 1004195061
349
+ 349: 115384615384614952
350
+ 350: 84664213
351
+ 351: 11762187201804552
352
+ 352: 378563.260589
353
+ 353: 1.2759860331
354
+ 354: 58065134
355
+ 355: 1726545007
356
+ 356: 28010159
357
+ 357: 1739023853137
358
+ 358: 3284144505
359
+ 359: 40632119
360
+ 360: 878825614395267072
361
+ 361: 178476944
362
+ 362: 457895958010
363
+ 363: 0.0000372091
364
+ 364: 44855254
365
+ 365: 162619462356610313
366
+ 366: 88351299
367
+ 367: 48271207
368
+ 368: 253.6135092068
369
+ 369: 862400558448
370
+ 370: 41791929448408
371
+ 371: 40.66368097
372
+ 372: 301450082318807027
373
+ 373: 727227472448913
374
+ 374: 334420941
375
+ 375: 7435327983715286168
376
+ 376: 973059630185670
377
+ 377: 732385277
378
+ 378: 147534623725724718
379
+ 379: 132314136838185
380
+ 380: 6.3202e25093
381
+ 381: 139602943319822
382
+ 382: 697003956
383
+ 383: 22173624649806
384
+ 384: 3354706415856332783
385
+ 385: 3776957309612153700
386
+ 386: 528755790
387
+ 387: 696067597313468
388
+ 388: 831907372805129931
389
+ 389: 2406376.3623
390
+ 390: 2919133642971
391
+ 391: 61029882288
392
+ 392: 3.1486734435
393
+ 393: 112398351350823112
394
+ 394: 3.2370342194
395
+ 395: 28.2453753155
396
+ 396: 173214653
397
+ 397: 141630459461893728
398
+ 398: 2010.59096
399
+ 399: 1508395636674243,6.5e27330467
400
+ 400: 438505383468410633
401
+ 401: 281632621
402
+ 402: 356019862
403
+ 403: 18224771
404
+ 404: 1199215615081353
405
+ 405: 237696125
406
+ 406: 36813.12757207
407
+ 407: 39782849136421
408
+ 408: 299742733
409
+ 409: 253223948
410
+ 410: 799999783589946560
411
+ 411: 9936352
412
+ 412: 38788800
413
+ 413: 3079418648040719
414
+ 414: 552506775824935461
415
+ 415: 55859742
416
+ 416: 898082747
417
+ 417: 446572970925740
418
+ 418: 1177163565297340320
419
+ 419: 998567458,1046245404,43363922
420
+ 420: 145159332
421
+ 421: 2304215802083466198
422
+ 422: 92060460
423
+ 423: 653972374
424
+ 424: 1059760019628
425
+ 425: 46479497324
426
+ 426: 31591886008
427
+ 427: 97138867
428
+ 428: 747215561862
429
+ 429: 98792821
430
+ 430: 5000624921.38
431
+ 431: 23.386029052
432
+ 432: 754862080
433
+ 433: 326624372659664
434
+ 434: 863253606
435
+ 435: 252541322550
436
+ 436: 0.5276662759
437
+ 437: 74204709657207
438
+ 438:
439
+ 439:
440
+ 440:
441
+ 441: 5000088.8395
442
+ 442: 1295552661530920149
443
+ 443: 2744233049300770
444
+ 444:
445
+ 445:
446
+ 446:
447
+ 447:
448
+ 448:
449
+ 449: 103.37870096
450
+ 450:
451
+ 451: 153651073760956
452
+ 452: 345558983
453
+ 453:
454
+ 454: 5435004633092
455
+ 455: 450186511399999
456
+ 456: 333333208685971546