<commit_before>#!/usr/bin/env bash

readonly THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

function get_random_cell() {
    local range=$1
    echo "$(($RANDOM % $range + 1))"
}

function get_random_cell_value() {
    # 90% chance of spawning a "2"
    # 10% chance of spawning a "4"
    echo "$(($RANDOM % 10 == 0 ? 4 : 2))"
}

function initial_board() {
    sed -r \
        -e "s/-/a/$(get_random_cell 16)" \
        -e "s/-/a/$(get_random_cell 15)" \
        <<< ":----:----:----:----"
}

function gather_input() {
    # Read one key from the user and convert that to an arrow key. Also
    # output a random number (0-15) next to the chosen key. Ignore other
    # inputs.
    echo "$(initial_board)"

    while true<commit_msg>Initially-populated cells now have the same likelyhood of being a 2 or 4<commit_after>#!/usr/bin/env bash

readonly THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

function get_random_cell() {
    local range=$1
    echo "$(($RANDOM % $range + 1))"
}

function get_random_cell_value() {
    # 90% chance of spawning a "2"
    # 10% chance of spawning a "4"
    echo "$(($RANDOM % 10 == 0 ? 4 : 2))"
}

function initial_board() {
    sed -E -e "
        s/-/$(get_random_cell_value)/$(get_random_cell 16)
        s/-/$(get_random_cell_value)/$(get_random_cell 15)
        y/24/ab/
    " <<< ":----:----:----:----"
}

function gather_input() {
    # Read one key from the user and convert that to an arrow key. Also
    # output a random number (0-15) next to the chosen key. Ignore other
    # inputs.
    echo "$(initial_board)"

    while true
{'fraction_non_alphanumeric': 0.17761100687929957, 'fraction_numerical': 0.028767979987492184, 'mean_word_length': 2.6363636363636362, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 3, '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': '1242067', 'n_tokens_mistral': 610, 'n_tokens_neox': 554, 'n_words': 167}