Questions tagged as 'loop'

3
answers

Infinite loop when typing a character

I'm doing error testing on my "Monkey Test" program and it goes into loop infinity when I type a character on the keyboard other than number. int ActionGenerator() { bool Verify; int Action; Verify = true; while(Verify){...
asked by 25.11.2014 / 22:20
2
answers

Back to previous menu

I'm trying to add a "Back" from one menu to the other, first I tried to use do only on the 2nd. menu to go back to the first, but it only closes. Follow the whole code: namespace ConsoleApp10 { class Program {...
asked by 15.11.2018 / 23:54
1
answer

Use of repetition loop appropriately

   "A very common game between 3 friends is the game of 2 or 1. In this game, the winner is different from the other two, and if all three choose equal values, the game ends in a tie. , B and C, who are playing 2 or 1: their program must show wh...
asked by 29.03.2018 / 02:22
2
answers

Increment in For loop

I need a count ranging from 1 to 24, but in that order: 1,9,17,2,10,18,3,11,19,4,12,20,5,13,21,6,14,22,7,15,23,8,16,24 I did it that way, but I wanted something more "elegant." for($x=1;$x<9;$x++){ echo $x.' '.($x+8).' '.($x+16);...
asked by 04.06.2018 / 21:59
2
answers

Difficulty with FOR loop nested

I am creating a code to develop my studies in Java and gave me an interesting idea / challenge: One person has 5 cards from MegaSena and always plays with the same cards. I made a small code where you enter the numbers of the last draw and he...
asked by 05.06.2018 / 04:39
2
answers

Processing and loop memory optimization

The code is simple and working perfectly, but I wanted tips on how to optimize it, what would be the best methods to use to allocate less memory, good practices, etc. using System; using System.Collections.Generic; using System.Linq; public c...
asked by 12.08.2017 / 15:00
1
answer

for JavaScript onload

What is the reason why I do not get to call the function showSeatStatus(i); ? window.onload = function() { //Conecta os eventos de imagem de poltrona for (var i = 0; i < tamanhoMatriz; i++) { document.getElementById("a...
asked by 19.07.2017 / 03:16
1
answer

Help on logic conditions and repetition in C ++

I have the following verification code to know if a certain number belongs to a vector. I could not think of a more accurate way to make the program say that the number DOES NOT belong to the vector, just that it belongs and what its position wi...
asked by 04.08.2017 / 05:36
2
answers

Button locked in while

My program has a loop, created with the command while . I start the loop with the start button. However, I can not do anything else in the program while while is running. I wanted to put a button called Stop that pressed on it...
asked by 05.05.2017 / 04:14
1
answer

How to loop within a query?

I have a list of phone numbers and their carriers. This list is in the form of icons and when you mouse over the operator-related number in tooltip format. However, the same number is appearing for all carriers as can be seen here , just move...
asked by 14.11.2015 / 13:53