0 Members and 2 Guests are viewing this topic.
Quote from: guy6020665 on September 03, 2010, 07:58:07 pmQuote from: Deep Thought on September 03, 2010, 07:52:59 pmNice! The original program is 130. Does yours save the percentages to L2?Yes here is codeCode: [Select]:Degree:AxesOff:ZInteger:L1/(sum(L1))->L2:Circle(0,0,31:1->A:0->D:For(A,1,dim(L2:360*L2(A)->B:Line(0,0,31*sin(B+D),31*cos(B+D)):D+B->D:EndEdit Subscript dosen't seem to work in codeYa, no form of BBCode works inside [code][/code].Quote from: Deep Thought on September 03, 2010, 08:00:35 pmOh yeah, you could divide the entire list L1 by a number!Great job. Now try optimizing the exploded version...EDIT: No, code is WYSIWIG. You can use [ tt ] [ /tt ] instead.What's WYSIWIG?Edit:Code: (Optimized) [Select]DegreeAxesOffZStandard (You need to have this...)ZIntegerL1/sum(L1→L1Circle(0,0,31DelVarDFor(A,1,dim(L1360L1(A→BLine(0,0,31sin(B+D),31cos(B+DD+B→DEndIt is now 86 bytes with a one letter name
Quote from: Deep Thought on September 03, 2010, 07:52:59 pmNice! The original program is 130. Does yours save the percentages to L2?Yes here is codeCode: [Select]:Degree:AxesOff:ZInteger:L1/(sum(L1))->L2:Circle(0,0,31:1->A:0->D:For(A,1,dim(L2:360*L2(A)->B:Line(0,0,31*sin(B+D),31*cos(B+D)):D+B->D:EndEdit Subscript dosen't seem to work in code
Nice! The original program is 130. Does yours save the percentages to L2?
:Degree:AxesOff:ZInteger:L1/(sum(L1))->L2:Circle(0,0,31:1->A:0->D:For(A,1,dim(L2:360*L2(A)->B:Line(0,0,31*sin(B+D),31*cos(B+D)):D+B->D:End
Oh yeah, you could divide the entire list L1 by a number!Great job. Now try optimizing the exploded version...EDIT: No, code is WYSIWIG. You can use [ tt ] [ /tt ] instead.
DegreeAxesOffZStandard (You need to have this...)ZIntegerL1/sum(L1→L1Circle(0,0,31DelVarDFor(A,1,dim(L1360L1(A→BLine(0,0,31sin(B+D),31cos(B+DD+B→DEnd
DegreeAxesOffZStandardZInteger:0Circle(0,0,30,{i .i know, more memory consuming but like 8 times faster. i think the 3 bytes are worth it.For(Z,1,dim(L1Ans+360L1(Z)/sum(L1Line(0,0,30sin(Ans),30cos(AnsEnd
Code: ( more optimized) [Select]DegreeAxesOffZStandardZInteger:0Circle(0,0,30,{i .i know, more memory consuming but like 8 times faster. i think the 3 bytes are worth it.For(Z,1,dim(L1Ans+360L1(Z)/sum(L1Line(0,0,30sin(Ans),30cos(AnsEndno need to use external variables if you arent storing to L2 for percentages of the circle.edit: 71 bytes with a 1 letter name.
A BASIC For( loop doesn't change the variable and if i didn't change it it would either give a dim error or just skip the loop altogether
Quote from: nemo on September 03, 2010, 08:40:07 pmCode: ( more optimized) [Select]DegreeAxesOffZStandardZInteger:0Circle(0,0,30,{i .i know, more memory consuming but like 8 times faster. i think the 3 bytes are worth it.For(Z,1,dim(L1Ans+360L1(Z)/sum(L1Line(0,0,30sin(Ans),30cos(AnsEndno need to use external variables if you arent storing to L2 for percentages of the circle.edit: 71 bytes with a 1 letter name.Nice, but i don't understand the "{i"
Why does it do it faster? i never even heard of the imaginary i being used this way before.
What's WYSIWIG?