June 03, 2020, 07:36:57 pm

The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

 WARNING: DO NOT UPGRADE your TI-83 Premium CE or TI-84 Plus CE to OS 5.5.1 and higher. It removes all compatibility with most games and removes ASM/C programming! DOWNGRADING IS IMPOSSIBLE. BE WARNED!Likewise, do NOT update your TI-Nspire CX past OS 4.5.0, else using Ndless and ASM/C programs will be impossible.

Potential Energy Calculation

Started by Timmiez, June 04, 2018, 02:56:58 am

0 Members and 1 Guest are viewing this topic.

Timmiez

June 04, 2018, 02:56:58 amLast Edit: June 04, 2018, 03:03:11 am by Timmiez
Program originally written on TI-83 Plus:

Apparently I found out I'm quite lazy when it comes to solving equations in my science classroom, so I kinda decided to make a program that solves the answer based on the input. Though being simple for a program I made with simple knowledge.

`ClrHomeDisp "INPUT TYPE:","","VARS: (P,M,H)"Prompt  0 If 0=P:ThenClrHomeDisp "POTE CALC","","INPUT: (J)"Prompt M,HM(9.8)H→ADisp AElseEndIf 0=M:ThenClrHomeDisp "POTE MASS CALC:","","INPUT: (KG)"Prompt P,HP/(9.8*H)→BDisp BElseEndIf 0=H:ThenClrHomeDisp "POTE HEIG CALC:","","INPUT: (M)"Prompt P,MP/(9.8*M)→CDisp CElseEnd`

A lot of editing of the code has had made it functional as you see it know, if you were to own a graphing calculator yourself, don't hesitate to try it out yourself, you may appreciate it.

Although to a separate topic, for those know don't know me, I'm a Freshman at my local high school and planning in enrolling in graphic design and web development. I have a great passion for programming and would love to learn any language I could grasp and soon learn. But with little information shared 'bout myself, I may post here and talk on the Discord a little more often when I come around to it. Gotz to get used to the crowd n' all.

_iPhoenix_

June 04, 2018, 05:55:24 am #1
Welcome to CodeWalrus!

With If-Then-Else-End conditionals, you can skip the Else if you don't need it. It'll be faster and smaller!

Additionally, you don't need quotes, parentheses, braces, or brackets at the end of a line or immediately before a store arrow. This is a weird quirk if TI-BASIC, but it saves quite a few bytes in the long run

Please spam here: https://legend-of-iphoenix.github.io/spam/

"walruses are better than tuxedo chickens, all hail the great " ~ me
Evolution of my avatar: