<commit_before># A binary search number guesser
# Uses Python3
from math import ceil, log

lowNum = 0
highNum = 10000000000000
guessCounter = 0
depth = ceil(log(highNum - lowNum,2))
answer = 'h'
guess = highNum

print("Think of a number between {0} and {1} and I will try to guess it {2} guesses or less".format(lowNum, highNum, depth))
print("If I guess too high, let me know by pressing the 'h' key.")
print("If I guess too low, let me know by pressing the 'l' key.")
print("But if I guess correctly, let me know by pressing the 'y' key.")

while guessCounter <= depth:
    if answer == 'y':
        print("Yay! I guessed it in {0} guesses!".format(guessCounter))
        break
    if answer == 'h':
        highNum = guess
    if answer == 'l':
        lowNum = guess

    guess = ceil((highNum + lowNum)/2)

    answer = input("Is your number {0}? ".format(guess))
    guessCounter += 1<commit_msg>Shrank the initial highNum down from obscenely-huge to one that is easier for a 3rd grader to think about<commit_after># A binary search number guesser
# Uses Python3
from math import ceil, log

lowNum = 0
highNum = 1000
guessCounter = 0
depth = ceil(log(highNum - lowNum,2))
answer = 'h'
guess = highNum

print("Think of a number between {0} and {1} and I will try to guess it {2} guesses or less".format(lowNum, highNum, depth))
print("If I guess too high, let me know by pressing the 'h' key.")
print("If I guess too low, let me know by pressing the 'l' key.")
print("But if I guess correctly, let me know by pressing the 'y' key.")

while guessCounter <= depth:
    if answer == 'y':
        print("Yay! I guessed it in {0} guesses!".format(guessCounter))
        break
    if answer == 'h':
        highNum = guess
    if answer == 'l':
        lowNum = guess

    guess = ceil((highNum + lowNum)/2)

    answer = input("Is your number {0}? ".format(guess))
    guessCounter += 1
{'fraction_non_alphanumeric': 0.11717921527041357, 'fraction_numerical': 0.021739130434782608, 'mean_word_length': 3.347926267281106, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '7168697', 'n_tokens_mistral': 631, 'n_tokens_neox': 597, 'n_words': 259}