hey i need help with this program it is my first SUCCESSFUL game. it worked on the calc but when i type it in to my projects, it comes up with like 230 errors or something. i typed it in EXACTLY as it appeared on the calculator. it is on my projects. i set it so anyone can view it. since there are errors, i cant export it. its really annoying. i looked on the help thing, and.. well... HOW THE HECK SHOULD I KNOW WHAT A TYPO-BLABLA ERROR IS!?!...... sorry i got a little frustrated... Mad please help. Mad
we will need to see some code so we can attempt to fix the error.
oops.. hehe.. wait a minuite.... DANG IT! IT GOT MESSED UP WHEN IT SAVED.... oh well... doesnt matter...
dragonfyre wrote:
oops.. hehe.. wait a minuite.... DANG IT! IT GOT MESSED UP WHEN IT SAVED.... oh well... doesnt matter...
If you could tell me what the project name is, I could take a look....
KermMartian wrote:
dragonfyre wrote:
oops.. hehe.. wait a minuite.... DANG IT! IT GOT MESSED UP WHEN IT SAVED.... oh well... doesnt matter...
If you could tell me what the project name is, I could take a look....
sorry haven't been on in a while. its called "HUNTER" . my friend gave me the idea, i just made it for him.

On a side note..... i'm having ideas for a Mad Libs program in BASIC... if only i 1) had a link and 2)knew how to either store more than 10 word entries (since there are only 10 strings) or somehow get more strings..
I did some research in basic and found out that the length( command may help me to use more strings in this... any ideas? or.... another idea! Its a strech but.. i could use the getkey function! it would display what it presses.. it could use the delete key... and could be stored on a list... LMADLIBS... yeah! sorry, i have ADHD.
[quote="dragonfyre"][quote="KermMartian"]
dragonfyre wrote:
On a side note..... i'm having ideas for a Mad Libs program in BASIC... if only i 1) had a link and 2)knew how to either store more than 10 word entries (since there are only 10 strings) or somehow get more strings..
I did some research in basic and found out that the length( command may help me to use more strings in this... any ideas? or.... another idea! Its a strech but.. i could use the getkey function! it would display what it presses.. it could use the delete key... and could be stored on a list... LMADLIBS... yeah! sorry, i have ADHD.


You sir need to "chill" =D. You can store as many words as you freaking want in a single string... here's an easy way to do it:

:" " --> Str1
:For (N,1, Z
:Input ":", Str0
:Str1 + sub(Str0 + " ",1,10) -->Str1
:End

To input Z words of maximum length 10 characters
To read word number N, run this code

:sub(Str1, 10N - 8, 10) + " "-->Str0
:sub(Str0, 1, instring(Str0, " ") -1) -->Str0

now your word is in string 0.

I would suggest that you don't save your words to a list; oh and save yourself some effort and just use the input string function either way because

:input ":", Str0
:seq(instring("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ", sub(Str0,N,1)),N,1, length(Str0) -->L1

would do the same thing while being easier on you =D
Yup, string concatenation would indeed be the way to go here. In order to look up words in the string, just repeatedly do inString( with a starting offset of the previous instance +1.
And if the length of the string is unknown then you could simply do a for or while. Not sure if that was implied in your post Kerm ^^,
swivelgames wrote:
And if the length of the string is unknown then you could simply do a for or while. Not sure if that was implied in your post Kerm ^^,
It was indeed. Let's throw down some actual code (please correct me if I have mistakes; it's been quite some time since I've written TI-BASIC:


Code:
Given that the string is in Str1:
:1->P:While P and P<=length(Str1
P = inString(P,Str1,"[space]
S = inString(P+1,Str1,"[space]
If not(S:length(Str1->S
sub(Str1,P,P+S-1
Do stuff with the substring (Ans) here
S-1->P
swivelgames wrote:
And if the length of the string is unknown then you could simply do a for or while. Not sure if that was implied in your post Kerm ^^,
It was indeed. Let's throw down some actual code (please correct me if I have mistakes; it's been quite some time since I've written TI-BASIC:


Code:
--Given that the string is in Str1:--
:1->P:While P and P<=length(Str1
:P = inString(P,Str1,"[space]
:S = inString(P+1,Str1,"[space]
:If not(S:length(Str1->S
:sub(Str1,P,P+S-1
--Do stuff with the substring (Ans) here--
:S-1->P:End
KermMartian wrote:
swivelgames wrote:
And if the length of the string is unknown then you could simply do a for or while. Not sure if that was implied in your post Kerm ^^,
It was indeed. Let's throw down some actual code (please correct me if I have mistakes; it's been quite some time since I've written TI-BASIC:


Code:
--Given that the string is in Str1:--
:1->P:While P and P<=length(Str1
:P = inString(P,Str1,"[space]
:S = inString(P+1,Str1,"[space]
:If not(S:length(Str1->S
:sub(Str1,P,P+S-1
--Do stuff with the substring (Ans) here--
:S-1->P:End


Nice double post there =D

That code confuses me and your syntax is crazy. You havent even closed the While statement and you forgot to add "then"... BTW what's "inString(P, Str1, " ") -->P ....?



Code:
--Given that the string is in Str1 with each word seperated by a space:-- and Z is word number
:seq(N(sub(Str1,N,1)= " "),N,1, length(Str1))-->L1
:SortD(L1
:sum((L1=1))+1-->dim(l1
:SortA(L1
:1-->L1(1)
:sub(Str1, L1(Z), L1(Z+1)-L1(Z))
  
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