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

use v6;

use lib 'lib';
use NCurses;

constant WIDTH  = Int(30);
constant HEIGHT = Int(10);

my @choices = [ 
    "Choice 1",
    "Choice 2",
    "Choice 3",
    "Choice 4",
    "Exit",
];

my $n_choices = @choices.elems;

sub print_menu($menu_win, $highlight) {
	my $x = 2;
	my $y = 2;
	box($menu_win, 0, 0);
    for 0..$n_choices - 1 -> $i {
        if $highlight == $i + 1 {
            # High light the present choice
            wattron($menu_win, A_REVERSE); 
            mvwprintw($menu_win, $y, $x, sprintf("%s", @choices[$i]));
            wattroff($menu_win, A_REVERSE);
        } else {
            mvwprintw($menu_win, $y, $x, sprintf("%s", @choices[$i]));
        }
        $y++;<commit_msg>Simplify code<commit_after>#!/usr/bin/env perl6

use v6;

use lib 'lib';
use NCurses;

constant WIDTH  = 30;
constant HEIGHT = 10;

my @choices = [ 
    "Choice 1",
    "Choice 2",
    "Choice 3",
    "Choice 4",
    "Exit",
];

my $n_choices = @choices.elems;

sub print_menu($menu_win, $highlight) {
	my $x = 2;
	my $y = 2;
	box($menu_win, 0, 0);
    for 0..$n_choices - 1 -> $i {
        if $highlight == $i + 1 {
            # High light the present choice
            wattron($menu_win, A_REVERSE); 
            mvwprintw($menu_win, $y, $x, sprintf("%s", @choices[$i]));
            wattroff($menu_win, A_REVERSE);
        } else {
            mvwprintw($menu_win, $y, $x, sprintf("%s", @choices[$i]));
        }
        $y++;
{'fraction_non_alphanumeric': 0.1793478260869565, 'fraction_numerical': 0.02309782608695652, 'mean_word_length': 2.2733333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6918633', 'n_tokens_mistral': 622, 'n_tokens_neox': 581, 'n_words': 140}