| | |
Game algorithm help
![]() |
•
•
Join Date: Jan 2007
Posts: 21
Reputation:
Solved Threads: 0
The Game
The game involves 10 words, which make up the nonsense sentence, “to tip pods on pan is as a tad din”. Two players take it in turn to take a word. The winner is the player who takes words containing all of any one of the letters involved (e.g. a player could win by taking “tad” “as” “a” and “pan”).
Now rather than searching through words and stuff for certain letters, ive assigned values to buttons with the words on, and my original plan was to have some winning combinations and compare them, if they matched then they won. However, as theres 10 words, each user gets 5 goes, so if they dont win within the first 3 goes, then they wont win at all.
Would assigning words into arrays each time a button is pressed, then comparing the arrays work? Or is there an easier way around it than that?
Any help would be appreciated.
The game involves 10 words, which make up the nonsense sentence, “to tip pods on pan is as a tad din”. Two players take it in turn to take a word. The winner is the player who takes words containing all of any one of the letters involved (e.g. a player could win by taking “tad” “as” “a” and “pan”).
Now rather than searching through words and stuff for certain letters, ive assigned values to buttons with the words on, and my original plan was to have some winning combinations and compare them, if they matched then they won. However, as theres 10 words, each user gets 5 goes, so if they dont win within the first 3 goes, then they wont win at all.
Would assigning words into arrays each time a button is pressed, then comparing the arrays work? Or is there an easier way around it than that?
Any help would be appreciated.
![]() |
Similar Threads
- Tic-Tac-Toe Game - Need some information or help (C++)
- HELP!!! Tic-tac-toe game! (C++)
- Memory game with c++ console applicaton (C++)
- Algorithm Problems (Java)
- recall a game with mad red monks? (Geeks' Lounge)
- negamax algorithm (Java)
- Your Fav Game (Geeks' Lounge)
Other Threads in the Java Forum
- Previous Thread: ActionListener
- Next Thread: uploading an image
| Thread Tools | Search this Thread |
6 actuate android api applet application applications array arrays automation balls bank binary bluetooth bold business c++ chat class clear client code codesnippet collections component coordinates database defaultmethod development dice doctype dragging ebook eclipse educational error file formatingtextintooltipjava fractal froglogic game givemetehcodez graphics gui hql html ide ideas image infinite ingres integer intersect invokingapacheantprogrammatically j2me java javaexcel javaprojects jni jpanel jtextarea julia linux list map method methods mobile mysql netbeans openjavafx parameter php problem program programming project recursion repositories scanner scrollbar sell server set sms sort sorting sql sqlserver state storm string sun superclass swing swt threads tree websites windows





