<commit_before>doc "A simple number guessing game"
class Guess(Process process) {

	Natural number = RandomNatural(1..100).next();
		
	mutable Number min := 1;
	mutable Number max := 100;
	
	for ( Natural count in (0..9).reversed ) {

		process.writeLine("I'm thinking of a number between ${min} and ${max}.");
		process.writeLine("You have ${count} guesses.")

		try ( String input = process.readLine() ) {
			Natural guess = input.parseNatural();
			Comparison comparison = number <=> guess;
			if (comparison.equal) {
				process.writeLine("You guessed right!");
				break true
			}
			else {
				process.writeLine("The number is ${comparison}.");
				if (comparison.smaller && guess<max) {
					max := guess;
				}
				else if (comparison.larger && guess>min) {
					min := guess;
				}
			}
		}
		catch (NumberFormatException nfe) {
			process.writeLine("Please enter a number.");
			retry input = process.readLine()
		}
		
	}
	fail {
		process.writeLine("You ran out of guesses!");
	}
	
	process.writeLine("Game over.");
		<commit_msg>simplified retry<commit_after>doc "A simple number guessing game"
class Guess(Process process) {

	Natural number = RandomNatural(1..100).next();
		
	mutable Number min := 1;
	mutable Number max := 100;
	
	for ( Natural count in (0..9).reversed ) {

		process.writeLine("I'm thinking of a number between ${min} and ${max}.");
		process.writeLine("You have ${count} guesses.")

		try {
			String input = process.readLine();
			Natural guess = input.parseNatural();
			Comparison comparison = number <=> guess;
			if (comparison.equal) {
				process.writeLine("You guessed right!");
				break true
			}
			else {
				process.writeLine("The number is ${comparison}.");
				if (comparison.smaller && guess<max) {
					max := guess;
				}
				else if (comparison.larger && guess>min) {
					min := guess;
				}
			}
		}
		catch (NumberFormatException nfe) {
			process.writeLine("Please enter a number.");
			retry
		}
		
	}
	fail {
		process.writeLine("You ran out of guesses!");
	}
	
	process.writeLine("Game over.");
		
{'fraction_non_alphanumeric': 0.14334305150631682, 'fraction_numerical': 0.009718172983479106, 'mean_word_length': 3.1934826883910388, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4648264', 'n_tokens_mistral': 797, 'n_tokens_neox': 628, 'n_words': 179}