Author Topic: pretty up disp output  (Read 2355 times)

0 Members and 1 Guest are viewing this topic.

Offline Rhombicuboctahedron

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 437
  • Rating: +41/-6
    • View Profile
pretty up disp output
« on: January 17, 2013, 10:55:21 pm »
I’m sure I know of everything on the nspire and programming it, but is there a way to display a function and variable in a pretty manner?
I’m revisiting a program I made and it displays “1/6*pi^2”
Is there a way to display the symbol pi to an exponent and multiplied by a fraction without it being ugly or calculating a numeric value?

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: pretty up disp output
« Reply #1 on: January 17, 2013, 11:12:54 pm »
You could always try repeatedly dividing by pi, keeping track of how many times you've done it, and when you finally get a rational value, use the graphscreen trick to make that value into a string. From there, it's as simple as concatenating a "pi^" and the number to the end of the string.

EDIT: From my experience, making the output prettier is almost never worth it in BASIC. You're better off just displaying the value and making the users figure out how many pis are in it, the lazy sots.
« Last Edit: January 17, 2013, 11:14:08 pm by leafy »
In-progress: Graviter (...)

Offline Rhombicuboctahedron

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 437
  • Rating: +41/-6
    • View Profile
Re: pretty up disp output
« Reply #2 on: January 17, 2013, 11:24:55 pm »
Oh, no
I know how pi's are in it
It literally outputs in quotations 1/6 multiplication dot pi symbol caret symbol 2
It's okay, but not very pretty, and after a while it would be nice to have it be 1 over 6 instead of 1/6

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: pretty up disp output
« Reply #3 on: January 18, 2013, 09:27:24 am »
That could be possible, but I'd say it's not worth the effort.
I'm not a nerd but I pretend: