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 Your Projects 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. Project Ideas/Start New Projects => Your Projects
Author Message
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 04 Dec 2009 04:44:48 pm    Post subject:

Aight, i just finished my first hangman game. It's not that great yet. For now it runs on homescreen but im updating it to the graph screen soon. I ran into a bug I need help with though. When you type letters, I haven't anyway of telling if that letter was already used. That also goes into conjuction with my other problem. I just have a 0 stored to a variable. IF you get the letter right, then 1 is added to it. Well this is easy to beat if you press a letter thats in the game already four times, so if the word was gain, you could press a 4 times and win.
Back to top
hotdog1234


Advanced Member


Joined: 14 Aug 2009
Posts: 291

Posted: 04 Dec 2009 05:38:44 pm    Post subject:

We could help you more if you posted code or, even better, the program itself
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 04 Dec 2009 05:39:23 pm    Post subject:

What do you mean by "already used"? My guess is the user has already guessed that. Is so, you would need to use inString(.
Back to top
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 04 Dec 2009 11:06:34 pm    Post subject:

ztrumpet wrote:
What do you mean by "already used"? My guess is the user has already guessed that. Is so, you would need to use inString(.



What I means is this. If the user presses the A key, A is used. He can then re-use A to win or lose, either way. I on't have anyway to combine stringsm so I have this problem.
Back to top
GloryMXE7
Puzzleman 3000


Active Member


Joined: 02 Nov 2008
Posts: 604

Posted: 05 Dec 2009 08:38:16 pm    Post subject:

combining strings is easy just add them together using "+"

Last edited by Guest on 05 Dec 2009 08:41:39 pm; edited 1 time in total
Back to top
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 06 Dec 2009 01:11:01 am    Post subject:

I tried, but ig get ERR: Undefined when i do. I'll try again.
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 06 Dec 2009 09:48:39 am    Post subject:

If you get an Error like that, it means there is nothing in the string at first. I'd store a buffer character to the string first.
Here's what you did something like:
:Str1+"A"->Str1
However before that (towards the begining of the program) you need:
:"8->Str1
This 8 is just a buffer character so you can add onto the string. This makes the string offset by one, but that's better than an error... Smile
Back to top
ah-blabla


Newbie


Joined: 28 Oct 2009
Posts: 26

Posted: 06 Dec 2009 10:58:17 am    Post subject:

ztrumpet wrote:
If you get an Error like that, it means there is nothing in the string at first. I'd store a buffer character to the string first.
Here's what you did something like:
:Str1+"A"->Str1
However before that (towards the begining of the program) you need:
:"8->Str1
This 8 is just a buffer character so you can add onto the string. This makes the string offset by one, but that's better than an error... Smile

Can you not just initialise an empty string? On a 68K you can just write:
:""->Str1
This is what I did in my hangman program, and works. I've never used a Z80 calc though, so wouldn't know whether this works.
Back to top
FinaleTI


Advanced Newbie


Joined: 28 Oct 2009
Posts: 81

Posted: 06 Dec 2009 01:59:15 pm    Post subject:

On a z80 calc one can define a string as
:""→Str1
But when you try to add characters to it, it will give you an error.
You can recall it and it will show up blank, but trying to do stuff as expr( with a blank string can cause a crash or RAM clear. That's why z80 BASIC programmers usually have to define a buffer character.
Back to top
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 08 Dec 2009 12:42:33 pm    Post subject:

IS there anyway to combine two strings, such as strg1 and strg2?
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 08 Dec 2009 01:10:40 pm    Post subject:

Bhaliar wrote:
IS there anyway to combine two strings, such as strg1 and strg2?
A fair perusal of the Strings section of your manual should answer your question.

Otherwise, search for string concatenation.


Last edited by Guest on 08 Dec 2009 01:11:16 pm; edited 1 time in total
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 08 Dec 2009 04:20:26 pm    Post subject:

Bhaliar wrote:
IS there anyway to combine two strings, such as strg1 and strg2?

Sure,
:Str1+Str2
Back to top
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 08 Dec 2009 06:33:08 pm    Post subject:

It's horrible. I havent been able to find my manual for awhile.
Back to top
IAmACalculator
In a state of quasi-hiatus


Know-It-All


Joined: 21 Oct 2005
Posts: 1571

Posted: 08 Dec 2009 10:06:34 pm    Post subject:

You can pick up a nice digital copy at education.ti.org.
Back to top
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 17 Dec 2009 12:06:30 am    Post subject:

Well two birds with one stone. I finally got my strs to work. Now you can only use a letter once, which means you must find all letters to win. Very Happy I'll type up the code soon and post it. Oh and one more thing, the code uses two different strs that have 4 and 5 letter words. You can edit or add onto the ones I post, but pay attention to the math I use in the program. Both strs have the same amount of words.
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