Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
iamalisue
14
Years of Service
User Offline
Joined: 12th Nov 2011
Location:
Posted: 13th Nov 2011 00:18
I was wondering how to make it so you cannot guess the same letter twice. Any help would be greatly appreciated! I'm fairly new at this and just trying to make my game as efficient as possible. Thanks so much!!
-Alison
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 13th Nov 2011 02:32 Edited at: 13th Nov 2011 02:32
When the user enters a letter, you compare this letter with the previous one.



Another little top is to make sure you consider the case of the letters also..

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 13th Nov 2011 03:32
@iamalisue

Also if you keep a list of used letters, that will prevent someone from choosing a letter that was used a while ago:



Each time you start a new puzzle, clear out the used letter list:



Enjoy your day.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Nov 2011 09:48
You can put all the letters in one string and search for the letter before allowing it to be picked. You can achieve that with a FOR/NEXT loop or with IanM's Matrix1 Utilities Plugins. IanM's FIND CHAR() command quickly returns the location of the character in the string or a zero if it isn't in the string.



To get the above code snip to work download IanM's Matrix1 Utilities Plugins and add 984 useful commands to your Darkbasic Pro for free.

https://forumfiles.thegamecreators.com/download/2257747

Login to post a reply

Server time is: 2026-07-11 11:05:54
Your offset time is: 2026-07-11 11:05:54