use algorithmatic.com's in-browser integrated-development-environment here. The IDE offers syntax-highlighting, realtime validation, syntax-autocompletion, autocompletion for external-calls, interpreter and basic debugging.
Account
signin
algorithmatic.com uses OpenID - that means you don't need to register, probably you already have an OpenID, you just need to enable it. Click here to sign in
Very cool. I fixed the title and removed the note you left about it.
However, I noticed that you are printing the output in every iteration. So if you enter a big number, each element will be printed by its self, which means the browser will be called N number of times (N is the number of elements). That's a lot of interoperability between the browser and your algorithm. A better approach would be to append the result to a string and once executed you print that string.
More importantly however, is that the output is a string and the code is not following Algorithmatic's code structure which to allow external calls. This means that your code cannot be reused in other future algorithms by other users. See "Algorithmatic Object" in the Reference Manual in the wiki. I suggest you return an array, which makes it much easier to consume the output.
However, I noticed that you are printing the output in every iteration. So if you enter a big number, each element will be printed by its self, which means the browser will be called N number of times (N is the number of elements). That's a lot of interoperability between the browser and your algorithm. A better approach would be to append the result to a string and once executed you print that string.
More importantly however, is that the output is a string and the code is not following Algorithmatic's code structure which to allow external calls. This means that your code cannot be reused in other future algorithms by other users. See "Algorithmatic Object" in the Reference Manual in the wiki. I suggest you return an array, which makes it much easier to consume the output.
Peace out!