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 December 7th, 2007, 01:15 PM
ti-kid ti-kid is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 1 ti-kid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 50 sec
Reputation Power: 0
Question Strings to Chars

hey im trying to figure out if theres a way to separate a string into individual characters... I'm trying to write a hangman program so if anyone has any ideas?

Reply With Quote
  Trader Rating: 0 · #2  
Old January 31st, 2008, 05:17 PM
attme100 attme100 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 20 attme100 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 44 sec
Reputation Power: 0
sub("???",begin,length
the "???" is the string, it can be typed out or it can be str1,str2 etc
begin is the character to start on ex 2 will start on the second character
length is how many characters it goes
example:
sub("abcdefghijklmnopqrstuvwxyz",3,3
will give u "cde" in ans

Reply With Quote
  Trader Rating: 0 · #3  
Old February 4th, 2008, 04:13 PM
pwnz32 pwnz32 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 15 pwnz32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 37 sec
Reputation Power: 0
Thanks, i never new about that sub() thing, Anyone know how to combine strings?

Reply With Quote
  Trader Rating: 0 · #4  
Old February 5th, 2008, 03:47 PM
attme100 attme100 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 20 attme100 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 44 sec
Reputation Power: 0
combining strings is easy as +
"???"+"???" will give you "??????"
str1+str2 gives you string 1 with string 2 attached at the end
str1+"???" gives you string with 3 ?s at the end

Reply With Quote
  Trader Rating: 0 · #5  
Old February 6th, 2008, 05:26 PM
pwnz32 pwnz32 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 15 pwnz32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 37 sec
Reputation Power: 0
Sweet that makes my life a whole lot easier lol

Reply With Quote
  Trader Rating: 0 · #6  
Old February 7th, 2008, 02:25 AM
drumz0rz's Avatar
drumz0rz drumz0rz is offline
Call of Duty 4
Click here for more information
 
Join Date: Jun 2004
Location: NY
Posts: 5,062 drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)  Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 5 Days 1 h 20 m 4 sec
Reputation Power: 3802
Send a message via AIM to drumz0rz Send a message via Google Talk to drumz0rz Send a message via XFire to drumz0rz
just for your reference, wht attme100 described is called Concatenation, and it's in pretty much every language out there.

Also, if you wanted, you could do str3=str1+str2. That would let you concatenate the 2 strings, into str3, while leaving 1 and 2 unchanged (and thus still usable later in the program, if you needed to).
__________________



Reply With Quote
  Trader Rating: 0 · #7  
Old February 7th, 2008, 05:02 PM
attme100 attme100 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 20 attme100 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 44 sec
Reputation Power: 0
...no, str3=str1 + str2 does not combine string 1 and 2 into 3
what happens with this line is it tests str1+str2 and checks if it matches up to str3
ex: str1 is abc, str2 is def
if str3 is abcdef, the line str3=str1+str2 will give you a 1 (true)
if str3 does not equal abcdef, it will give you a 0 (false)
if the = is just your representation of the store arrow im sorry

Reply With Quote
  Trader Rating: 0 · #8  
Old February 7th, 2008, 05:06 PM
attme100 attme100 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 20 attme100 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 44 sec
Reputation Power: 0
if you are writing a hangman program this command could also be useful:
instring(string,string to look for,(optional starting point)
for example
instring("abcdc","c"
will give you 3 as "c" is the third letter in the first string
you can alter it with an added command at the end like so
instring("abcdc","c",4
so that it starts looking for "c" at the 4th letter
the line above will return a 5 in ans

Reply With Quote
  Trader Rating: 0 · #9  
Old February 7th, 2008, 05:21 PM
drumz0rz's Avatar
drumz0rz drumz0rz is offline
Call of Duty 4
Click here for more information
 
Join Date: Jun 2004
Location: NY
Posts: 5,062 drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)drumz0rz User rank is General 42nd Grade (Above 100000 Reputation Level)  Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1Folding Points: 398324 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 5 Days 1 h 20 m 4 sec
Reputation Power: 3802
Send a message via AIM to drumz0rz Send a message via Google Talk to drumz0rz Send a message via XFire to drumz0rz
yeah, I meant -> not =. I've gotten used to other languages that use = as assignment at == to check

Reply With Quote
  Trader Rating: 0 · #10  
Old February 21st, 2008, 04:23 PM
ilmmad ilmmad is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Feb 2008
Posts: 2 ilmmad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m
Reputation Power: 0
Quote:
Originally Posted by drumz0rz
yeah, I meant -> not =. I've gotten used to other languages that use = as assignment at == to check


I just learned how to use the TI's language correctly (as in today), and I think what really held me back was what you just described. I've worked with ActionScript and Blitz in the past, so learning that -> is = really threw me a curveball.

Reply With Quote
  Trader Rating: 0 · #11  
Old March 10th, 2008, 09:22 PM
pwnz32 pwnz32 is offline
n00b DevH'er
Dev Hardware Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 15 pwnz32 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 37 sec
Reputation Power: 0
thanks this stuff really helps, im gonna take a break from ti programming tho, im trying to learn C++

Reply With Quote
Reply

Viewing: Dev Hardware ForumsSOFTWARETI 83/84 > Strings to Chars


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway