<commit_before>const canvas = document.getElementById('polygon');
const ctx = canvas.getContext('2d');

var polygonSides = document.getElementById('polygonSides');

var numberOfSides = 6,
    size = 50,
    Xcenter = 25,
    Ycenter = 25;

function makePolygon() {
    ctx.beginPath();
    ctx.moveTo (Xcenter +  size * Math.cos(0), Ycenter +  size *  Math.sin(0));          

    for (var i = 1; i <= numberOfSides;i += 1) {
    ctx.lineTo (Xcenter + size * Math.cos(i * 2 * Math.PI / numberOfSides), Ycenter + size * Math.sin(i * 2 * Math.PI / numberOfSides));
    }

    ctx.strokeStyle = "#000000";
    ctx.lineWidth = 1;
    ctx.stroke();
}

function changePolygon() {
    numberOfSides = polygonSides.value();
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    makePolygon();
}

polygonSides.value = numberOfSides;
makePolygon();


//Thanks stackoverflow :D
<commit_msg>Update polygon.js<commit_after>const canvas = document.getElementById('polygon');
const ctx = canvas.getContext('2d');

var polygonSides = document.getElementById('polygonSides');

var numberOfSides = 6,
    size = 50,
    Xcenter = 25,
    Ycenter = 25;

function makePolygon() {
    ctx.beginPath();
    ctx.moveTo (Xcenter +  size * Math.cos(0), Ycenter +  size *  Math.sin(0));          

    for (var i = 1; i <= numberOfSides;i += 1) {
    ctx.lineTo (Xcenter + size * Math.cos(i * 2 * Math.PI / numberOfSides), Ycenter + size * Math.sin(i * 2 * Math.PI / numberOfSides));
    }

    ctx.strokeStyle = "#000000";
    ctx.lineWidth = 1;
    ctx.stroke();
}

function changePolygon() {
    numberOfSides = polygonSides.value;
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    makePolygon();
}

polygonSides.value = numberOfSides;
makePolygon();


//Thanks stackoverflow :D

{'fraction_non_alphanumeric': 0.14875565610859728, 'fraction_numerical': 0.026018099547511313, 'mean_word_length': 3.3041362530413627, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2440229', 'n_tokens_mistral': 653, 'n_tokens_neox': 607, 'n_words': 137}