//Up, Up, Down, Down, Left, Right, Left, Right, B, A
var n = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
r = 0;

$(document).keydown(function (e) {
    if (e.keyCode === n[r++]) {
        if (r === n.length) {
            //Do stuff
            return !1
        }
    } else r = 0
});