Author Topic: Circle Graphs  (Read 24632 times)

0 Members and 3 Guests are viewing this topic.

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Circle Graphs
« Reply #45 on: September 03, 2010, 08:29:13 pm »
Nice! The original program is 130. Does yours save the percentages to L2?

Yes here is code

Code: [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
:End

Edit Subscript dosen't seem to work in code

Ya, no form of BBCode works inside [code][/code].

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.

What's WYSIWIG?

Edit:
Code: (Optimized) [Select]
Degree
AxesOff
ZStandard (You need to have this...)
ZInteger
L1/sum(L1→L1
Circle(0,0,31
DelVarDFor(A,1,dim(L1
360L1(A→B
Line(0,0,31sin(B+D),31cos(B+D
D+B→D
End

It is now 86 bytes with a one letter name :)

@DeepThought: As meishe91 said "what's WYSIWIG?"

@meishe91: Thanks! Forgot about the ZStandard, in that case maybe include all the other graph commands as well? (Ex. FnOff, PlotsOff)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Circle Graphs
« Reply #46 on: September 03, 2010, 08:37:21 pm »
I don't think it really matters. You can though. All you really need are those two if you were gonna add any.

I have a question about your original one. Why were you storing one to A if you were using A for the loop? Or just a "oops" moment?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Circle Graphs
« Reply #47 on: September 03, 2010, 08:39:28 pm »
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

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Circle Graphs
« Reply #48 on: September 03, 2010, 08:40:07 pm »
Code: ( more optimized) [Select]
Degree
AxesOff
ZStandard
ZInteger:0
Circle(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(L1
Ans+360L1(Z)/sum(L1
Line(0,0,30sin(Ans),30cos(Ans
End

no need to use external variables if you arent storing to L2 for percentages of the circle.
edit: 71 bytes with a 1 letter name.
« Last Edit: September 03, 2010, 08:40:39 pm by nemo »


Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Circle Graphs
« Reply #49 on: September 03, 2010, 08:42:24 pm »
Code: ( more optimized) [Select]
Degree
AxesOff
ZStandard
ZInteger:0
Circle(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(L1
Ans+360L1(Z)/sum(L1
Line(0,0,30sin(Ans),30cos(Ans
End

no 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"

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Circle Graphs
« Reply #50 on: September 03, 2010, 08:42:47 pm »
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

Ya, I know. But that's weird that it was giving you an error. You don't really need it, unless my calculator is just bomb like that :P

Code: ( more optimized) [Select]
Degree
AxesOff
ZStandard
ZInteger:0
Circle(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(L1
Ans+360L1(Z)/sum(L1
Line(0,0,30sin(Ans),30cos(Ans
End

no need to use external variables if you arent storing to L2 for percentages of the circle.
edit: 71 bytes with a 1 letter name.

Oh ya, nice! I keep forgetting to do stuff like that :P

Code: ( more optimized) [Select]
Degree
AxesOff
ZStandard
ZInteger:0
Circle(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(L1
Ans+360L1(Z)/sum(L1
Line(0,0,30sin(Ans),30cos(Ans
End

no 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"

I don't think anyone really does. It's just an undocumented trick that when you draw a circle using that command if you have an imaginary list as the fourth argument then it draws them faster.
« Last Edit: September 03, 2010, 08:43:59 pm by meishe91 »
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Circle Graphs
« Reply #51 on: September 03, 2010, 08:43:26 pm »
I don't know too much about 83/84 BASIC, but I believe that {i makes the circle draw faster.


Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Circle Graphs
« Reply #52 on: September 03, 2010, 08:43:46 pm »
the {i, the i being the imaginary i, [2nd] [.], makes the calculator draw the circle 8 times faster. cause TI's dumb.


Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Circle Graphs
« Reply #53 on: September 03, 2010, 08:44:34 pm »
Why does it do it faster? i never even heard of the imaginary i being used this way before.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Circle Graphs
« Reply #54 on: September 03, 2010, 08:45:33 pm »
no idea. it's just something TI added in.
other things are Line(X1,Y1,X2,Y2,[0]) will make the line be a black or white line, and Text([-1],X,Y makes small or large text.


Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Circle Graphs
« Reply #55 on: September 03, 2010, 08:45:41 pm »
Why does it do it faster? i never even heard of the imaginary i being used this way before.

Like I said, I don't think anyone knows really.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Circle Graphs
« Reply #56 on: September 03, 2010, 08:47:01 pm »
It's an undocumented TI-BASIC function that never got assigned an actual command or real syntax.

It's like Text(-1,Y,X,"Text") to display large fonts on the graph screen.

On the old 83 from 1996, you could run ASM games from the home screen, but TI had yet to assign a token to the ASM running command, so instead of Asm(prgmNAME), it was Send(9prgmNAME), and the 9 here is not a typo.

All those 3 things are not documented by TI. The former was only discovered around 2006, though, and the Text one was only widely known by 2004, despite Basic Guru Online having talked about it in 2000-2001.
« Last Edit: September 03, 2010, 08:48:38 pm by DJ Omnimaga »

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Circle Graphs
« Reply #57 on: September 03, 2010, 08:48:20 pm »
Stupid random TI

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Circle Graphs
« Reply #58 on: September 03, 2010, 08:48:42 pm »
I bet it was for their Apps that graphed data input, so they could brag that they write software better than anyone else :P

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Circle Graphs
« Reply #59 on: September 03, 2010, 09:31:24 pm »
Quote
What's WYSIWIG?

WYSIWYG stands for What You See Is What You Get.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.