I'm fairly new to coding of any sort, and all I've done is some simple stuff on my calculator, a ti-nspire with a ti-84 keyboard, which if I'm not mistaken codes in Lua, I'm trying to learn how to do this, and im figuring it out but I have a problem that I don't have the slightest clue how to fix. I wrote a program that will factor the number I input, but I get a ton of useless decimals that I don't know how to prevent, effectively making it useless for any thing larger than 5 or 6.

Code:

Prompt A
A→X

Repeat D=A
A/X→D
display D
X-1→X
End
Hello, and welcome to Cemetech, GRAPE! If you get a change, please Introduce Yourself! I think I see that your program is in BASIC, not in Lua, so display would be Disp D. For your program, I assume A is the number to be factored right? You have a loop, where A is divided by each number from A to 1, and you will display the result with only 1 or 2 fraction decimals? That seems you should take a look at the round command. I hope this helps! If not, feel free to ask anything Smile
PT_ wrote:
Hello, and welcome to Cemetech, GRAPE! If you get a change, please Introduce Yourself! I think I see that your program is in BASIC, not in Lua, so display would be Disp D. For your program, I assume A is the number to be factored right? You have a loop, where A is divided by each number from A to 1, and you will display the result with only 1 or 2 fraction decimals? That seems you should take a look at the round command. I hope this helps! If not, feel free to ask anything Smile


Alright thanks I'll give that a shot, and is it BASIC? I thought it was Lua, well either way the stuff I looked up for Lua worked when I needed it
GRAPE wrote:
PT_ wrote:
Hello, and welcome to Cemetech, GRAPE! If you get a change, please Introduce Yourself! I think I see that your program is in BASIC, not in Lua, so display would be Disp D. For your program, I assume A is the number to be factored right? You have a loop, where A is divided by each number from A to 1, and you will display the result with only 1 or 2 fraction decimals? That seems you should take a look at the round command. I hope this helps! If not, feel free to ask anything Smile


Alright thanks I'll give that a shot, and is it BASIC? I thought it was Lua, well either way the stuff I looked up for Lua worked when I needed it


When the Nspire has the TI-84+ keypad plugged in, it behaves exactly like a TI-84+, which uses BASIC for programming. With the normal keypad, the Nspire uses it's OS, which can Lua programs written on a computer. People have made 3rd party editors that let you edit and run Lua code on the Nspire itself too. http://www.ticalc.org/archives/files/fileinfo/464/46492.html
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement