<commit_before><commit_msg>Add Factorial<commit_after>#!/usr/bin/env perl

use v5.20.1;
use warnings;
use strict;

run();

sub run {
  print(factorial(prompt("What number do you want to take the factorial of? (must be positive or 0)\n")));
}

sub prompt {
  my ($text) = @_;
  print $text;

  my $answer = <STDIN>;
  chomp $answer;
  return $answer;
}

sub factorial {
  my ($stage) = @_;
  if ($stage == 0) {
    return 1;
  } elsif ($stage > 0) {
    return $stage * factorial($stage - 1);
  } elsif ($stage < 0) {
    print("Num must be greater than or equal to 0, try again\n\n");
    run();
  }
}
{'fraction_non_alphanumeric': 0.16472545757071547, 'fraction_numerical': 0.018302828618968387, 'mean_word_length': 3.1232876712328768, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5683118', 'n_tokens_mistral': 238, 'n_tokens_neox': 227, 'n_words': 71}