//make sure it works with multiple repititions

//-------------------------

//test break
while (true) {
	break;
	assert false, "break failed";
}

//test continue
var flag1: Bool = true;
while (flag1) {
	flag1 = false;
	continue;
	assert false, "continue failed";
}

//-------------------------

//test break
while (true) {
	break;
	assert false, "break failed";
}

//test continue
var flag2: Bool = true;
while (flag2) {
	flag2 = false;
	continue;
	assert false, "continue failed";
}

//-------------------------

//test break
while (true) {
	break;
	assert false, "break failed";
}

//test continue
var flag3: Bool = true;
while (flag3) {
	flag3 = false;
	continue;
	assert false, "continue failed";
}

//-------------------------

{
	//test break
	while (true) {
		break;
		assert false, "break failed";
	}

	//test continue
	var flag4: Bool = true;
	while (flag4) {
		flag4 = false;
		continue;
		assert false, "continue failed";
	}
}

//-------------------------

{
	//test break
	while (true) {
		{
			break;
		}
		assert false, "break failed";
	}

	//test continue
	var flag5: Bool = true;
	while (flag5) {
		flag5 = false;
		{
			continue;
		}
		assert false, "continue failed";
	}
}

//-------------------------

{
	//iteration
	var iteration = 0;
	while(iteration < 10) {
		print iteration;
		iteration += 1;
	}
}

{
	//if and while work together
	var count = 1;
	while (count <= 10) {
		if (count % 2 == 0) {
			print "even";
		}
		else {
			print "odd";
		}
		count += 1;
	}
}

//-------------------------

{
	//make sure break and continue point to the correct locations
	var loops = 0;

	while (true) {
		if (++loops < 15532) {
			continue;
		}

		break;
	}

	assert loops == 15532, "Yuki loop failed (break + continue)";
}

