Login
Back to forumSee the full topicGo to last reply

Posted By

Csabo
on 2016-11-01
14:42:34
 Re: Text in circle in Basic

Works, but it really needs some more attention detail.
- Fix the issue JamesC pointed out.
- Line 310 refers to a non-existent line.

The rest is optimization. There's many things that could be done, just a few really glaring ones:
- GOSUB 300 in line 70 should be avoided. GOSUBs are costly, and this routine is only called once. It makes the code unnecessarily slow.
- IF X <> 0, well, when you think about it, X can only be greater than zero, so X>0 would already be better, but in BASIC, the "perfect" solution is "IF X THEN" (which is true for any non-zero number).
- SIN(C) and COS(C) is used twice, but this a very costly calculation. The same exact value is unnecessary calculated 16 times in the loop! You can just pre-calculate both of those in the beginning of the C loop.

Good luck and happy coding!



Back to top


Copyright © Plus/4 World Team, 2001-2024