euler-manager 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +37 -0
- data/Rakefile +1 -0
- data/bin/euler +145 -0
- data/data/answers.yml +456 -0
- data/data/problems/1.yml +7 -0
- data/data/problems/10.yml +8 -0
- data/data/problems/100.yml +13 -0
- data/data/problems/101.yml +49 -0
- data/data/problems/102.yml +16 -0
- data/data/problems/103.yml +26 -0
- data/data/problems/104.yml +15 -0
- data/data/problems/105.yml +21 -0
- data/data/problems/106.yml +19 -0
- data/data/problems/107.yml +20 -0
- data/data/problems/108.yml +32 -0
- data/data/problems/109.yml +33 -0
- data/data/problems/11.yml +33 -0
- data/data/problems/110.yml +19 -0
- data/data/problems/111.yml +21 -0
- data/data/problems/112.yml +15 -0
- data/data/problems/113.yml +13 -0
- data/data/problems/114.yml +106 -0
- data/data/problems/115.yml +17 -0
- data/data/problems/116.yml +76 -0
- data/data/problems/117.yml +82 -0
- data/data/problems/118.yml +9 -0
- data/data/problems/119.yml +11 -0
- data/data/problems/12.yml +13 -0
- data/data/problems/120.yml +17 -0
- data/data/problems/121.yml +15 -0
- data/data/problems/122.yml +42 -0
- data/data/problems/123.yml +13 -0
- data/data/problems/124.yml +58 -0
- data/data/problems/125.yml +12 -0
- data/data/problems/126.yml +17 -0
- data/data/problems/127.yml +31 -0
- data/data/problems/128.yml +18 -0
- data/data/problems/129.yml +12 -0
- data/data/problems/13.yml +6 -0
- data/data/problems/130.yml +19 -0
- data/data/problems/131.yml +12 -0
- data/data/problems/132.yml +12 -0
- data/data/problems/133.yml +13 -0
- data/data/problems/134.yml +19 -0
- data/data/problems/135.yml +20 -0
- data/data/problems/136.yml +17 -0
- data/data/problems/137.yml +36 -0
- data/data/problems/138.yml +20 -0
- data/data/problems/139.yml +15 -0
- data/data/problems/14.yml +28 -0
- data/data/problems/140.yml +29 -0
- data/data/problems/141.yml +14 -0
- data/data/problems/142.yml +14 -0
- data/data/problems/143.yml +20 -0
- data/data/problems/144.yml +30 -0
- data/data/problems/145.yml +11 -0
- data/data/problems/146.yml +9 -0
- data/data/problems/147.yml +14 -0
- data/data/problems/148.yml +11 -0
- data/data/problems/149.yml +41 -0
- data/data/problems/15.yml +11 -0
- data/data/problems/150.yml +34 -0
- data/data/problems/151.yml +19 -0
- data/data/problems/152.yml +12 -0
- data/data/problems/153.yml +57 -0
- data/data/problems/154.yml +16 -0
- data/data/problems/155.yml +22 -0
- data/data/problems/156.yml +27 -0
- data/data/problems/157.yml +34 -0
- data/data/problems/158.yml +19 -0
- data/data/problems/159.yml +29 -0
- data/data/problems/16.yml +6 -0
- data/data/problems/160.yml +8 -0
- data/data/problems/161.yml +15 -0
- data/data/problems/162.yml +15 -0
- data/data/problems/163.yml +19 -0
- data/data/problems/164.yml +8 -0
- data/data/problems/165.yml +32 -0
- data/data/problems/166.yml +15 -0
- data/data/problems/167.yml +17 -0
- data/data/problems/168.yml +13 -0
- data/data/problems/169.yml +10 -0
- data/data/problems/17.yml +11 -0
- data/data/problems/170.yml +16 -0
- data/data/problems/171.yml +13 -0
- data/data/problems/172.yml +6 -0
- data/data/problems/173.yml +12 -0
- data/data/problems/174.yml +20 -0
- data/data/problems/175.yml +21 -0
- data/data/problems/176.yml +9 -0
- data/data/problems/177.yml +16 -0
- data/data/problems/178.yml +9 -0
- data/data/problems/179.yml +10 -0
- data/data/problems/18.yml +21 -0
- data/data/problems/180.yml +34 -0
- data/data/problems/181.yml +7 -0
- data/data/problems/182.yml +35 -0
- data/data/problems/183.yml +27 -0
- data/data/problems/184.yml +18 -0
- data/data/problems/185.yml +22 -0
- data/data/problems/186.yml +28 -0
- data/data/problems/187.yml +16 -0
- data/data/problems/188.yml +10 -0
- data/data/problems/189.yml +15 -0
- data/data/problems/19.yml +12 -0
- data/data/problems/190.yml +13 -0
- data/data/problems/191.yml +15 -0
- data/data/problems/192.yml +27 -0
- data/data/problems/193.yml +7 -0
- data/data/problems/194.yml +18 -0
- data/data/problems/195.yml +13 -0
- data/data/problems/196.yml +25 -0
- data/data/problems/197.yml +16 -0
- data/data/problems/198.yml +21 -0
- data/data/problems/199.yml +14 -0
- data/data/problems/2.yml +10 -0
- data/data/problems/20.yml +22 -0
- data/data/problems/200.yml +12 -0
- data/data/problems/201.yml +20 -0
- data/data/problems/202.yml +14 -0
- data/data/problems/203.yml +21 -0
- data/data/problems/204.yml +11 -0
- data/data/problems/205.yml +10 -0
- data/data/problems/206.yml +6 -0
- data/data/problems/207.yml +20 -0
- data/data/problems/208.yml +12 -0
- data/data/problems/209.yml +27 -0
- data/data/problems/21.yml +13 -0
- data/data/problems/210.yml +10 -0
- data/data/problems/211.yml +11 -0
- data/data/problems/212.yml +41 -0
- data/data/problems/213.yml +11 -0
- data/data/problems/214.yml +15 -0
- data/data/problems/215.yml +18 -0
- data/data/problems/216.yml +14 -0
- data/data/problems/217.yml +27 -0
- data/data/problems/218.yml +14 -0
- data/data/problems/219.yml +19 -0
- data/data/problems/22.yml +13 -0
- data/data/problems/220.yml +24 -0
- data/data/problems/221.yml +20 -0
- data/data/problems/222.yml +7 -0
- data/data/problems/223.yml +12 -0
- data/data/problems/224.yml +12 -0
- data/data/problems/225.yml +11 -0
- data/data/problems/226.yml +16 -0
- data/data/problems/227.yml +13 -0
- data/data/problems/228.yml +23 -0
- data/data/problems/229.yml +30 -0
- data/data/problems/23.yml +19 -0
- data/data/problems/230.yml +23 -0
- data/data/problems/231.yml +16 -0
- data/data/problems/232.yml +14 -0
- data/data/problems/233.yml +10 -0
- data/data/problems/234.yml +23 -0
- data/data/problems/235.yml +9 -0
- data/data/problems/236.yml +32 -0
- data/data/problems/237.yml +13 -0
- data/data/problems/238.yml +42 -0
- data/data/problems/239.yml +9 -0
- data/data/problems/24.yml +10 -0
- data/data/problems/240.yml +11 -0
- data/data/problems/241.yml +17 -0
- data/data/problems/242.yml +16 -0
- data/data/problems/243.yml +19 -0
- data/data/problems/244.yml +32 -0
- data/data/problems/245.yml +36 -0
- data/data/problems/246.yml +17 -0
- data/data/problems/247.yml +21 -0
- data/data/problems/248.yml +6 -0
- data/data/problems/249.yml +7 -0
- data/data/problems/25.yml +15 -0
- data/data/problems/250.yml +7 -0
- data/data/problems/251.yml +13 -0
- data/data/problems/252.yml +31 -0
- data/data/problems/253.yml +36 -0
- data/data/problems/254.yml +21 -0
- data/data/problems/255.yml +59 -0
- data/data/problems/256.yml +43 -0
- data/data/problems/257.yml +18 -0
- data/data/problems/258.yml +13 -0
- data/data/problems/259.yml +16 -0
- data/data/problems/26.yml +11 -0
- data/data/problems/260.yml +30 -0
- data/data/problems/261.yml +19 -0
- data/data/problems/262.yml +20 -0
- data/data/problems/263.yml +19 -0
- data/data/problems/264.yml +20 -0
- data/data/problems/265.yml +16 -0
- data/data/problems/266.yml +10 -0
- data/data/problems/267.yml +14 -0
- data/data/problems/268.yml +8 -0
- data/data/problems/269.yml +15 -0
- data/data/problems/27.yml +25 -0
- data/data/problems/270.yml +17 -0
- data/data/problems/271.yml +13 -0
- data/data/problems/272.yml +15 -0
- data/data/problems/273.yml +21 -0
- data/data/problems/274.yml +23 -0
- data/data/problems/275.yml +19 -0
- data/data/problems/276.yml +11 -0
- data/data/problems/277.yml +24 -0
- data/data/problems/278.yml +32 -0
- data/data/problems/279.yml +6 -0
- data/data/problems/28.yml +17 -0
- data/data/problems/280.yml +13 -0
- data/data/problems/281.yml +17 -0
- data/data/problems/282.yml +10 -0
- data/data/problems/283.yml +11 -0
- data/data/problems/284.yml +22 -0
- data/data/problems/285.yml +17 -0
- data/data/problems/286.yml +12 -0
- data/data/problems/287.yml +36 -0
- data/data/problems/288.yml +15 -0
- data/data/problems/289.yml +19 -0
- data/data/problems/29.yml +24 -0
- data/data/problems/290.yml +8 -0
- data/data/problems/291.yml +10 -0
- data/data/problems/292.yml +13 -0
- data/data/problems/293.yml +15 -0
- data/data/problems/294.yml +10 -0
- data/data/problems/295.yml +26 -0
- data/data/problems/296.yml +15 -0
- data/data/problems/297.yml +19 -0
- data/data/problems/298.yml +46 -0
- data/data/problems/299.yml +31 -0
- data/data/problems/3.yml +7 -0
- data/data/problems/30.yml +12 -0
- data/data/problems/300.yml +24 -0
- data/data/problems/301.yml +25 -0
- data/data/problems/302.yml +18 -0
- data/data/problems/303.yml +11 -0
- data/data/problems/304.yml +19 -0
- data/data/problems/305.yml +14 -0
- data/data/problems/306.yml +29 -0
- data/data/problems/307.yml +12 -0
- data/data/problems/308.yml +34 -0
- data/data/problems/309.yml +17 -0
- data/data/problems/31.yml +18 -0
- data/data/problems/310.yml +19 -0
- data/data/problems/311.yml +21 -0
- data/data/problems/312.yml +15 -0
- data/data/problems/313.yml +17 -0
- data/data/problems/314.yml +29 -0
- data/data/problems/315.yml +49 -0
- data/data/problems/316.yml +25 -0
- data/data/problems/317.yml +11 -0
- data/data/problems/318.yml +61 -0
- data/data/problems/319.yml +23 -0
- data/data/problems/32.yml +14 -0
- data/data/problems/320.yml +12 -0
- data/data/problems/321.yml +18 -0
- data/data/problems/322.yml +12 -0
- data/data/problems/323.yml +19 -0
- data/data/problems/324.yml +17 -0
- data/data/problems/325.yml +25 -0
- data/data/problems/326.yml +12 -0
- data/data/problems/327.yml +39 -0
- data/data/problems/328.yml +36 -0
- data/data/problems/329.yml +17 -0
- data/data/problems/33.yml +13 -0
- data/data/problems/330.yml +40 -0
- data/data/problems/331.yml +28 -0
- data/data/problems/332.yml +16 -0
- data/data/problems/333.yml +25 -0
- data/data/problems/334.yml +39 -0
- data/data/problems/335.yml +16 -0
- data/data/problems/336.yml +24 -0
- data/data/problems/337.yml +15 -0
- data/data/problems/338.yml +41 -0
- data/data/problems/339.yml +17 -0
- data/data/problems/34.yml +7 -0
- data/data/problems/340.yml +14 -0
- data/data/problems/341.yml +18 -0
- data/data/problems/342.yml +17 -0
- data/data/problems/343.yml +29 -0
- data/data/problems/344.yml +21 -0
- data/data/problems/345.yml +26 -0
- data/data/problems/346.yml +11 -0
- data/data/problems/347.yml +16 -0
- data/data/problems/348.yml +12 -0
- data/data/problems/349.yml +13 -0
- data/data/problems/35.yml +8 -0
- data/data/problems/350.yml +18 -0
- data/data/problems/351.yml +13 -0
- data/data/problems/352.yml +49 -0
- data/data/problems/353.yml +25 -0
- data/data/problems/354.yml +16 -0
- data/data/problems/355.yml +8 -0
- data/data/problems/356.yml +10 -0
- data/data/problems/357.yml +9 -0
- data/data/problems/358.yml +31 -0
- data/data/problems/359.yml +26 -0
- data/data/problems/36.yml +8 -0
- data/data/problems/360.yml +12 -0
- data/data/problems/361.yml +20 -0
- data/data/problems/362.yml +32 -0
- data/data/problems/363.yml +33 -0
- data/data/problems/364.yml +15 -0
- data/data/problems/365.yml +17 -0
- data/data/problems/366.yml +26 -0
- data/data/problems/367.yml +20 -0
- data/data/problems/368.yml +39 -0
- data/data/problems/369.yml +15 -0
- data/data/problems/37.yml +10 -0
- data/data/problems/370.yml +16 -0
- data/data/problems/371.yml +13 -0
- data/data/problems/372.yml +16 -0
- data/data/problems/373.yml +10 -0
- data/data/problems/374.yml +25 -0
- data/data/problems/375.yml +23 -0
- data/data/problems/376.yml +25 -0
- data/data/problems/377.yml +11 -0
- data/data/problems/378.yml +15 -0
- data/data/problems/379.yml +15 -0
- data/data/problems/38.yml +18 -0
- data/data/problems/380.yml +22 -0
- data/data/problems/381.yml +21 -0
- data/data/problems/382.yml +23 -0
- data/data/problems/383.yml +13 -0
- data/data/problems/384.yml +28 -0
- data/data/problems/385.yml +22 -0
- data/data/problems/386.yml +16 -0
- data/data/problems/387.yml +19 -0
- data/data/problems/388.yml +12 -0
- data/data/problems/389.yml +12 -0
- data/data/problems/39.yml +10 -0
- data/data/problems/390.yml +18 -0
- data/data/problems/391.yml +29 -0
- data/data/problems/392.yml +22 -0
- data/data/problems/393.yml +12 -0
- data/data/problems/394.yml +22 -0
- data/data/problems/395.yml +19 -0
- data/data/problems/396.yml +28 -0
- data/data/problems/397.yml +20 -0
- data/data/problems/398.yml +13 -0
- data/data/problems/399.yml +22 -0
- data/data/problems/4.yml +8 -0
- data/data/problems/40.yml +18 -0
- data/data/problems/400.yml +18 -0
- data/data/problems/401.yml +11 -0
- data/data/problems/402.yml +25 -0
- data/data/problems/403.yml +19 -0
- data/data/problems/404.yml +21 -0
- data/data/problems/405.yml +15 -0
- data/data/problems/406.yml +46 -0
- data/data/problems/407.yml +20 -0
- data/data/problems/408.yml +14 -0
- data/data/problems/409.yml +12 -0
- data/data/problems/41.yml +8 -0
- data/data/problems/410.yml +19 -0
- data/data/problems/411.yml +23 -0
- data/data/problems/412.yml +19 -0
- data/data/problems/413.yml +13 -0
- data/data/problems/414.yml +40 -0
- data/data/problems/415.yml +19 -0
- data/data/problems/416.yml +13 -0
- data/data/problems/417.yml +21 -0
- data/data/problems/418.yml +17 -0
- data/data/problems/419.yml +22 -0
- data/data/problems/42.yml +14 -0
- data/data/problems/420.yml +13 -0
- data/data/problems/421.yml +29 -0
- data/data/problems/422.yml +22 -0
- data/data/problems/423.yml +22 -0
- data/data/problems/424.yml +37 -0
- data/data/problems/425.yml +16 -0
- data/data/problems/426.yml +29 -0
- data/data/problems/427.yml +18 -0
- data/data/problems/428.yml +32 -0
- data/data/problems/429.yml +10 -0
- data/data/problems/43.yml +17 -0
- data/data/problems/430.yml +20 -0
- data/data/problems/431.yml +33 -0
- data/data/problems/432.yml +13 -0
- data/data/problems/433.yml +18 -0
- data/data/problems/434.yml +32 -0
- data/data/problems/435.yml +21 -0
- data/data/problems/436.yml +21 -0
- data/data/problems/437.yml +22 -0
- data/data/problems/438.yml +29 -0
- data/data/problems/439.yml +17 -0
- data/data/problems/44.yml +16 -0
- data/data/problems/440.yml +21 -0
- data/data/problems/441.yml +23 -0
- data/data/problems/442.yml +9 -0
- data/data/problems/443.yml +13 -0
- data/data/problems/444.yml +28 -0
- data/data/problems/445.yml +37 -0
- data/data/problems/446.yml +29 -0
- data/data/problems/447.yml +31 -0
- data/data/problems/448.yml +14 -0
- data/data/problems/449.yml +17 -0
- data/data/problems/45.yml +15 -0
- data/data/problems/450.yml +26 -0
- data/data/problems/451.yml +15 -0
- data/data/problems/452.yml +8 -0
- data/data/problems/453.yml +16 -0
- data/data/problems/454.yml +17 -0
- data/data/problems/455.yml +16 -0
- data/data/problems/456.yml +15 -0
- data/data/problems/46.yml +18 -0
- data/data/problems/47.yml +21 -0
- data/data/problems/48.yml +7 -0
- data/data/problems/49.yml +10 -0
- data/data/problems/5.yml +8 -0
- data/data/problems/50.yml +10 -0
- data/data/problems/51.yml +15 -0
- data/data/problems/52.yml +8 -0
- data/data/problems/53.yml +28 -0
- data/data/problems/54.yml +43 -0
- data/data/problems/55.yml +21 -0
- data/data/problems/56.yml +11 -0
- data/data/problems/57.yml +15 -0
- data/data/problems/58.yml +22 -0
- data/data/problems/59.yml +23 -0
- data/data/problems/6.yml +13 -0
- data/data/problems/60.yml +10 -0
- data/data/problems/61.yml +30 -0
- data/data/problems/62.yml +9 -0
- data/data/problems/63.yml +7 -0
- data/data/problems/64.yml +130 -0
- data/data/problems/65.yml +62 -0
- data/data/problems/66.yml +27 -0
- data/data/problems/67.yml +17 -0
- data/data/problems/68.yml +23 -0
- data/data/problems/69.yml +14 -0
- data/data/problems/7.yml +6 -0
- data/data/problems/70.yml +16 -0
- data/data/problems/71.yml +17 -0
- data/data/problems/72.yml +16 -0
- data/data/problems/73.yml +16 -0
- data/data/problems/74.yml +41 -0
- data/data/problems/75.yml +16 -0
- data/data/problems/76.yml +8 -0
- data/data/problems/77.yml +8 -0
- data/data/problems/78.yml +12 -0
- data/data/problems/79.yml +11 -0
- data/data/problems/8.yml +6 -0
- data/data/problems/80.yml +11 -0
- data/data/problems/81.yml +19 -0
- data/data/problems/82.yml +19 -0
- data/data/problems/83.yml +23 -0
- data/data/problems/84.yml +63 -0
- data/data/problems/85.yml +9 -0
- data/data/problems/86.yml +15 -0
- data/data/problems/87.yml +12 -0
- data/data/problems/88.yml +53 -0
- data/data/problems/89.yml +18 -0
- data/data/problems/9.yml +13 -0
- data/data/problems/90.yml +23 -0
- data/data/problems/91.yml +19 -0
- data/data/problems/92.yml +29 -0
- data/data/problems/93.yml +21 -0
- data/data/problems/94.yml +11 -0
- data/data/problems/95.yml +23 -0
- data/data/problems/96.yml +46 -0
- data/data/problems/97.yml +14 -0
- data/data/problems/98.yml +16 -0
- data/data/problems/99.yml +16 -0
- data/euler-manager.gemspec +31 -0
- data/euler-manager.sublime-project +12 -0
- data/example/1/README.md +6 -0
- data/example/1/ruby/1.rb +5 -0
- data/example/1/scala/1.scala +9 -0
- data/example/2/README.md +9 -0
- data/example/2/python/2.py +5 -0
- data/example/2/python/euler.py +0 -0
- data/example/Eulerfile.rb +87 -0
- data/example/README.md +26 -0
- data/example/lib/euler.py +0 -0
- data/example/lib/euler.rb +0 -0
- data/example/lib/euler.scala +5 -0
- data/lib/euler.rb +190 -0
- data/lib/euler/errors.rb +7 -0
- data/lib/euler/languages.rb +12 -0
- data/lib/euler/languages/coffeescript.rb +25 -0
- data/lib/euler/languages/javascript.rb +25 -0
- data/lib/euler/languages/python.rb +27 -0
- data/lib/euler/languages/ruby.rb +25 -0
- data/lib/euler/languages/scala.rb +27 -0
- data/lib/euler/languages/templates/coffeescript.coffee +5 -0
- data/lib/euler/languages/templates/javascript.js +5 -0
- data/lib/euler/languages/templates/python.py +5 -0
- data/lib/euler/languages/templates/ruby.rb +5 -0
- data/lib/euler/languages/templates/scala.scala +9 -0
- data/lib/euler/problem.rb +60 -0
- data/lib/euler/solution.rb +98 -0
- data/lib/euler/version.rb +3 -0
- data/scripts/update_problems +68 -0
- data/spec/euler/problem_spec.rb +5 -0
- data/spec/euler/solution_spec.rb +69 -0
- data/spec/euler_spec.rb +27 -0
- data/spec/spec_helper.rb +3 -0
- metadata +644 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
Euler.register_language('scala', Class.new do
|
2
|
+
|
3
|
+
# Compile and run the scala solution
|
4
|
+
def run solution
|
5
|
+
dir = File.dirname(file_path(solution))
|
6
|
+
Dir.chdir(dir)
|
7
|
+
`scalac #{Euler.root}/lib/*.scala && scalac -cp .:#{Euler.root}/lib ./*.scala && scala Main`
|
8
|
+
end
|
9
|
+
|
10
|
+
# Copy the scala template to the solution directory
|
11
|
+
def init solution
|
12
|
+
FileUtils.cp(template_path, file_path(solution))
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
# Returns the path of the solution
|
18
|
+
def file_path solution
|
19
|
+
"#{solution.dir}/#{solution.problem.id}.scala"
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns the path of the scala template
|
23
|
+
def template_path
|
24
|
+
"#{File.dirname(__FILE__)}/templates/scala.scala"
|
25
|
+
end
|
26
|
+
|
27
|
+
end)
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Euler
|
4
|
+
|
5
|
+
# This class represents a project Euler problem.
|
6
|
+
|
7
|
+
class Problem
|
8
|
+
|
9
|
+
# Returns the problem with the given id.
|
10
|
+
def self.find id
|
11
|
+
problem_spec_file = "#{Euler.problems_dir}/#{id}.yml"
|
12
|
+
problem_spec = YAML.load_file(problem_spec_file)
|
13
|
+
Problem.new problem_spec
|
14
|
+
end
|
15
|
+
|
16
|
+
attr_reader :id, :name, :url, :content
|
17
|
+
|
18
|
+
# Given a hash with symbol keys initialize the problem using the +:id+,
|
19
|
+
# +:name+, +url+, and +:content+ keys.
|
20
|
+
def initialize options
|
21
|
+
@id = options[:id]
|
22
|
+
@name = options[:name]
|
23
|
+
@url = options[:url]
|
24
|
+
@content = options[:content]
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns true if this problem has an answer.
|
28
|
+
def has_answer?
|
29
|
+
not answer.empty?
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns this problem's answer.
|
33
|
+
def answer
|
34
|
+
@@answers ||= YAML.load_file(Euler.answers_file)
|
35
|
+
@@answers[id].to_s
|
36
|
+
end
|
37
|
+
|
38
|
+
# Converts the problem to a hash.
|
39
|
+
def to_hash
|
40
|
+
{
|
41
|
+
id: id,
|
42
|
+
name: name,
|
43
|
+
url: url,
|
44
|
+
content: content
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Converts the problem to YAML.
|
49
|
+
def to_yaml
|
50
|
+
to_hash.to_yaml
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_s
|
54
|
+
"##{id} - #{name}"
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module Euler
|
2
|
+
|
3
|
+
# This class represents a user created solution to a project Euler problem.
|
4
|
+
|
5
|
+
class Solution
|
6
|
+
|
7
|
+
# Returns an array of all of the solutions
|
8
|
+
def self.all
|
9
|
+
Euler.all_solutions_strategy
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_reader :language
|
13
|
+
|
14
|
+
# Given the problem this solution is for an the language it's implemented in
|
15
|
+
# initialize the instance.
|
16
|
+
def initialize problem, language
|
17
|
+
if problem.is_a?(Problem)
|
18
|
+
@problem = problems
|
19
|
+
else
|
20
|
+
@problem_id = problem
|
21
|
+
end
|
22
|
+
@language = language
|
23
|
+
end
|
24
|
+
|
25
|
+
# Returns the problem this solution is for.
|
26
|
+
def problem
|
27
|
+
@problem ||= Problem.find(@problem_id)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns the id of the problem this solution is for.
|
31
|
+
def problem_id
|
32
|
+
@problem_id ||= @problem.id
|
33
|
+
end
|
34
|
+
|
35
|
+
# Initialize this solution. This means:
|
36
|
+
#
|
37
|
+
# - run the +create_directory_strategy+ to initialize the solutions
|
38
|
+
# directory.
|
39
|
+
# - Run this solution's language's init method to do any extra
|
40
|
+
# initialization steps required by the language.
|
41
|
+
def init
|
42
|
+
mkdir
|
43
|
+
if language_object.respond_to?(:init)
|
44
|
+
language_object.init(self)
|
45
|
+
end
|
46
|
+
self
|
47
|
+
end
|
48
|
+
|
49
|
+
# Returns this solution's answer.
|
50
|
+
def answer
|
51
|
+
problem.answer
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns the result of running this solution.
|
55
|
+
def run
|
56
|
+
@result ||= language_object.run(self)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Alias for +run+.
|
60
|
+
def result
|
61
|
+
run
|
62
|
+
end
|
63
|
+
|
64
|
+
# Returns true if this solution is correct.
|
65
|
+
def test
|
66
|
+
expected = answer
|
67
|
+
result = run
|
68
|
+
expected == result
|
69
|
+
end
|
70
|
+
|
71
|
+
# Alias for +test+.
|
72
|
+
def correct?
|
73
|
+
test
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns the directory assigned to this solution by calling
|
77
|
+
# +Euler.directory_strategy+.
|
78
|
+
def dir
|
79
|
+
Euler.directory_strategy(self)
|
80
|
+
end
|
81
|
+
|
82
|
+
protected
|
83
|
+
|
84
|
+
# Used to create this solution's directory.
|
85
|
+
def mkdir
|
86
|
+
Euler.create_directory_strategy(self)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Returns the object instance of the class which represents this
|
90
|
+
# solution's language. Not to be confused with +language+ which just
|
91
|
+
# returns the name of the solutions language.
|
92
|
+
def language_object
|
93
|
+
@language_object ||= Euler.get_language(language)
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Gets all of the problems from projecteuler.net and serializes them as json
|
4
|
+
# into the data/problems directory. This way http requests do not need to be
|
5
|
+
# each time the manager is asked to describe a problem.
|
6
|
+
|
7
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
|
8
|
+
|
9
|
+
require 'colorize'
|
10
|
+
require 'nokogiri'
|
11
|
+
require 'open-uri'
|
12
|
+
require 'yaml'
|
13
|
+
|
14
|
+
require 'euler'
|
15
|
+
|
16
|
+
# Number of seconds to wait in the beginning of each iteration of the http request loop
|
17
|
+
sleep_time = 0.5
|
18
|
+
|
19
|
+
puts
|
20
|
+
puts 'Updating project Euler problem specs.'
|
21
|
+
puts
|
22
|
+
|
23
|
+
data_dir = "#{__dir__}/../data"
|
24
|
+
answers_file = "#{data_dir}/answers.yml"
|
25
|
+
problems_dir = "#{data_dir}/problems"
|
26
|
+
|
27
|
+
puts 'Data directory: '.light_black + data_dir.underline
|
28
|
+
puts 'Answers File: '.light_black + answers_file.underline
|
29
|
+
puts 'Problems Directory: '.light_black + problems_dir.underline
|
30
|
+
puts
|
31
|
+
|
32
|
+
problem_ids = YAML.load_file(answers_file).keys
|
33
|
+
problems_count = problem_ids.count
|
34
|
+
problems_count_digits = problems_count.to_s.size
|
35
|
+
|
36
|
+
puts problems_count.to_s.underline + ' Problems will be updated.'
|
37
|
+
puts
|
38
|
+
|
39
|
+
# Fetch problems from projecteuler.net
|
40
|
+
problems = problem_ids.map.with_index do |problem_id, index|
|
41
|
+
zero_padded_index = (index + 1).to_s.rjust(problems_count_digits, '0')
|
42
|
+
zero_padded_problem_id = problem_id.to_s.rjust(problems_count_digits, '0')
|
43
|
+
|
44
|
+
print "(#{zero_padded_index} / #{problems_count}) ##{zero_padded_index}"
|
45
|
+
|
46
|
+
sleep(sleep_time)
|
47
|
+
|
48
|
+
url = "http://projecteuler.net/problem=#{problem_id}"
|
49
|
+
|
50
|
+
doc = Nokogiri::HTML(open(url))
|
51
|
+
problem = Euler::Problem.new({
|
52
|
+
id: problem_id,
|
53
|
+
name: doc.css('h2').first.inner_html,
|
54
|
+
url: url,
|
55
|
+
content: doc.css('.problem_content').first.inner_html
|
56
|
+
})
|
57
|
+
|
58
|
+
print " : " + problem.name.bold.underline
|
59
|
+
|
60
|
+
File.open("#{problems_dir}/#{problem.id}.yml", 'w') do |f|
|
61
|
+
f.write(problem.to_yaml)
|
62
|
+
end
|
63
|
+
|
64
|
+
print " \u2713".encode('utf-8').green.bold
|
65
|
+
puts
|
66
|
+
|
67
|
+
problem
|
68
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class EulerLang
|
4
|
+
def run solution
|
5
|
+
'42'
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
describe Euler::Solution do
|
10
|
+
|
11
|
+
before(:all) do
|
12
|
+
Euler.register_language('euler-lang', EulerLang)
|
13
|
+
end
|
14
|
+
|
15
|
+
after(:all) do
|
16
|
+
Euler.unregister_language('euler-lang')
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should call it's language's run method when run is called" do
|
20
|
+
EulerLang.any_instance.should_receive(:run).once
|
21
|
+
solution = Euler::Solution.new(9001, 'euler-lang')
|
22
|
+
solution.run
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should raise an error if run is called before it's language is registered" do
|
26
|
+
expect {
|
27
|
+
solution = Euler::Solution.new(9001, 'euler-lang2')
|
28
|
+
solution.run
|
29
|
+
}.to raise_error Euler::LanguageNotRegisteredError
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should attempt to create the directory specified by directory_strategy when init is called" do
|
33
|
+
include FakeFS::SpecHelpers
|
34
|
+
|
35
|
+
allow(Euler::Problem).to receive(:find).with(1).and_return(Euler::Problem.find(1))
|
36
|
+
|
37
|
+
FakeFS.activate!
|
38
|
+
|
39
|
+
ds = lambda { |solution|
|
40
|
+
"/euler/#{solution.problem_id}/#{solution.language}"
|
41
|
+
}
|
42
|
+
|
43
|
+
args = [1, 'euler-lang']
|
44
|
+
|
45
|
+
Euler.config do |config|
|
46
|
+
config.directory_strategy ds
|
47
|
+
end
|
48
|
+
|
49
|
+
solution = Euler::Solution.new(*args).init
|
50
|
+
|
51
|
+
dir = ds.call(solution)
|
52
|
+
|
53
|
+
File.directory?(dir).should be_true
|
54
|
+
end
|
55
|
+
|
56
|
+
it "correct? method should return true of the solution is correct and false otherwise" do
|
57
|
+
include FakeFS::SpecHelpers
|
58
|
+
FakeFS.deactivate!
|
59
|
+
|
60
|
+
solution = Euler::Solution.new(1, 'euler-lang')
|
61
|
+
problem = solution.problem
|
62
|
+
allow(problem).to receive(:answer).and_return('42', '9001')
|
63
|
+
|
64
|
+
solution.correct?.should be_true
|
65
|
+
|
66
|
+
solution.correct?.should be_false
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
data/spec/euler_spec.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Euler do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
Euler.config do |config|
|
7
|
+
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should be able to set config options with lambdas" do
|
12
|
+
ds = lambda { |solution|
|
13
|
+
|
14
|
+
}
|
15
|
+
|
16
|
+
args = [1, 'euler-lang']
|
17
|
+
|
18
|
+
ds.should_receive(:call).once.with(*args)
|
19
|
+
|
20
|
+
Euler.config do |config|
|
21
|
+
config.directory_strategy ds
|
22
|
+
end
|
23
|
+
|
24
|
+
Euler.directory_strategy *args
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,644 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: euler-manager
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- William Yaworsky
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: commander
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: colorize
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: fakefs
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.5.2
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.5.2
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: nokogiri
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description:
|
112
|
+
email:
|
113
|
+
- wj.px01@gmail.com
|
114
|
+
executables:
|
115
|
+
- euler
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".gitignore"
|
120
|
+
- Gemfile
|
121
|
+
- LICENSE.txt
|
122
|
+
- README.md
|
123
|
+
- Rakefile
|
124
|
+
- bin/euler
|
125
|
+
- data/answers.yml
|
126
|
+
- data/problems/1.yml
|
127
|
+
- data/problems/10.yml
|
128
|
+
- data/problems/100.yml
|
129
|
+
- data/problems/101.yml
|
130
|
+
- data/problems/102.yml
|
131
|
+
- data/problems/103.yml
|
132
|
+
- data/problems/104.yml
|
133
|
+
- data/problems/105.yml
|
134
|
+
- data/problems/106.yml
|
135
|
+
- data/problems/107.yml
|
136
|
+
- data/problems/108.yml
|
137
|
+
- data/problems/109.yml
|
138
|
+
- data/problems/11.yml
|
139
|
+
- data/problems/110.yml
|
140
|
+
- data/problems/111.yml
|
141
|
+
- data/problems/112.yml
|
142
|
+
- data/problems/113.yml
|
143
|
+
- data/problems/114.yml
|
144
|
+
- data/problems/115.yml
|
145
|
+
- data/problems/116.yml
|
146
|
+
- data/problems/117.yml
|
147
|
+
- data/problems/118.yml
|
148
|
+
- data/problems/119.yml
|
149
|
+
- data/problems/12.yml
|
150
|
+
- data/problems/120.yml
|
151
|
+
- data/problems/121.yml
|
152
|
+
- data/problems/122.yml
|
153
|
+
- data/problems/123.yml
|
154
|
+
- data/problems/124.yml
|
155
|
+
- data/problems/125.yml
|
156
|
+
- data/problems/126.yml
|
157
|
+
- data/problems/127.yml
|
158
|
+
- data/problems/128.yml
|
159
|
+
- data/problems/129.yml
|
160
|
+
- data/problems/13.yml
|
161
|
+
- data/problems/130.yml
|
162
|
+
- data/problems/131.yml
|
163
|
+
- data/problems/132.yml
|
164
|
+
- data/problems/133.yml
|
165
|
+
- data/problems/134.yml
|
166
|
+
- data/problems/135.yml
|
167
|
+
- data/problems/136.yml
|
168
|
+
- data/problems/137.yml
|
169
|
+
- data/problems/138.yml
|
170
|
+
- data/problems/139.yml
|
171
|
+
- data/problems/14.yml
|
172
|
+
- data/problems/140.yml
|
173
|
+
- data/problems/141.yml
|
174
|
+
- data/problems/142.yml
|
175
|
+
- data/problems/143.yml
|
176
|
+
- data/problems/144.yml
|
177
|
+
- data/problems/145.yml
|
178
|
+
- data/problems/146.yml
|
179
|
+
- data/problems/147.yml
|
180
|
+
- data/problems/148.yml
|
181
|
+
- data/problems/149.yml
|
182
|
+
- data/problems/15.yml
|
183
|
+
- data/problems/150.yml
|
184
|
+
- data/problems/151.yml
|
185
|
+
- data/problems/152.yml
|
186
|
+
- data/problems/153.yml
|
187
|
+
- data/problems/154.yml
|
188
|
+
- data/problems/155.yml
|
189
|
+
- data/problems/156.yml
|
190
|
+
- data/problems/157.yml
|
191
|
+
- data/problems/158.yml
|
192
|
+
- data/problems/159.yml
|
193
|
+
- data/problems/16.yml
|
194
|
+
- data/problems/160.yml
|
195
|
+
- data/problems/161.yml
|
196
|
+
- data/problems/162.yml
|
197
|
+
- data/problems/163.yml
|
198
|
+
- data/problems/164.yml
|
199
|
+
- data/problems/165.yml
|
200
|
+
- data/problems/166.yml
|
201
|
+
- data/problems/167.yml
|
202
|
+
- data/problems/168.yml
|
203
|
+
- data/problems/169.yml
|
204
|
+
- data/problems/17.yml
|
205
|
+
- data/problems/170.yml
|
206
|
+
- data/problems/171.yml
|
207
|
+
- data/problems/172.yml
|
208
|
+
- data/problems/173.yml
|
209
|
+
- data/problems/174.yml
|
210
|
+
- data/problems/175.yml
|
211
|
+
- data/problems/176.yml
|
212
|
+
- data/problems/177.yml
|
213
|
+
- data/problems/178.yml
|
214
|
+
- data/problems/179.yml
|
215
|
+
- data/problems/18.yml
|
216
|
+
- data/problems/180.yml
|
217
|
+
- data/problems/181.yml
|
218
|
+
- data/problems/182.yml
|
219
|
+
- data/problems/183.yml
|
220
|
+
- data/problems/184.yml
|
221
|
+
- data/problems/185.yml
|
222
|
+
- data/problems/186.yml
|
223
|
+
- data/problems/187.yml
|
224
|
+
- data/problems/188.yml
|
225
|
+
- data/problems/189.yml
|
226
|
+
- data/problems/19.yml
|
227
|
+
- data/problems/190.yml
|
228
|
+
- data/problems/191.yml
|
229
|
+
- data/problems/192.yml
|
230
|
+
- data/problems/193.yml
|
231
|
+
- data/problems/194.yml
|
232
|
+
- data/problems/195.yml
|
233
|
+
- data/problems/196.yml
|
234
|
+
- data/problems/197.yml
|
235
|
+
- data/problems/198.yml
|
236
|
+
- data/problems/199.yml
|
237
|
+
- data/problems/2.yml
|
238
|
+
- data/problems/20.yml
|
239
|
+
- data/problems/200.yml
|
240
|
+
- data/problems/201.yml
|
241
|
+
- data/problems/202.yml
|
242
|
+
- data/problems/203.yml
|
243
|
+
- data/problems/204.yml
|
244
|
+
- data/problems/205.yml
|
245
|
+
- data/problems/206.yml
|
246
|
+
- data/problems/207.yml
|
247
|
+
- data/problems/208.yml
|
248
|
+
- data/problems/209.yml
|
249
|
+
- data/problems/21.yml
|
250
|
+
- data/problems/210.yml
|
251
|
+
- data/problems/211.yml
|
252
|
+
- data/problems/212.yml
|
253
|
+
- data/problems/213.yml
|
254
|
+
- data/problems/214.yml
|
255
|
+
- data/problems/215.yml
|
256
|
+
- data/problems/216.yml
|
257
|
+
- data/problems/217.yml
|
258
|
+
- data/problems/218.yml
|
259
|
+
- data/problems/219.yml
|
260
|
+
- data/problems/22.yml
|
261
|
+
- data/problems/220.yml
|
262
|
+
- data/problems/221.yml
|
263
|
+
- data/problems/222.yml
|
264
|
+
- data/problems/223.yml
|
265
|
+
- data/problems/224.yml
|
266
|
+
- data/problems/225.yml
|
267
|
+
- data/problems/226.yml
|
268
|
+
- data/problems/227.yml
|
269
|
+
- data/problems/228.yml
|
270
|
+
- data/problems/229.yml
|
271
|
+
- data/problems/23.yml
|
272
|
+
- data/problems/230.yml
|
273
|
+
- data/problems/231.yml
|
274
|
+
- data/problems/232.yml
|
275
|
+
- data/problems/233.yml
|
276
|
+
- data/problems/234.yml
|
277
|
+
- data/problems/235.yml
|
278
|
+
- data/problems/236.yml
|
279
|
+
- data/problems/237.yml
|
280
|
+
- data/problems/238.yml
|
281
|
+
- data/problems/239.yml
|
282
|
+
- data/problems/24.yml
|
283
|
+
- data/problems/240.yml
|
284
|
+
- data/problems/241.yml
|
285
|
+
- data/problems/242.yml
|
286
|
+
- data/problems/243.yml
|
287
|
+
- data/problems/244.yml
|
288
|
+
- data/problems/245.yml
|
289
|
+
- data/problems/246.yml
|
290
|
+
- data/problems/247.yml
|
291
|
+
- data/problems/248.yml
|
292
|
+
- data/problems/249.yml
|
293
|
+
- data/problems/25.yml
|
294
|
+
- data/problems/250.yml
|
295
|
+
- data/problems/251.yml
|
296
|
+
- data/problems/252.yml
|
297
|
+
- data/problems/253.yml
|
298
|
+
- data/problems/254.yml
|
299
|
+
- data/problems/255.yml
|
300
|
+
- data/problems/256.yml
|
301
|
+
- data/problems/257.yml
|
302
|
+
- data/problems/258.yml
|
303
|
+
- data/problems/259.yml
|
304
|
+
- data/problems/26.yml
|
305
|
+
- data/problems/260.yml
|
306
|
+
- data/problems/261.yml
|
307
|
+
- data/problems/262.yml
|
308
|
+
- data/problems/263.yml
|
309
|
+
- data/problems/264.yml
|
310
|
+
- data/problems/265.yml
|
311
|
+
- data/problems/266.yml
|
312
|
+
- data/problems/267.yml
|
313
|
+
- data/problems/268.yml
|
314
|
+
- data/problems/269.yml
|
315
|
+
- data/problems/27.yml
|
316
|
+
- data/problems/270.yml
|
317
|
+
- data/problems/271.yml
|
318
|
+
- data/problems/272.yml
|
319
|
+
- data/problems/273.yml
|
320
|
+
- data/problems/274.yml
|
321
|
+
- data/problems/275.yml
|
322
|
+
- data/problems/276.yml
|
323
|
+
- data/problems/277.yml
|
324
|
+
- data/problems/278.yml
|
325
|
+
- data/problems/279.yml
|
326
|
+
- data/problems/28.yml
|
327
|
+
- data/problems/280.yml
|
328
|
+
- data/problems/281.yml
|
329
|
+
- data/problems/282.yml
|
330
|
+
- data/problems/283.yml
|
331
|
+
- data/problems/284.yml
|
332
|
+
- data/problems/285.yml
|
333
|
+
- data/problems/286.yml
|
334
|
+
- data/problems/287.yml
|
335
|
+
- data/problems/288.yml
|
336
|
+
- data/problems/289.yml
|
337
|
+
- data/problems/29.yml
|
338
|
+
- data/problems/290.yml
|
339
|
+
- data/problems/291.yml
|
340
|
+
- data/problems/292.yml
|
341
|
+
- data/problems/293.yml
|
342
|
+
- data/problems/294.yml
|
343
|
+
- data/problems/295.yml
|
344
|
+
- data/problems/296.yml
|
345
|
+
- data/problems/297.yml
|
346
|
+
- data/problems/298.yml
|
347
|
+
- data/problems/299.yml
|
348
|
+
- data/problems/3.yml
|
349
|
+
- data/problems/30.yml
|
350
|
+
- data/problems/300.yml
|
351
|
+
- data/problems/301.yml
|
352
|
+
- data/problems/302.yml
|
353
|
+
- data/problems/303.yml
|
354
|
+
- data/problems/304.yml
|
355
|
+
- data/problems/305.yml
|
356
|
+
- data/problems/306.yml
|
357
|
+
- data/problems/307.yml
|
358
|
+
- data/problems/308.yml
|
359
|
+
- data/problems/309.yml
|
360
|
+
- data/problems/31.yml
|
361
|
+
- data/problems/310.yml
|
362
|
+
- data/problems/311.yml
|
363
|
+
- data/problems/312.yml
|
364
|
+
- data/problems/313.yml
|
365
|
+
- data/problems/314.yml
|
366
|
+
- data/problems/315.yml
|
367
|
+
- data/problems/316.yml
|
368
|
+
- data/problems/317.yml
|
369
|
+
- data/problems/318.yml
|
370
|
+
- data/problems/319.yml
|
371
|
+
- data/problems/32.yml
|
372
|
+
- data/problems/320.yml
|
373
|
+
- data/problems/321.yml
|
374
|
+
- data/problems/322.yml
|
375
|
+
- data/problems/323.yml
|
376
|
+
- data/problems/324.yml
|
377
|
+
- data/problems/325.yml
|
378
|
+
- data/problems/326.yml
|
379
|
+
- data/problems/327.yml
|
380
|
+
- data/problems/328.yml
|
381
|
+
- data/problems/329.yml
|
382
|
+
- data/problems/33.yml
|
383
|
+
- data/problems/330.yml
|
384
|
+
- data/problems/331.yml
|
385
|
+
- data/problems/332.yml
|
386
|
+
- data/problems/333.yml
|
387
|
+
- data/problems/334.yml
|
388
|
+
- data/problems/335.yml
|
389
|
+
- data/problems/336.yml
|
390
|
+
- data/problems/337.yml
|
391
|
+
- data/problems/338.yml
|
392
|
+
- data/problems/339.yml
|
393
|
+
- data/problems/34.yml
|
394
|
+
- data/problems/340.yml
|
395
|
+
- data/problems/341.yml
|
396
|
+
- data/problems/342.yml
|
397
|
+
- data/problems/343.yml
|
398
|
+
- data/problems/344.yml
|
399
|
+
- data/problems/345.yml
|
400
|
+
- data/problems/346.yml
|
401
|
+
- data/problems/347.yml
|
402
|
+
- data/problems/348.yml
|
403
|
+
- data/problems/349.yml
|
404
|
+
- data/problems/35.yml
|
405
|
+
- data/problems/350.yml
|
406
|
+
- data/problems/351.yml
|
407
|
+
- data/problems/352.yml
|
408
|
+
- data/problems/353.yml
|
409
|
+
- data/problems/354.yml
|
410
|
+
- data/problems/355.yml
|
411
|
+
- data/problems/356.yml
|
412
|
+
- data/problems/357.yml
|
413
|
+
- data/problems/358.yml
|
414
|
+
- data/problems/359.yml
|
415
|
+
- data/problems/36.yml
|
416
|
+
- data/problems/360.yml
|
417
|
+
- data/problems/361.yml
|
418
|
+
- data/problems/362.yml
|
419
|
+
- data/problems/363.yml
|
420
|
+
- data/problems/364.yml
|
421
|
+
- data/problems/365.yml
|
422
|
+
- data/problems/366.yml
|
423
|
+
- data/problems/367.yml
|
424
|
+
- data/problems/368.yml
|
425
|
+
- data/problems/369.yml
|
426
|
+
- data/problems/37.yml
|
427
|
+
- data/problems/370.yml
|
428
|
+
- data/problems/371.yml
|
429
|
+
- data/problems/372.yml
|
430
|
+
- data/problems/373.yml
|
431
|
+
- data/problems/374.yml
|
432
|
+
- data/problems/375.yml
|
433
|
+
- data/problems/376.yml
|
434
|
+
- data/problems/377.yml
|
435
|
+
- data/problems/378.yml
|
436
|
+
- data/problems/379.yml
|
437
|
+
- data/problems/38.yml
|
438
|
+
- data/problems/380.yml
|
439
|
+
- data/problems/381.yml
|
440
|
+
- data/problems/382.yml
|
441
|
+
- data/problems/383.yml
|
442
|
+
- data/problems/384.yml
|
443
|
+
- data/problems/385.yml
|
444
|
+
- data/problems/386.yml
|
445
|
+
- data/problems/387.yml
|
446
|
+
- data/problems/388.yml
|
447
|
+
- data/problems/389.yml
|
448
|
+
- data/problems/39.yml
|
449
|
+
- data/problems/390.yml
|
450
|
+
- data/problems/391.yml
|
451
|
+
- data/problems/392.yml
|
452
|
+
- data/problems/393.yml
|
453
|
+
- data/problems/394.yml
|
454
|
+
- data/problems/395.yml
|
455
|
+
- data/problems/396.yml
|
456
|
+
- data/problems/397.yml
|
457
|
+
- data/problems/398.yml
|
458
|
+
- data/problems/399.yml
|
459
|
+
- data/problems/4.yml
|
460
|
+
- data/problems/40.yml
|
461
|
+
- data/problems/400.yml
|
462
|
+
- data/problems/401.yml
|
463
|
+
- data/problems/402.yml
|
464
|
+
- data/problems/403.yml
|
465
|
+
- data/problems/404.yml
|
466
|
+
- data/problems/405.yml
|
467
|
+
- data/problems/406.yml
|
468
|
+
- data/problems/407.yml
|
469
|
+
- data/problems/408.yml
|
470
|
+
- data/problems/409.yml
|
471
|
+
- data/problems/41.yml
|
472
|
+
- data/problems/410.yml
|
473
|
+
- data/problems/411.yml
|
474
|
+
- data/problems/412.yml
|
475
|
+
- data/problems/413.yml
|
476
|
+
- data/problems/414.yml
|
477
|
+
- data/problems/415.yml
|
478
|
+
- data/problems/416.yml
|
479
|
+
- data/problems/417.yml
|
480
|
+
- data/problems/418.yml
|
481
|
+
- data/problems/419.yml
|
482
|
+
- data/problems/42.yml
|
483
|
+
- data/problems/420.yml
|
484
|
+
- data/problems/421.yml
|
485
|
+
- data/problems/422.yml
|
486
|
+
- data/problems/423.yml
|
487
|
+
- data/problems/424.yml
|
488
|
+
- data/problems/425.yml
|
489
|
+
- data/problems/426.yml
|
490
|
+
- data/problems/427.yml
|
491
|
+
- data/problems/428.yml
|
492
|
+
- data/problems/429.yml
|
493
|
+
- data/problems/43.yml
|
494
|
+
- data/problems/430.yml
|
495
|
+
- data/problems/431.yml
|
496
|
+
- data/problems/432.yml
|
497
|
+
- data/problems/433.yml
|
498
|
+
- data/problems/434.yml
|
499
|
+
- data/problems/435.yml
|
500
|
+
- data/problems/436.yml
|
501
|
+
- data/problems/437.yml
|
502
|
+
- data/problems/438.yml
|
503
|
+
- data/problems/439.yml
|
504
|
+
- data/problems/44.yml
|
505
|
+
- data/problems/440.yml
|
506
|
+
- data/problems/441.yml
|
507
|
+
- data/problems/442.yml
|
508
|
+
- data/problems/443.yml
|
509
|
+
- data/problems/444.yml
|
510
|
+
- data/problems/445.yml
|
511
|
+
- data/problems/446.yml
|
512
|
+
- data/problems/447.yml
|
513
|
+
- data/problems/448.yml
|
514
|
+
- data/problems/449.yml
|
515
|
+
- data/problems/45.yml
|
516
|
+
- data/problems/450.yml
|
517
|
+
- data/problems/451.yml
|
518
|
+
- data/problems/452.yml
|
519
|
+
- data/problems/453.yml
|
520
|
+
- data/problems/454.yml
|
521
|
+
- data/problems/455.yml
|
522
|
+
- data/problems/456.yml
|
523
|
+
- data/problems/46.yml
|
524
|
+
- data/problems/47.yml
|
525
|
+
- data/problems/48.yml
|
526
|
+
- data/problems/49.yml
|
527
|
+
- data/problems/5.yml
|
528
|
+
- data/problems/50.yml
|
529
|
+
- data/problems/51.yml
|
530
|
+
- data/problems/52.yml
|
531
|
+
- data/problems/53.yml
|
532
|
+
- data/problems/54.yml
|
533
|
+
- data/problems/55.yml
|
534
|
+
- data/problems/56.yml
|
535
|
+
- data/problems/57.yml
|
536
|
+
- data/problems/58.yml
|
537
|
+
- data/problems/59.yml
|
538
|
+
- data/problems/6.yml
|
539
|
+
- data/problems/60.yml
|
540
|
+
- data/problems/61.yml
|
541
|
+
- data/problems/62.yml
|
542
|
+
- data/problems/63.yml
|
543
|
+
- data/problems/64.yml
|
544
|
+
- data/problems/65.yml
|
545
|
+
- data/problems/66.yml
|
546
|
+
- data/problems/67.yml
|
547
|
+
- data/problems/68.yml
|
548
|
+
- data/problems/69.yml
|
549
|
+
- data/problems/7.yml
|
550
|
+
- data/problems/70.yml
|
551
|
+
- data/problems/71.yml
|
552
|
+
- data/problems/72.yml
|
553
|
+
- data/problems/73.yml
|
554
|
+
- data/problems/74.yml
|
555
|
+
- data/problems/75.yml
|
556
|
+
- data/problems/76.yml
|
557
|
+
- data/problems/77.yml
|
558
|
+
- data/problems/78.yml
|
559
|
+
- data/problems/79.yml
|
560
|
+
- data/problems/8.yml
|
561
|
+
- data/problems/80.yml
|
562
|
+
- data/problems/81.yml
|
563
|
+
- data/problems/82.yml
|
564
|
+
- data/problems/83.yml
|
565
|
+
- data/problems/84.yml
|
566
|
+
- data/problems/85.yml
|
567
|
+
- data/problems/86.yml
|
568
|
+
- data/problems/87.yml
|
569
|
+
- data/problems/88.yml
|
570
|
+
- data/problems/89.yml
|
571
|
+
- data/problems/9.yml
|
572
|
+
- data/problems/90.yml
|
573
|
+
- data/problems/91.yml
|
574
|
+
- data/problems/92.yml
|
575
|
+
- data/problems/93.yml
|
576
|
+
- data/problems/94.yml
|
577
|
+
- data/problems/95.yml
|
578
|
+
- data/problems/96.yml
|
579
|
+
- data/problems/97.yml
|
580
|
+
- data/problems/98.yml
|
581
|
+
- data/problems/99.yml
|
582
|
+
- euler-manager.gemspec
|
583
|
+
- euler-manager.sublime-project
|
584
|
+
- example/1/README.md
|
585
|
+
- example/1/ruby/1.rb
|
586
|
+
- example/1/scala/1.scala
|
587
|
+
- example/2/README.md
|
588
|
+
- example/2/python/2.py
|
589
|
+
- example/2/python/euler.py
|
590
|
+
- example/Eulerfile.rb
|
591
|
+
- example/README.md
|
592
|
+
- example/lib/euler.py
|
593
|
+
- example/lib/euler.rb
|
594
|
+
- example/lib/euler.scala
|
595
|
+
- lib/euler.rb
|
596
|
+
- lib/euler/errors.rb
|
597
|
+
- lib/euler/languages.rb
|
598
|
+
- lib/euler/languages/coffeescript.rb
|
599
|
+
- lib/euler/languages/javascript.rb
|
600
|
+
- lib/euler/languages/python.rb
|
601
|
+
- lib/euler/languages/ruby.rb
|
602
|
+
- lib/euler/languages/scala.rb
|
603
|
+
- lib/euler/languages/templates/coffeescript.coffee
|
604
|
+
- lib/euler/languages/templates/javascript.js
|
605
|
+
- lib/euler/languages/templates/python.py
|
606
|
+
- lib/euler/languages/templates/ruby.rb
|
607
|
+
- lib/euler/languages/templates/scala.scala
|
608
|
+
- lib/euler/problem.rb
|
609
|
+
- lib/euler/solution.rb
|
610
|
+
- lib/euler/version.rb
|
611
|
+
- scripts/update_problems
|
612
|
+
- spec/euler/problem_spec.rb
|
613
|
+
- spec/euler/solution_spec.rb
|
614
|
+
- spec/euler_spec.rb
|
615
|
+
- spec/spec_helper.rb
|
616
|
+
homepage: https://github.com/yaworsw/euler-manager
|
617
|
+
licenses:
|
618
|
+
- MIT
|
619
|
+
metadata: {}
|
620
|
+
post_install_message:
|
621
|
+
rdoc_options: []
|
622
|
+
require_paths:
|
623
|
+
- lib
|
624
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
625
|
+
requirements:
|
626
|
+
- - ">="
|
627
|
+
- !ruby/object:Gem::Version
|
628
|
+
version: '0'
|
629
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
630
|
+
requirements:
|
631
|
+
- - ">="
|
632
|
+
- !ruby/object:Gem::Version
|
633
|
+
version: '0'
|
634
|
+
requirements: []
|
635
|
+
rubyforge_project:
|
636
|
+
rubygems_version: 2.0.3
|
637
|
+
signing_key:
|
638
|
+
specification_version: 4
|
639
|
+
summary: Manage and test project Euler problems from your command line.
|
640
|
+
test_files:
|
641
|
+
- spec/euler/problem_spec.rb
|
642
|
+
- spec/euler/solution_spec.rb
|
643
|
+
- spec/euler_spec.rb
|
644
|
+
- spec/spec_helper.rb
|