Logic error in hangman game, I need it to only add to the counter if its wrong but it adds twice if its wrong and once if its right [on hold]

I don’t know where its adding to the counter within the code but its screwing everything up because I have a method to add a specific body part according to the counter (1 = head, etc). If anyone could find the error or give me a different way of doing it I’d really appreciate it!

//create new Console  c = new Console ();   f = new Console ();   //declare variables  String inputWord; //the word entered by player 1 that player 2 will guess char inputLetter; //the letter entered by player 2 that is the guess String category; //the category entered by player 1 which acts as a hint for player 2 String tempString = ""; //a temporary string variable that holds the guess, used to convert char to String so that we can use the replace method int numGuesses = 0; //counter which keeps track of the incorrect guesses StringBuffer blanks = new StringBuffer (""); //a string buffer object that prints out the "?"'s based on the length of the word entered by player 1 boolean isWinner; //used in main to check if player 2 has correctly guessed the word, then it will break  //print instructions then clear them (working) instructions();  c.readLine();  c.clear();   //get word input from user (working) c.println("Player 1, please enter the word you would like Player 2 to guess. Please do not enter any spaces or punctuation. It will be deleted.");  inputWord = c.readLine();  inputWord = inputWord.toUpperCase();  c.println("Please enter a category that your word falls under. Don't be too specific!");  category = c.readLine();   //print category in other console (working) f.println("Category: " + category);   //draw underscores for each letter of the word (working) for (int i = 0; i < inputWord.length(); i++) {   blanks = blanks.append("?"); }//rof  //print the underscores out (working) f.print(blanks.toString());  //draw template (working) drawGallows();   //clear screen c.clear();  //prompt for user 2 to enter input c.println("Player 2, please enter your letter guess in uppercase."); c.println("If you think you know the word, just type it in!");  //main game loop  whileLoop: while (numGuesses < 7)  {    c.println (numGuesses);   //get letter guess from player 2 (working)   inputLetter = c.readChar();     //converts the char to a string so we can use the StringBuffer method replace   tempString = Character.toString(inputLetter);    //if the letter is somewhere in the word then replace    if (inputWord.indexOf(inputLetter) != -1)   {      //Loop to check every letter in word, outputs letter if letter is located in the word     for (int i = 0; i < inputWord.length(); i++)     {       if (inputWord.charAt(i) == inputLetter)       {         //boolean isLetterdetected is true if theres a match         //isLetterDetected = true;          //replaces the underscore with the correctly guessed letter         blanks.replace(i,i+1,tempString);          //clear the screen         f.clear();          //reprint the template and category          drawGallows();         f.println("Category: " + category);          //print the new stringbuffer         f.print(blanks.toString());        }//fi      }//rof    }//fi    //else the letter is not anywhere in the word so increase counter, and draw body part   else   {     numGuesses++;     c.println (numGuesses);     drawBodyPart(numGuesses);   }    //check if player 2 has correctly solved the word   forLoop:   for (int i = 0; i < blanks.length(); i++)   {     if (blanks.indexOf("?") == -1)     {       isWinner = true;       results (numGuesses, isWinner, inputWord);       break whileLoop;     }//fi     else     {       break forLoop;     }//esle   }//rof  }//elihw 

Is it possible to run an app twice side by side on the MIUI?

It is said that with MIUI, it is possible to run the same app twice as if they are on two different phones. (example: WeChat or Line running with a work account and one running with a personal account).

Is it possible to run the same app twice, and side by side on an Xiaomi Redmi 4X with MIUI 8? Or is it only possible to show them one at a time?

If it is only possible to show one at a time, you can’t really play some games such as Pokemon Go and do the Raid Battle at the same time using both accounts (since you have to switch screen to one at a time and therefore not play at the same time).

And if it is possible side by side, can it be vertically or horizontally split on the screen, but won’t the 2 apps be really small and make it not practical to play at the same time?

Could some screenshot / YouTube video be posted if you are possible to make it happen?

Do Arcane Ward’s starting hit points include the INT modifier once or twice?

An abjuration wizard’s Arcane Ward states:

[…] The ward has hit points equal to twice your wizard level + your Intelligence modifier.

So how many hit points is this supposed to be?

$ (2 \times WizardLevel) + INT_{mod}$


$ 2 \times (WizardLevel + INT_{mod})$ ?

I feel like the phrasing hints toward the first calculation, but it’s still somewhat ambiguous.

have to open port 80 twice to have accessible website

Got a website set up with xampp server. Website isn’t accessible from other networks unless I open port 80 twice, Lets say servers internal ip is So I have to open port 80 for this ip, and justso website can be accessed I have to open port 80 again on any other devices ip connected to that network.

Any ideas whats wrong?

Server using ethernet connection, wifi shut down.

Prerender executing twice

I have some prerender code that is being used to get information from another list to add into the display of the main list.

I am puzzled – the prerender code executes twice.

 (function () {  var ctx = {};  ctx.Templates = {};  ctx.OnPreRender = preRenderHandler;  SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctx); })();  function preRenderHandler(renderCtx) {  //        Execute SP Services to get external variables to add into current site }; 

the code works fine, just executes twice.

I suspect that this site explains why:


namely, that there is an OnLoad and Postback event happening resulting in the preRenderhandler running twice?

Is this correct?

What is the best way to stop the code running twice? Is there any benefit in it running twice?


Get Schengen visa refused twice. Am I blocked from entry

I get 2 refusals to Shengen The 1st was to Spain 2 years ago inspite having all documents to attend a meeting The second one is to Czech inspite having clear documents with invitation letter to attend a fellowship but I was applying with my wife and baby. Does my chance to be accepted in a third country decrease dramatically as I could be blocked from entry to schengen or it doesn’t matter Do you think that reapplying to Czech for a second time alone without my family wolud be the better next step or try to apply through another countery for fellowship as Germany would be the best option

Thanks in advance

Automator script runs twice on Finder selected files

I’m writing a simple service to open a file in Emacs through selection in Finder.

     for f in $  @     do     open -a Emacs "$  f"     done 

If a file is selected in Finder (solid blue on the file after left click), and the service is called, the script runs twice for any selected files.

If I right click on a file without selecting it (clear box after right click) and call the service, then the action is performed once.

There is no Automator service of “getting Finder items” above this script.

Why is the service being called twice if a file is selected (left click on a file) but only once if selected with a right click?