Result “almost doubles” on Try It Online for Project Euler

28 views Asked by At

This code is for Project Euler Problem 1. It appears to work here, but on Try It Online (tio.run) the result appears to "almost double" (twice the expected result minus 1). It seems like every number is added twice. Is it possible to fix it?

`,`                              /-------\
`,`                            .->---{+}-~-$#&
`,`                     /------->-----^  |
`,`                    /*\     /*\    |  |
`,`                /---~-+\/---~-+\   |  |
`,`                |   ! |||   ! ||   |  |
`,` .-#1000->*-{-}-*#3[%]|\*#5[%]|\*#0/  |
`,`         |\#1/  \---/ | \---/ | |     |
`,`         |            \------->->-----*
`,`         \----------------------------/

Test case for smaller constant:

`,`                              /-------\
`,`                            .->---{+}-~-$#&
`,`                     /------->-----^  |
`,`                    /*\     /*\    |  |
`,`                /---~-+\/---~-+\   |  |
`,`                |   ! |||   ! ||   |  |
`,` .-#10--->*-{-}-*#3[%]|\*#5[%]|\*#0/  |
`,`         |\#1/  \---/ | \---/ | |     |
`,`         |            \------->->-----*
`,`         \----------------------------/

(Prints 23 on Aaron, and 45 on Try It Online)

0

There are 0 answers