Unify template to be similar to the Python one
This commit is contained in:
parent
63ef2fe6b5
commit
75d29d32e6
@ -3,9 +3,9 @@
|
|||||||
Creation of templates for the problems of Project Euler
|
Creation of templates for the problems of Project Euler
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
|
||||||
import datetime
|
import datetime
|
||||||
import inspect
|
import inspect
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
|
||||||
def create_problem():
|
def create_problem():
|
||||||
@ -18,13 +18,13 @@ def create_problem():
|
|||||||
@author: David Doblas Jiménez
|
@author: David Doblas Jiménez
|
||||||
@email: daviddoji@pm.me
|
@email: daviddoji@pm.me
|
||||||
|
|
||||||
Solution for Problem {args['problem']} of Project Euler
|
Solution for Problem {args['problem']:0>3} of Project Euler
|
||||||
https://projecteuler.net/problem={args['problem']}
|
https://projecteuler.net/problem={args['problem']}
|
||||||
=#
|
=#
|
||||||
|
|
||||||
using BenchmarkTools
|
using BenchmarkTools
|
||||||
|
|
||||||
function Problem{args['problem']}()
|
function Problem{args['problem']:0>3}()
|
||||||
#=
|
#=
|
||||||
Statement
|
Statement
|
||||||
=#
|
=#
|
||||||
@ -32,20 +32,19 @@ def create_problem():
|
|||||||
# Your code goes here
|
# Your code goes here
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
println("Time to evaluate Problem $(lpad({args['problem']}, 3, "0")):")
|
|
||||||
@btime Problem{args['problem']}()
|
println("Took:")
|
||||||
|
@btime Problem{args['problem']:0>3}()
|
||||||
println("")
|
println("")
|
||||||
println("Result for Problem $(lpad({args['problem']}, 3, "0")): ", Problem{args['problem']}())
|
println("Result for Problem $(lpad({args['problem']}, 3, "0")): ", Problem{args['problem']:0>3}())
|
||||||
"""
|
""" # noqa: E501
|
||||||
)
|
)
|
||||||
|
|
||||||
f.write(template)
|
f.write(template)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
today = datetime.datetime.now().strftime("%d %b %Y")
|
today = datetime.datetime.now().strftime("%d %b %Y")
|
||||||
parser = ArgumentParser(description=__doc__)
|
parser = ArgumentParser(description=__doc__)
|
||||||
# Add your arguments here
|
# Add your arguments here
|
||||||
|
Loading…
x
Reference in New Issue
Block a user