<commit_before>/* jshint devel: true */
/* jshint browser: true */
/* jshint -W097 */

"use strict";

function drawTank() {
    var canvas = document.getElementById("tankCanvas");
    var context = canvas.getContext('2d'); 
    context.beginPath();
    context.arc(95, 50, 40, 0, 2 * Math.PI);
    context.stroke();
    
    var imageScale = 0.20;
    
    var tank1Image = new Image();
    tank1Image.src = 'images/tank1imagev2.png';
    context.save();
    context.translate(200 * imageScale, 200 * imageScale);
    context.scale(imageScale, imageScale);
    context.rotate(1.0);
    context.translate( -tank1Image.width * imageScale / 2, -tank1Image.height * imageScale / 2);
    context.drawImage(tank1Image, 0, 0);
    context.restore();
}

drawTank();<commit_msg>Refactoring into functions<commit_after>/* jshint devel: true */
/* jshint browser: true */
/* jshint -W097 */

"use strict";

var canvas = document.getElementById("tankCanvas");
var context = canvas.getContext('2d'); 

function drawAll() {
    drawCaptureCircle();
    drawTank();
}

function drawCaptureCircle() {
    context.beginPath();
    context.arc(95, 50, 40, 0, 2 * Math.PI);
    context.stroke();
}

function drawTank() {
    var imageScale = 0.20;
    
    var tank1Image = new Image();
    tank1Image.src = 'images/tank1imagev2.png';
    context.save();
    context.translate(500 * imageScale, 500 * imageScale);
    context.scale(imageScale, imageScale);
    context.rotate(1.0);
    context.translate( -tank1Image.width * imageScale / 2, -tank1Image.height * imageScale / 2);
    context.drawImage(tank1Image, 0, 0);
    context.restore();
}

drawAll();
{'fraction_non_alphanumeric': 0.15271838729383017, 'fraction_numerical': 0.04153940134392181, 'mean_word_length': 3.4390243902439024, 'pattern_counts': {'":': 0, '<': 3, '<?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': '773235', 'n_tokens_mistral': 590, 'n_tokens_neox': 551, 'n_words': 119}