Trying to create a game that returns the amount of times it takes the all numbers between a beginning input and ending input to work through a loop before it becomes zero. Any ideas on why I keep getting an infinite loop?
import java.util.Scanner; class Suite { private static Scanner clavier = new Scanner(System.in); public static void main(String[] args) { int debut; do { System.out.print("de (>= 1) ? "); debut = clavier.nextInt(); } while (debut < 1); int fin; do { System.out.print("a (>= " + debut + ") ? "); fin = clavier.nextInt(); } while (fin < debut); for (int x = debut; x <= fin; ++x) { int k = 0; do { if (x % 3 == 0) { x =+ 4; ++k; } if (x % 3 != 0 && x % 4 == 0) { x = x / 2; ++k; } if (x % 3 != 0 && x % 4 != 0) { x = x - 1; ++k; } } while (x != 0); System.out.println(x + " --> " + k); } } }