This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
tunt


Newbie


Joined: 01 Jun 2010
Posts: 9

Posted: 12 Jan 2011 03:42:10 pm    Post subject:

the subject: recently we learned about hexometers(a certain way to recite Latin poetry) and I was wondering if i could make a ti-basic program wich would
automatically seperate the verses.
the problem: when i was thinking about it I found one BIG problem:I didn't know if it was possible to ask the calculator is a certain letter
was placed before or after another letter.
Example: prgmHexo

Input "sentence?",str1 //asks for the string to be seperated
check if the letter U is placed before or after the letter I in the sentence//PROBLEM(and i would like to do this with all the letters needed)
then:place a /
end

as you can see im stuck on the second line
i thought this could be done using instring( and sub(,but i can't seem to figure out the problem myself
help?
(sorry for possible spelling mistakes )
Back to top
Sleight


Newbie


Joined: 22 Nov 2010
Posts: 9

Posted: 12 Jan 2011 10:59:48 pm    Post subject:

Tunt wrote:

the subject: recently we learned about hexometers(a certain way to recite Latin poetry) and I was wondering if i could make a ti-basic program wich would
automatically seperate the verses.
the problem: when i was thinking about it I found one BIG problem:I didn't know if it was possible to ask the calculator is a certain letter
was placed before or after another letter.
Example: prgmHexo

Input "sentence?",str1 //asks for the string to be seperated
check if the letter U is placed before or after the letter I in the sentence//PROBLEM(and i would like to do this with all the letters needed)
then:place a /
end

as you can see im stuck on the second line
i thought this could be done using instring( and sub(,but i can't seem to figure out the problem myself
help?
(sorry for possible spelling mistakes )


Actually, it isn't that hard at all. All you need are the commands for dealing with strings, which can only be found in the catalog. (conveniently hidden by TI)
Specifically, what you need is the "sub" command. (which is short for SUBstring)
TI|BD has a nice page on it here

In short here's what it does: it takes three arguments, a string, a beginning index, and how many letters to get.
Then, it returns a string from inside the first argument (thus sub-string), starting from the index specified by the second argument, and the third argument determines the length of the string.

Here's an example:

Code:

Disp sub("hexometer", 2,3

This would display "exo" to the homescreen.

This should be enough to create your program, although you probably would also want the length( and inString( commands, which are (of course) all hidden in the catalog. More information on strings in general can be found here.

Hope this helps
Back to top
tunt


Newbie


Joined: 01 Jun 2010
Posts: 9

Posted: 13 Jan 2011 11:33:41 am    Post subject:

i do know all those commands,and i've also read those pages at tibasicdev a while ago,but i dont know how to use them in this problem...
how can a sub( command check if A is placed before a double D (as an example)in the string the user has inserted?
Back to top
tunt


Newbie


Joined: 01 Jun 2010
Posts: 9

Posted: 13 Jan 2011 11:36:29 am    Post subject:

btw: i made a stupid mistake:its called hexAmeter,not hexometer
Back to top
Sleight


Newbie


Joined: 22 Nov 2010
Posts: 9

Posted: 13 Jan 2011 03:53:04 pm    Post subject:

Tunt wrote:

i do know all those commands,and i've also read those pages at tibasicdev a while ago,but i dont know how to use them in this problem...
how can a sub( command check if A is placed before a double D (as an example)in the string the user has inserted?


Like this :

Code:

If sub(str1,X,1)="A" and sub(str1,X+1,2)="DD"
//where X is the spot that you are checking (possible gotten from inString)

I suppose if you are asking if there is some specific command to do just what you are saying, then no, there isn't one, but you don't really need one either.
I could help you with the program if I knew exactly what you were trying to do.
Back to top
tunt


Newbie


Joined: 01 Jun 2010
Posts: 9

Posted: 14 Jan 2011 11:23:33 am    Post subject:

Sleight wrote:

Tunt wrote:

i do know all those commands,and i've also read those pages at tibasicdev a while ago,but i dont know how to use them in this problem...
how can a sub( command check if A is placed before a double D (as an example)in the string the user has inserted?


Like this :

Code:

If sub(str1,X,1)="A" and sub(str1,X+1,2)="DD"
//where X is the spot that you are checking (possible gotten from inString)

I suppose if you are asking if there is some specific command to do just what you are saying, then no, there isn't one, but you don't really need one either.
I could help you with the program if I knew exactly what you were trying to do.



oh,ok,i get what you mean right now.
well,what i'm actually trying to do is making a program for hexameters(check this link http://en.wikipedia.org/wiki/Hexameter if you don't know what that is)
my program would automatically seperate the 6verses with / (or place them underneath eachother or something like that)
now the next question is: do I have to make a string or a list with all the possible letters and double letters(like dd,qu(but this counts as 1letter in latin),bb,a,f etc).
i also have to check for double letters because if so the letter in front of it would be a long vowel etc(check the link for further information!)
Do i have to put in all possible possibilities or is there an other way to do this?
just making a str(ABCDEFGHIJKLMNOPQRSTUVWXYZ) won't do becuz my program won't check for (for example) VX(2 consonants)

Is there in ti-BASIC a way to check if a letter is a vowel or a consonant??


Last edited by Guest on 14 Jan 2011 11:24:01 am; edited 1 time in total
Back to top
tunt


Newbie


Joined: 01 Jun 2010
Posts: 9

Posted: 14 Jan 2011 11:41:05 am    Post subject:

here's an example of what im' trying to do:

-the user's inserts a string like "Ille fugit fugiensque :'Manus complexibus aufer!'"
-then the calculator seperates the verses: Ille fug / it fug / iensque: "Man / us com / plexibus / aufer!" = 6verses
that's it


Last edited by Guest on 14 Jan 2011 11:42:19 am; edited 1 time in total
Back to top
Sleight


Newbie


Joined: 22 Nov 2010
Posts: 9

Posted: 14 Jan 2011 04:22:05 pm    Post subject:

Yes, I realize this, but what are the rules for separating the verses?
Back to top
tunt


Newbie


Joined: 01 Jun 2010
Posts: 9

Posted: 15 Jan 2011 05:24:13 am    Post subject:

(read last sentence first(black))oh,thats getting compicated..

here's a good page with all the rules http://www.skidmore....r/metintro.html
if you understand this you can skip the rest of the text

the first syllabe of a verse is ALWAYS long
the vowel in front of 2 consonants is always long but: qu counts as 1 consonant ,x is a double consonant, and a I as the first letter of a word counts a j (like in iuvenis=juvenis)
and remember: it doesnt matter where the word ends, for example: iuvenis fertur would be iuven i s fertur where the letter I would be long(before s and f)
there are two ways words can be seperated: long short short or long long
the 5th verse and 6th verse are easy because they are always the same: the 5th verse is always long short short and the sixth verse is long long(or sometimes long short),
to know wherethe fifth verse start just count 5 syllabes back from the end of the sentence.

example? Nec tenu es undas: ad publica munera veni
the 5th verse starts here at mun from munera(count 5back) and would be long(mun) short(er) short(a),the sixth verse start at veni and is long(ven) long(i)
to know all the other verses first look for double consonants. we can find them in nec tenu so Nec is long(however,we already knew that becuz the first syllabe of a verse is always long),in undas so u is long etc...
if you have done this you would get something like Nec tenu es undas: ad publica munera veni.
when you add all other rules(here i must refer to the link because its impossible to explainall rules in this post)the sentence can only be Nec tenu/es un/das: ad/ publica/ munera/veni

i do understand this could be way too complicated if you don't understand Latin,and it's not really that important for you to know all these.
i just need to know from you if it is possible to add all these rules in a program...


btw.thx fo trying to help me


Last edited by Guest on 15 Jan 2011 05:25:55 am; edited 1 time in total
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 16 Jan 2011 10:10:04 pm    Post subject:

Tunt wrote:

Is there in ti-BASIC a way to check if a letter is a vowel or a consonant??


The best way I know is to do:

Code:

If inString("AEIOU",sub(Str1,x,1


X is the letter you are checking
Back to top
tunt


Newbie


Joined: 01 Jun 2010
Posts: 9

Posted: 17 Jan 2011 11:46:12 am    Post subject:

oh, i see
thx
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 17 Jan 2011 03:16:04 pm    Post subject:

It's not a problem. I've made a few programs that use that technique (like with hangman to test if a letter has been used yet) so it is one I am familiar with.
Back to top
tunt


Newbie


Joined: 01 Jun 2010
Posts: 9

Posted: 18 Jan 2011 12:53:49 pm    Post subject:

i also made a hangman but whitout that technique;)
Back to top
Xeda112358


Active Member


Joined: 19 May 2009
Posts: 520

Posted: 18 Jan 2011 03:36:26 pm    Post subject:

Ah, cool. Hmm, I kinda wanna make a minigame challenge now, but I am not sure... My BASIC skills are kind of poor now that I have been doing hybrid BASIC and assembly for the past two years, but I need to practice...
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement