Greasy Fork is available in English.

Project Euler score offsets

Shows the difference between your score and your friends' on Project Euler.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name       Project Euler score offsets
// @namespace  http://mathemaniac.org/
// @version    1.0.1
// @description  Shows the difference between your score and your friends' on Project Euler.
// @match      http://projecteuler.net/friends
// @copyright  2013-2017, Sebastian Paaske Tørholm
// @require    https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js
// @grant none
// ==/UserScript==

(function () {
    var myScore;
    $('table.grid > tbody > tr').each(function () {
        if ($(this).children('td').last().html().match(/ /)) {
            myScore = 1 * $(this).children('td:nth-child(4)').text();
        }
    }).each(function () {
        if ($(this).children('th').length > 0) {
            $(this).children('th:nth-child(4)').after('<th>Offset</th>');
        } else {
            var scoreCell = $(this).children('td:nth-child(4)');
            var score = 1 * scoreCell.text();
            var diff = score - myScore;
            scoreCell.after(diff > 0 ? '<td style="color: green; text-align: center">+' + diff + '</td>' :
                            diff < 0 ? '<td style="color: red; text-align: center">' + diff + '</td>' : '<td style="text-align: center">0</td>');
        }
    });
})();