TI 83/84
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me



Go Back   Dev Hardware ForumsSOFTWARETI 83/84

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Hardware Forums Sponsor:
  Trader Rating: 0 · #1  
Old November 22nd, 2012, 04:11 PM
Inferno1996 Inferno1996 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 Inferno1996 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 4 sec
Reputation Power: 0
Any Improvement Suggestions?

So I started programming yesterday and I created an addition game to help me get familiar with coding. Is there any way to make the coding simpler of this game? The coding for the game is below. (BTW -> is the STO arrow)

PROGRAM:ADDGAME
ClrHome
randInt (1,100)->X
randInt (1,100)->Y
Disp X, "+", Y
(X+Y)->Z
N=1
Prompt A
If A=Z
Then
Disp "CORRECT"
N+1->N
Disp "STREAK",N
Disp
Pause
prgmADDGAME
Else
ClrHome
Disp "INCORRECT"
Disp "YOU SAID", A
Disp "ANSWER WAS", Z
Disp "PRESS ENTER"
Pause
ClrHome
Disp "SCORE", N
Pause
0->N
Disp "1 TO RESTART"
Disp "2 TO QUIT"
Prompt A
If A=1
Then
prgmADDGAME
Else
ClrHome
Disp "GAME QUIT"
Disp "PRESS ENTER"
Pause
prgmNOTHING


prgmNOTHING just contains ClrHome

The program works great I just want to know if it can be simplified. I also want to implement a record system to remember your highest score. I though that:

S=1
If S>N
Then
N->S

would work (S being record score) but it doesnt. Any suggestions? Thanks

Reply With Quote
  Trader Rating: 0 · #2  
Old November 27th, 2012, 01:25 PM
tifreak8x tifreak8x is offline
Contributing User
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2011
Location: USA
Posts: 45 tifreak8x User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 4 m 20 sec
Reputation Power: 2
Send a message via AIM to tifreak8x
Ooooh, where to start.

Ok, for starters, you should never call the host program within itself, it is a huge cause for memory leaks and is just plain messy.

For you starting out, I'd recommend the use of Lbl and Goto. http://tifreakware.net/tutorials/83p/b/tifw/les5.htm should work nicely in explaining those commands. This will clear up some of that code.

If prgmNOTHING merely contains 'ClrHome', then why not just have 'ClrHome' dropped there instead, and let it exit naturally?

The link I gave above also gives more to other tutorials, plus a helpful forum if you would like to sign up and ask questions that will also draw in a great many other people to be able to answer.

Oh, and to store scores, you'd want a list, which can be found in the tutorial.. http://tifreakware.net/tutorials/83p/b/tifw/les3.htm

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWARETI 83/84 > Any Improvement Suggestions?


Developer Shed Affiliates

 


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
     
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap