From c065f1dc0560a06f7560a4077b6ab9365928c568 Mon Sep 17 00:00:00 2001 From: 0dminnimda <0dminnimda@gmail.com> Date: Tue, 12 Oct 2021 18:41:50 +0300 Subject: [PATCH 1/3] Create problem09.porth --- euler/problem09.porth | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 euler/problem09.porth diff --git a/euler/problem09.porth b/euler/problem09.porth new file mode 100644 index 00000000..ef72a394 --- /dev/null +++ b/euler/problem09.porth @@ -0,0 +1,21 @@ +include "std.porth" + +macro sum 1000 end + +sum +1 while over over >= do + 1 while over over >= do + 2dup over dup * over dup * + + rot rot + + sum swap - + if 2dup dup * = do + swap drop print + 2dup swap print print + 0 exit // can be commented to test that it's the only one solution + else + 2drop + end + 1 + + end drop + 1 + +end 2drop From 07fc34a44c317f8e32b95d79a896773b8b5040f8 Mon Sep 17 00:00:00 2001 From: 0dminnimda <0dminnimda@gmail.com> Date: Tue, 12 Oct 2021 18:41:56 +0300 Subject: [PATCH 2/3] Create problem09.txt --- euler/problem09.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 euler/problem09.txt diff --git a/euler/problem09.txt b/euler/problem09.txt new file mode 100644 index 00000000..03c61026 --- /dev/null +++ b/euler/problem09.txt @@ -0,0 +1,11 @@ +:i argc 0 +:b stdin 0 + +:i returncode 0 +:b stdout 12 +425 +375 +200 + +:b stderr 0 + From 8cd3b9eb5e271b58e7127ead8c71548c9b0b1345 Mon Sep 17 00:00:00 2001 From: 0dminnimda <0dminnimda@gmail.com> Date: Tue, 12 Oct 2021 18:41:59 +0300 Subject: [PATCH 3/3] Update .gitignore --- euler/.gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/euler/.gitignore b/euler/.gitignore index 9735f282..fd9a81d9 100644 --- a/euler/.gitignore +++ b/euler/.gitignore @@ -4,4 +4,5 @@ problem03 problem04 problem05 problem06 -problem07 \ No newline at end of file +problem07 +problem09