I also want it to deduct points when you ask for a hint. What I want it to do is keep going on until you enter 'quit' and I want it to give you a hint when you enter 'hint'. Now it won't go more than one round through the loop before closing the program.
#EASY JUMBLE WORDS CODE#
I used to have it where it was stuck in an infinite loop, but I messed with the code a little. I must be missing something obvious with loops because this thing is acting like one messed up little puppy!I used Python for awhile before going to C++ and assumed the loops would work the same. :( The book has exercises that you can do to review code at the end of each chapter.Īnyways, one is to make a word jumble program (where you guess words and get a hint) with a scoring system. I'm at the end of chapter three and I've already hit a landmine. I've been reading Michael Dawson's Beginning C++ Game Programming book. JOptionPane.showMessageDialog(null," \n all rights reserved to proggrammer's forum (08176251802 )"," Thank you for using this program",JOptionPane.Hey guys I've been lurking here for awhile now and decided to start posting. JOptionPane.showMessageDialog(null,"You have answered all questions correctly","CONGRATULATION",JOptionPane.INFORMATION_MESSAGE) this is a method that is called upon when all questions have been answered correctly JOptionPane.showMessageDialog(null," \n all rights reserved to proggrammer's forum (08176251802 )"," Thank you for using this program",JOptionPane.INFORMATION_MESSAGE) Tryagain=JOptionPane.showConfirmDialog(null,"will you like to try again?","You got " + got +" question(s) correct",JOptionPane.YES_NO_OPTION) ** A switch statement to accept the input to try again ("there is no need for this because random will never make a mistake") JOptionPane.showMessageDialog(null,"you have to start again","you have tried four times now", JOptionPane.HEIGHT) break restart JOptionPane.showMessageDialog(null, "correct",got+"\n \nquestion(s) answered correctly",JOptionPane.PLAIN_MESSAGE) continue restart Word=JOptionPane.showInputDialog(null,"E D R E G\n A strong desire for more \n (Write your answers in SMALL letters)","UNSCRAMBLE",JOptionPane.QUESTION_MESSAGE) * if u add a scrambled word, remember to increase your random number possibilities by +1 * the 1+ at the front of the random object is to make sure that random does not generate 0 as a number * after each iteration, the random number is added to the arraylist * variable temp now becomes my switch value * the number is assigned to variable temp * If the random number generated is not found in the arraylist buffer * This loop is used for generating the random numbers * to break out of this loop without the entire loop by using the break function * to redo this loop without running the entire loop by using the continue function ** Restart is a label that makes it possible:
#EASY JUMBLE WORDS TRIAL#
You only have 4 trial to unscramble a word" ,"welcome \n"+ name,JOptionPane.PLAIN_MESSAGE) Unscramble words with small letters \n 2. JOptionPane.showMessageDialog(null,"Rules of the Game \n 1. Name=JOptionPane.showInputDialog(null,"input your name to get started","",JOptionPane.CLOSED_OPTION) I tried creating an array of string but there were big bed bugs there In case you wanna add your words and answers