Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/ultimate_sudoku/js/main.js
�азад
/*! * screenfull * v5.0.0 - 2019-09-09 * (c) Sindre Sorhus; MIT License */ function trace(n) { console.log(n) } function getSize(n) { var u, e = n.toLowerCase(), f = window.document, t = f.documentElement, i, r; return window["inner" + n] === undefined ? u = t["client" + n] : window["inner" + n] != t["client" + n] ? (i = f.createElement("body"), i.id = "vpw-test-b", i.style.cssText = "overflow:scroll", r = f.createElement("div"), r.id = "vpw-test-d", r.style.cssText = "position:absolute;top:-1000px", r.innerHTML = "<style>@media(" + e + ":" + t["client" + n] + "px){body#vpw-test-b div#vpw-test-d{" + e + ":7px!important}}<\/style>", i.appendChild(r), t.insertBefore(i, f.head), u = r["offset" + n] == 7 ? t["client" + n] : window["inner" + n], t.removeChild(i)) : u = window["inner" + n], u } function onOrientationChange() { window.matchMedia("(orientation: portrait)").matches && sizeHandler(); window.matchMedia("(orientation: landscape)").matches && sizeHandler() } function isChrome() { return /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) } function isIpad() { var n = navigator.userAgent.toLowerCase().indexOf("ipad") !== -1; return !n && navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && navigator.maxTouchPoints > 2 ? !0 : n } function isMobile() { return isIpad() ? !0 : navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) ? !0 : !1 } function isIOS() { if (isIpad()) return !0; for (var n = ["iPad Simulator", "iPhone Simulator", "iPod Simulator", "iPad", "iPhone", "iPod"]; n.length;) if (navigator.platform === n.pop()) return s_bIsIphone = !0, !0; return s_bIsIphone = !1, !1 } function getIOSWindowHeight() { var n = document.documentElement.clientWidth / window.innerWidth; return window.innerHeight * n } function getHeightOfIOSToolbars() { var n = (window.orientation === 0 ? screen.height : screen.width) - getIOSWindowHeight(); return n > 1 ? n : 0 } function sizeHandler() { var i, r, h; if (window.scrollTo(0, 1), $("#canvas")) { i = platform.name !== null && platform.name.toLowerCase() === "safari" ? getIOSWindowHeight() : getSize("Height"); r = getSize("Width"); s_bFocus && _checkOrientation(r, i); var e = Math.min(i / CANVAS_HEIGHT, r / CANVAS_WIDTH), n = Math.round(CANVAS_WIDTH * e), t = Math.round(CANVAS_HEIGHT * e), f = 0; t < i ? (f = i - t, t += f, n += f * (CANVAS_WIDTH / CANVAS_HEIGHT)) : n < r && (f = r - n, n += f, t += f * (CANVAS_HEIGHT / CANVAS_WIDTH)); var u = i / 2 - t / 2, o = r / 2 - n / 2, s = CANVAS_WIDTH / n; (o * s < -EDGEBOARD_X || u * s < -EDGEBOARD_Y) && (e = Math.min(i / (CANVAS_HEIGHT - EDGEBOARD_Y * 2), r / (CANVAS_WIDTH - EDGEBOARD_X * 2)), n = Math.round(CANVAS_WIDTH * e), t = Math.round(CANVAS_HEIGHT * e), u = (i - t) / 2, o = (r - n) / 2, s = CANVAS_WIDTH / n); s_iOffsetX = -1 * o * s; s_iOffsetY = -1 * u * s; u >= 0 && (s_iOffsetY = 0); o >= 0 && (s_iOffsetX = 0); s_oInterface !== null && s_oInterface.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_oMenu !== null && s_oMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_oModeMenu !== null && s_oModeMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_bIsIphone && s_oStage ? (canvas = document.getElementById("canvas"), s_oStage.canvas.width = n * 2, s_oStage.canvas.height = t * 2, canvas.style.width = n + "px", canvas.style.height = t + "px", h = Math.min(n / CANVAS_WIDTH, t / CANVAS_HEIGHT), s_iScaleFactor = h * 2, s_oStage.scaleX = s_oStage.scaleY = s_iScaleFactor) : s_bMobile || isChrome() ? ($("#canvas").css("width", n + "px"), $("#canvas").css("height", t + "px")) : s_oStage && (s_oStage.canvas.width = n, s_oStage.canvas.height = t, s_iScaleFactor = Math.min(n / CANVAS_WIDTH, t / CANVAS_HEIGHT), s_oStage.scaleX = s_oStage.scaleY = s_iScaleFactor); u < 0 ? $("#canvas").css("top", u + "px") : (u = (i - t) / 2, $("#canvas").css("top", u + "px")); $("#canvas").css("left", o + "px"); fullscreenHandler() } } function _checkOrientation(n, t) { s_bMobile && ENABLE_CHECK_ORIENTATION && (n > t ? $(".orientation-msg-container").attr("data-orientation") === "landscape" ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate()) : $(".orientation-msg-container").attr("data-orientation") === "portrait" ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate())) } function inIframe() { try { return window.self !== window.top } catch (n) { return !0 } } function playSound(n, t, i) { return DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1 ? (s_aSounds[n].play(), s_aSounds[n].volume(t), s_aSounds[n].loop(i), s_aSounds[n]) : null } function stopSound(n) { (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && s_aSounds[n].stop() } function setVolume(n, t) { (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && s_aSounds[n].volume(t) } function setMute(n, t) { (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && s_aSounds[n].mute(t) } function fadeSound(n, t, i, r) { (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && s_aSounds[n].fade(t, i, r) } function soundPlaying(n) { if (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) return s_aSounds[n].playing() } function createBitmap(n, t, i) { var u = new createjs.Bitmap(n), r = new createjs.Shape; return t && i ? r.graphics.beginFill("#fff").drawRect(0, 0, t, i) : r.graphics.beginFill("#ff0").drawRect(0, 0, n.width, n.height), u.hitArea = r, u } function createSprite(n, t, i, r, u, f) { var e, o; return e = t !== null ? new createjs.Sprite(n, t) : new createjs.Sprite(n), o = new createjs.Shape, o.graphics.beginFill("#000000").drawRect(-i, -r, u, f), e.hitArea = o, e } function randomFloatBetween(n, t, i) { return typeof i == "undefined" && (i = 2), parseFloat(Math.min(n + Math.random() * (t - n), t).toFixed(i)) } function rotateVector2D(n, t) { var i = t.getX() * Math.cos(n) + t.getY() * Math.sin(n), r = t.getX() * -Math.sin(n) + t.getY() * Math.cos(n); t.set(i, r) } function tweenVectorsOnX(n, t, i) { return n + i * (t - n) } function shuffle(n) { for (var t = n.length, r, i; 0 !== t;) i = Math.floor(Math.random() * t), t -= 1, r = n[t], n[t] = n[i], n[i] = r; return n } function bubbleSort(n) { var i, t, r; do for (i = !1, t = 0; t < n.length - 1; t++) n[t] > n[t + 1] && (r = n[t], n[t] = n[t + 1], n[t + 1] = r, i = !0); while (i) } function compare(n, t) { return n.index > t.index ? -1 : n.index < t.index ? 1 : 0 } function easeLinear(n, t, i, r) { return i * n / r + t } function easeInQuad(n, t, i, r) { return i * (n /= r) * n + t } function easeInSine(n, t, i, r) { return -i * Math.cos(n / r * (Math.PI / 2)) + i + t } function easeInCubic(n, t, i, r) { return i * (n /= r) * n * n + t } function getTrajectoryPoint(n, t) { var i = new createjs.Point, r = (1 - n) * (1 - n), u = n * n; return i.x = r * t.start.x + 2 * (1 - n) * n * t.traj.x + u * t.end.x, i.y = r * t.start.y + 2 * (1 - n) * n * t.traj.y + u * t.end.y, i } function formatTime(n) { n /= 1e3; var t = Math.floor(n / 60), i = Math.floor(n - t * 60), r = ""; return r += t < 10 ? "0" + t + ":" : t + ":", r + (i < 10 ? "0" + i : i) } function degreesToRadians(n) { return n * Math.PI / 180 } function checkRectCollision(n, t) { var i, r; return i = getBounds(n, .9), r = getBounds(t, .98), calculateIntersection(i, r) } function calculateIntersection(n, t) { var u, f, i = {}, r = {}; return i.cx = n.x + (i.hw = n.width / 2), i.cy = n.y + (i.hh = n.height / 2), r.cx = t.x + (r.hw = t.width / 2), r.cy = t.y + (r.hh = t.height / 2), u = Math.abs(i.cx - r.cx) - (i.hw + r.hw), f = Math.abs(i.cy - r.cy) - (i.hh + r.hh), u < 0 && f < 0 ? (u = Math.min(Math.min(n.width, t.width), -u), f = Math.min(Math.min(n.height, t.height), -f), { x: Math.max(n.x, t.x), y: Math.max(n.y, t.y), width: u, height: f, rect1: n, rect2: t }) : null } function dlx_cover(n) { var i, t; for (n.right.left = n.left, n.left.right = n.right, i = n.down; i !== n; i = i.down) for (t = i.right; t !== i; t = t.right) t.down.up = t.up, t.up.down = t.down, t.column.size-- } function dlx_uncover(n) { for (var t, i = n.up; i !== n; i = i.up) for (t = i.left; t !== i; t = t.left) t.column.size++, t.down.up = t, t.up.down = t; n.right.left = n; n.left.right = n } function dlx_search(n, t, i, r, u) { var o, e, s, f; if (n.right === n) return (r.push(t.slice(0)), r.length >= u) ? r : null; for (o = null, s = 99999, f = n.right; f !== n; f = f.right) { if (f.size === 0) return null; f.size < s && (s = f.size, o = f) } for (dlx_cover(o), e = o.down; e !== o; e = e.down) { for (t[i] = e.row, f = e.right; f !== e; f = f.right) dlx_cover(f.column); if (s = dlx_search(n, t, i + 1, r, u), s !== null) return s; for (f = e.left; f !== e; f = f.left) dlx_uncover(f.column) } return dlx_uncover(o), null } function dlx_solve(n, t, i) { for (var o, e, f, s, r = new Array(n[0].length), u = 0; u < r.length; u++) r[u] = {}; for (u = 0; u < r.length; u++) r[u].index = u, r[u].up = r[u], r[u].down = r[u], u >= t ? (u - 1 >= t && (r[u].left = r[u - 1]), u + 1 < r.length && (r[u].right = r[u + 1])) : (r[u].left = r[u], r[u].right = r[u]), r[u].size = 0; for (u = 0; u < n.length; u++) for (o = null, e = 0; e < n[u].length; e++) n[u][e] && (f = {}, f.row = u, f.column = r[e], f.up = r[e].up, f.down = r[e], o ? (f.left = o, f.right = o.right, o.right.left = f, o.right = f) : (f.left = f, f.right = f), r[e].up.down = f, r[e].up = f, r[e].size++, o = f); return s = {}, s.right = r[t], s.left = r[r.length - 1], r[t].left = s, r[r.length - 1].right = s, solutions = [], dlx_search(s, [], 0, solutions, i), solutions } function solve_sudoku(n) { for (var i, f, u, r, s, o, h = [], e = [], t = 0; t < 9; t++) for (i = 0; i < 9; i++) if (f = n[t][i] - 1, f >= 0) r = new Array(324), r[t * 9 + i] = 1, r[81 + t * 9 + f] = 1, r[162 + i * 9 + f] = 1, r[243 + (Math.floor(t / 3) * 3 + Math.floor(i / 3)) * 9 + f] = 1, h.push(r), e.push({ row: t, col: i, n: f + 1 }); else for (u = 0; u < 9; u++) r = new Array(324), r[t * 9 + i] = 1, r[81 + t * 9 + u] = 1, r[162 + i * 9 + u] = 1, r[243 + (Math.floor(t / 3) * 3 + Math.floor(i / 3)) * 9 + u] = 1, h.push(r), e.push({ row: t, col: i, n: u + 1 }); if (s = dlx_solve(h, 0, 2), s.length > 0) { for (o = s[0], t = 0; t < o.length; t++) n[e[o[t]].row][e[o[t]].col] = e[o[t]].n; return s.length } return 0 } function solve(n) { var t = solve_sudoku(n); if (t > 0) { if (t > 1) return 1 } else return trace("no solution"), 0 } function getBounds(n, t) { var i = { x: Infinity, y: Infinity, width: 0, height: 0 }, l, v, u, c, f, e, o, s, r, a, h; if (n instanceof createjs.Container) { for (i.x2 = -Infinity, i.y2 = -Infinity, l = n.children, v = l.length, c = 0; c < v; c++) u = getBounds(l[c], 1), u.x < i.x && (i.x = u.x), u.y < i.y && (i.y = u.y), u.x + u.width > i.x2 && (i.x2 = u.x + u.width), u.y + u.height > i.y2 && (i.y2 = u.y + u.height); i.x == Infinity && (i.x = 0); i.y == Infinity && (i.y = 0); i.x2 == Infinity && (i.x2 = 0); i.y2 == Infinity && (i.y2 = 0); i.width = i.x2 - i.x; i.height = i.y2 - i.y; delete i.x2; delete i.y2 } else r = {}, n instanceof createjs.Bitmap ? (a = n.sourceRect || n.image, r.width = a.width * t, r.height = a.height * t) : n instanceof createjs.Sprite ? n.spriteSheet._frames && n.spriteSheet._frames[n.currentFrame] && n.spriteSheet._frames[n.currentFrame].image ? (h = n.spriteSheet.getFrame(n.currentFrame), r.width = h.rect.width, r.height = h.rect.height, r.regX = h.regX, r.regY = h.regY) : (i.x = n.x || 0, i.y = n.y || 0) : (i.x = n.x || 0, i.y = n.y || 0), r.regX = r.regX || 0, r.width = r.width || 0, r.regY = r.regY || 0, r.height = r.height || 0, i.regX = r.regX, i.regY = r.regY, f = n.localToGlobal(0 - r.regX, 0 - r.regY), e = n.localToGlobal(r.width - r.regX, r.height - r.regY), o = n.localToGlobal(r.width - r.regX, 0 - r.regY), s = n.localToGlobal(0 - r.regX, r.height - r.regY), i.x = Math.min(Math.min(Math.min(f.x, e.x), o.x), s.x), i.y = Math.min(Math.min(Math.min(f.y, e.y), o.y), s.y), i.width = Math.max(Math.max(Math.max(f.x, e.x), o.x), s.x) - i.x, i.height = Math.max(Math.max(Math.max(f.y, e.y), o.y), s.y) - i.y; return i } function NoClickDelay(n) { this.element = n; window.Touch && this.element.addEventListener("touchstart", this, !1) } function shuffle(n) { for (var t = n.length, r, i; t > 0;) i = Math.floor(Math.random() * t), t--, r = n[t], n[t] = n[i], n[i] = r; return n } function ctlArcadeResume() { s_oMain !== null && s_oMain.startUpdate() } function ctlArcadePause() { s_oMain !== null && s_oMain.stopUpdate() } function getParamValue(n) { for (var i, u = window.location.search.substring(1), r = u.split("&"), t = 0; t < r.length; t++) if (i = r[t].split("="), i[0] == n) return i[1] } function fullscreenHandler() { ENABLE_FULLSCREEN && screenfull.isEnabled && (s_bFullscreen = screenfull.isFullscreen, s_oInterface !== null && s_oInterface.resetFullscreenBut(), s_oMenu !== null && s_oMenu.resetFullscreenBut()) } function CSpriteLibrary() { var t = {}, n, i, u, f, e, r; this.init = function(t, o, s) { n = {}; i = 0; u = 0; f = t; e = o; r = s }; this.addSprite = function(r, u) { if (!t.hasOwnProperty(r)) { var f = new Image; t[r] = n[r] = { szPath: u, oSprite: f, bLoaded: !1 }; i++ } }; this.getSprite = function(n) { return t.hasOwnProperty(n) ? t[n].oSprite : null }; this._onSpritesLoaded = function() { i = 0; e.call(r) }; this._onSpriteLoaded = function() { f.call(r); ++u === i && this._onSpritesLoaded() }; this.loadSprites = function() { for (var t in n) n[t].oSprite.oSpriteLibrary = this, n[t].oSprite.szKey = t, n[t].oSprite.onload = function() { this.oSpriteLibrary.setLoaded(this.szKey); this.oSpriteLibrary._onSpriteLoaded(this.szKey) }, n[t].oSprite.onerror = function(t) { var i = t.currentTarget; setTimeout(function() { n[i.szKey].oSprite.src = n[i.szKey].szPath }, 500) }, n[t].oSprite.src = n[t].szPath }; this.setLoaded = function(n) { t[n].bLoaded = !0 }; this.isLoaded = function(n) { return t[n].bLoaded }; this.getNumSprites = function() { return i } } function CPreloader() { var s, o, r, t, u, f, i, e, n; this._init = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("progress_bar", "./sprites/progress_bar.png"); s_oSpriteLibrary.addSprite("200x200", "./sprites/200x200.jpg"); s_oSpriteLibrary.loadSprites(); n = new createjs.Container; s_oStage.addChild(n) }; this.unload = function() { n.removeAllChildren() }; this._onImagesLoaded = function() {}; this._onAllImagesLoaded = function() { this.attachSprites(); s_oMain.preloaderReady() }; this.attachSprites = function() { var c = new createjs.Shape, h; c.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); n.addChild(c); h = s_oSpriteLibrary.getSprite("200x200"); i = createBitmap(h); i.regX = h.width * .5; i.regY = h.height * .5; i.x = CANVAS_WIDTH / 2; i.y = CANVAS_HEIGHT / 2 - 180; n.addChild(i); e = new createjs.Shape; e.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(i.x - 100, i.y - 100, 200, 200, 10); n.addChild(e); i.mask = e; h = s_oSpriteLibrary.getSprite("progress_bar"); t = createBitmap(h); t.x = CANVAS_WIDTH / 2 - h.width / 2; t.y = CANVAS_HEIGHT / 2 + 50; n.addChild(t); s = h.width; o = h.height; u = new createjs.Shape; u.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(t.x, t.y, 1, o); n.addChild(u); t.mask = u; r = new createjs.Text("", "30px " + PRIMARY_FONT, PRIMARY_FONT_COLOUR); r.x = CANVAS_WIDTH / 2; r.y = CANVAS_HEIGHT / 2 + 100; r.textBaseline = "alphabetic"; r.textAlign = "center"; n.addChild(r); f = new createjs.Shape; f.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); n.addChild(f); createjs.Tween.get(f).to({ alpha: 0 }, 500).call(function() { createjs.Tween.removeTweens(f); n.removeChild(f) }) }; this.refreshLoader = function(n) { r.text = n + "%"; n === 100 && (s_oMain._onRemovePreloader(), r.visible = !1, t.visible = !1); u.graphics.clear(); var i = Math.floor(n * s / 100); u.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(t.x, t.y, i, o) }; this._init() } function CMain(n) { var f, i = 0, r = 0, t = STATE_LOADING, e, u, s, h, c, o; this.initContainer = function() { s_oCanvas = document.getElementById("canvas"); s_oStage = new createjs.Stage(s_oCanvas); s_oStage.preventSelection = !1; createjs.Touch.enable(s_oStage, !0); s_bMobile = isMobile(); s_bMobile === !1 && s_oStage.enableMouseOver(20); s_iPrevTime = (new Date).getTime(); createjs.Ticker.addEventListener("tick", this._update); createjs.Ticker.framerate = FPS; navigator.userAgent.match(/Windows Phone/i) && (DISABLE_SOUND_MOBILE = !0); s_oSpriteLibrary = new CSpriteLibrary; u = new CPreloader; s_oLocalStorage = new CLocalStorage(GAME_NAME) }; this.preloaderReady = function() { (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && this._initSounds(); this._loadImages() }; this.soundLoaded = function() { i++; var n = Math.floor(i / r * 100); u.refreshLoader(n) }; this._initSounds = function() { Howler.mute(!s_bAudioActive); s_aSoundsInfo = []; s_aSoundsInfo.push({ path: "./sounds/", filename: "press_button", loop: !1, volume: 1, ingamename: "click" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "game_over", loop: !1, volume: 1, ingamename: "game_over" }); r += s_aSoundsInfo.length; s_aSounds = []; for (var n = 0; n < s_aSoundsInfo.length; n++) this.tryToLoadSound(s_aSoundsInfo[n], !1) }; this.tryToLoadSound = function(n, t) { setTimeout(function() { s_aSounds[n.ingamename] = new Howl({ src: [n.path + n.filename + ".mp3"], autoplay: !1, preload: !0, loop: n.loop, volume: n.volume, onload: s_oMain.soundLoaded, onloaderror: function(n) { for (var t = 0; t < s_aSoundsInfo.length; t++) if (s_aSounds[s_aSoundsInfo[t].ingamename]._sounds.length > 0 && n === s_aSounds[s_aSoundsInfo[t].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[t], !0); break } else document.querySelector("#block_game").style.display = "none" }, onplayerror: function(n) { for (var t = 0; t < s_aSoundsInfo.length; t++) if (n === s_aSounds[s_aSoundsInfo[t].ingamename]._sounds[0]._id) { s_aSounds[s_aSoundsInfo[t].ingamename].once("unlock", function() { s_aSounds[s_aSoundsInfo[t].ingamename].play() }); break } } }) }, t ? 200 : 0) }; this._loadImages = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("but_play", "./sprites/but_play.png"); s_oSpriteLibrary.addSprite("msg_box", "./sprites/msg_box.png"); s_oSpriteLibrary.addSprite("but_credits", "./sprites/but_credits.png"); s_oSpriteLibrary.addSprite("ctl_logo", "./sprites/ctl_logo.png"); s_oSpriteLibrary.addSprite("bg_menu", "./sprites/bg_menu.jpg"); s_oSpriteLibrary.addSprite("bg_mode_menu", "./sprites/bg_mode_menu.jpg"); s_oSpriteLibrary.addSprite("mod_easy_icon", "./sprites/mod_easy_icon.png"); s_oSpriteLibrary.addSprite("mod_medium_icon", "./sprites/mod_medium_icon.png"); s_oSpriteLibrary.addSprite("mod_hard_icon", "./sprites/mod_hard_icon.png"); s_oSpriteLibrary.addSprite("bg_game", "./sprites/bg_game.jpg"); s_oSpriteLibrary.addSprite("bg_help", "./sprites/bg_help.png"); s_oSpriteLibrary.addSprite("bg_help2", "./sprites/bg_help2.png"); s_oSpriteLibrary.addSprite("arrow", "./sprites/arrow.png"); s_oSpriteLibrary.addSprite("but_yes", "./sprites/but_yes.png"); s_oSpriteLibrary.addSprite("but_exit", "./sprites/but_exit.png"); s_oSpriteLibrary.addSprite("audio_icon", "./sprites/audio_icon.png"); s_oSpriteLibrary.addSprite("config_icon", "./sprites/config_icon.png"); s_oSpriteLibrary.addSprite("but_help_icon", "./sprites/but_help_icon.png"); s_oSpriteLibrary.addSprite("but_help_note", "./sprites/but_help_note.png"); s_oSpriteLibrary.addSprite("but_del_note", "./sprites/but_del_note.png"); s_oSpriteLibrary.addSprite("but_solve", "./sprites/but_solve.png"); s_oSpriteLibrary.addSprite("but_reset", "./sprites/but_reset.png"); s_oSpriteLibrary.addSprite("but_time", "./sprites/but_time.png"); s_oSpriteLibrary.addSprite("but_help_hint", "./sprites/but_help_hint.png"); s_oSpriteLibrary.addSprite("time_display", "./sprites/time_display.png"); s_oSpriteLibrary.addSprite("given_bg", "./sprites/given_bg.png"); s_oSpriteLibrary.addSprite("blank", "./sprites/blank.png"); s_oSpriteLibrary.addSprite("background", "./sprites/background.png"); s_oSpriteLibrary.addSprite("highlight", "./sprites/highlight.png"); s_oSpriteLibrary.addSprite("cell_selected", "./sprites/cell_selected.png"); s_oSpriteLibrary.addSprite("but_num", "./sprites/but_num.png"); s_oSpriteLibrary.addSprite("but_del_toggle", "./sprites/but_del_toggle.png"); s_oSpriteLibrary.addSprite("note_toggle", "./sprites/note_toggle.png"); s_oSpriteLibrary.addSprite("mode_toggle", "./sprites/mode_toggle.png"); s_oSpriteLibrary.addSprite("credit_bg", "./sprites/credit_bg.png"); s_oSpriteLibrary.addSprite("but_fullscreen", "./sprites/but_fullscreen.png"); s_oSpriteLibrary.addSprite("but_fullscreen_help", "./sprites/but_fullscreen_help.png"); s_oSpriteLibrary.addSprite("but_undo", "./sprites/but_undo.png"); s_oSpriteLibrary.addSprite("arrow_back", "./sprites/arrow_back.png"); r += s_oSpriteLibrary.getNumSprites(); s_oSpriteLibrary.loadSprites() }; this._onImagesLoaded = function() { i++; var n = Math.floor(i / r * 100); u.refreshLoader(n) }; this._onAllImagesLoaded = function() {}; this.onAllPreloaderImagesLoaded = function() { this._loadImages() }; this._onRemovePreloader = function() { u.unload(); this.gotoMenu() }; this.gotoMenu = function() { s = new CMenu; t = STATE_MENU }; this.goToModeMenu = function() { h = new CModeMenu; t = STATE_MENU }; this.gotoGame = function(n) { s_iDifficultyMode = n; o = new CGame(e); t = STATE_GAME }; this.gotoHelp = function() { c = new CHelp; t = STATE_HELP }; this.stopUpdate = function() { f = !1; createjs.Ticker.paused = !0; $("#block_game").css("display", "block"); Howler.mute(!0) }; this.startUpdate = function() { s_iPrevTime = (new Date).getTime(); f = !0; createjs.Ticker.paused = !1; $("#block_game").css("display", "none"); s_bAudioActive && Howler.mute(!1) }; this._update = function(n) { if (f !== !1) { var i = (new Date).getTime(); s_iTimeElaps = i - s_iPrevTime; s_iCntTime += s_iTimeElaps; s_iCntFps++; s_iPrevTime = i; s_iCntTime >= 1e3 && (s_iCurFps = s_iCntFps, s_iCntTime -= 1e3, s_iCntFps = 0); t === STATE_GAME && o.update(); s_oStage.update(n) } }; s_oMain = this; e = n; ENABLE_FULLSCREEN = n.fullscreen; ENABLE_CHECK_ORIENTATION = n.check_orientation; s_bAudioActive = n.audio_enable_on_startup; this.initContainer() } function CTextButton(n, t, i, r, u, f, e, o) { var l, c, d, g, h, a, y, p, w, s, v, b, k = o; this._init = function(n, t, i, r, u, f, e) { l = !1; c = 1; h = []; a = []; b = createBitmap(i); d = i.width; g = i.height; s = new createjs.Container; s.x = n; s.y = t; s.regX = i.width / 2; s.regY = i.height / 2; s_bMobile || (s.cursor = "pointer"); s.addChild(b, v); k.addChild(s); v = new CTLText(s, 10, 5, i.width - 20, i.height - 10, e, "center", f, u, 1, 0, 0, r, !0, !0, !1, !1); this._initListener() }; this.unload = function() { s.off("mousedown", y); s.off("pressup", p); k.removeChild(s) }; this.setVisible = function(n) { s.visible = n }; this.setAlign = function(n) { v.textAlign = n }; this.setTextX = function(n) { v.x = n }; this.setScale = function(n) { s.scaleX = s.scaleY = n; c = n }; this.enable = function() { l = !1 }; this.disable = function() { l = !0 }; this._initListener = function() { y = s.on("mousedown", this.buttonDown); p = s.on("pressup", this.buttonRelease) }; this.addEventListener = function(n, t, i) { h[n] = t; a[n] = i }; this.addEventListenerWithParams = function(n, t, i, r) { h[n] = t; a[n] = i; w = r }; this.buttonRelease = function() { l || (playSound("click", 1, !1), s.scaleX = c, s.scaleY = c, h[ON_MOUSE_UP] && h[ON_MOUSE_UP].call(a[ON_MOUSE_UP], w)) }; this.buttonDown = function() { l || (s.scaleX = c * .9, s.scaleY = c * .9, h[ON_MOUSE_DOWN] && h[ON_MOUSE_DOWN].call(a[ON_MOUSE_DOWN])) }; this.setPosition = function(n, t) { s.x = n; s.y = t }; this.tweenPosition = function(n, t, i, r, u, f, e) { createjs.Tween.get(s).wait(r).to({ x: n, y: t }, i, u).call(function() { f !== undefined && f.call(e) }) }; this.animNotify = function() { var n = 55, t = 2; createjs.Tween.get(s, { loop: !0 }).to({ rotation: -t }, n).to({ rotation: 0 }, n).to({ rotation: t }, n).to({ rotation: 0 }, n).to({ rotation: -t }, n).to({ rotation: 0 }, n).to({ rotation: t }, n).to({ rotation: 0 }, n).wait(800) }; this.changeText = function(n) { v.refreshText(n) }; this.setX = function(n) { s.x = n }; this.setY = function(n) { s.y = n }; this.getButtonImage = function() { return s }; this.getX = function() { return s.x }; this.getY = function() { return s.y }; this.getSprite = function() { return s }; this.getScale = function() { return s.scaleX }; this._init(n, t, i, r, u, f, e) } function CToggle(n, t, i, r, u) { var e, o, s, f, c, l, a, h; this._init = function(n, t, i, r) { o = []; s = []; var u = { images: [i], frames: { width: i.width / 2, height: i.height, regX: i.width / 4, regY: i.height / 2 }, animations: { state_true: [0], state_false: [1] } }, c = new createjs.SpriteSheet(u); e = r; f = createSprite(c, "state_" + e, i.width / 4, i.height / 2, i.width / 2, i.height); f.x = n; f.y = t; f.stop(); h.addChild(f); this._initListener() }; this.unload = function() { f.off("mousedown", c); f.off("pressup", l); s_bMobile || f.off("mouseover", a); h.removeChild(f) }; this._initListener = function() { c = f.on("mousedown", this.buttonDown); l = f.on("pressup", this.buttonRelease); s_bMobile || (a = f.on("mouseover", this.buttonOver)) }; this.addEventListener = function(n, t, i) { o[n] = t; s[n] = i }; this.setActive = function(n) { e = n; f.gotoAndStop("state_" + e) }; this.buttonRelease = function() { f.scaleX = 1; f.scaleY = 1; playSound("click", 1, !1); e = !e; f.gotoAndStop("state_" + e); o[ON_MOUSE_UP] && o[ON_MOUSE_UP].call(s[ON_MOUSE_UP], e) }; this.buttonDown = function() { f.scaleX = .9; f.scaleY = .9; o[ON_MOUSE_DOWN] && o[ON_MOUSE_DOWN].call(s[ON_MOUSE_DOWN]) }; this.buttonOver = function(n) { s_bMobile || (n.target.cursor = "pointer") }; this.setPosition = function(n, t) { f.x = n; f.y = t }; h = u; this._init(n, t, i, r) } function CDeleteButton(n, t, i, r) { var f, o, e, s, u, h, c, l; this._init = function(n, t, i, r) { o = !0; e = []; s = []; var h = { images: [i], frames: { width: i.width / 2, height: i.height, regX: i.width / 4, regY: i.height / 2 }, animations: { state_true: [0], state_false: [1] } }, c = new createjs.SpriteSheet(h); f = r; u = createSprite(c, "state_" + f, i.width / 4, i.height / 2, i.width / 2, i.height); u.x = n; u.y = t; u.stop(); s_oStage.addChild(u); this._initListener() }; this.unload = function() { u.off("mousedown", h); u.off("pressup", c); s_bMobile || u.off("mouseover", l); s_oStage.removeChild(u) }; this.changeMode = function() { o = !o; f = !1; u.gotoAndStop("state_" + f) }; this.reset = function() { f = !1; u.gotoAndStop("state_" + f) }; this._initListener = function() { h = u.on("mousedown", this.buttonDown); c = u.on("pressup", this.buttonRelease); s_bMobile || (l = u.on("mouseover", this.buttonOver)) }; this.buttonOver = function(n) { s_bMobile || (n.target.cursor = "pointer") }; this.addEventListener = function(n, t, i) { e[n] = t; s[n] = i }; this.setActive = function(n) { f = n; u.gotoAndStop("state_" + f) }; this.buttonRelease = function() { u.scaleX = 1; u.scaleY = 1; o ? (s_oInterface.setAllBlackColor(), f = !0, u.gotoAndStop("state_" + f), s_oGame.setDeleteState()) : s_oGame.deleteCell(); e[ON_MOUSE_UP] && e[ON_MOUSE_UP].call(s[ON_MOUSE_UP], f) }; this.buttonDown = function() { u.scaleX = .9; u.scaleY = .9; e[ON_MOUSE_DOWN] && e[ON_MOUSE_DOWN].call(s[ON_MOUSE_DOWN]) }; this.setPosition = function(n, t) { u.x = n; u.y = t }; this._init(n, t, i, r) } function CGfxButton(n, t, i, r) { var o, f, s, h, e, c, u, v, y, p, l, a; return this._init = function(n, t, i, r) { f = 1; e = []; c = []; s = i.width; h = i.height; u = createBitmap(i); u.x = n; u.y = t; u.regX = s / 2; u.regY = h / 2; l = r; l.addChild(u); this._initListener() }, this.unload = function() { u.off("mousedown", v); u.off("pressup", y); s_bMobile || u.off("mouseover", p); l.removeChild(u) }, this.setVisible = function(n) { u.visible = n }, this._initListener = function() { v = u.on("mousedown", this.buttonDown); y = u.on("pressup", this.buttonRelease); s_bMobile || (p = u.on("mouseover", this.buttonOver)) }, this.addEventListener = function(n, t, i) { e[n] = t; c[n] = i }, this.buttonRelease = function() { o || (a || (u.scaleX = f, u.scaleY = f), e[ON_MOUSE_UP] && e[ON_MOUSE_UP].call(c[ON_MOUSE_UP])) }, this.buttonDown = function() { o || (a || (u.scaleX = .9 * f, u.scaleY = .9 * f), playSound("click", 1, !1), e[ON_MOUSE_DOWN] && e[ON_MOUSE_DOWN].call(c[ON_MOUSE_DOWN])) }, this.buttonOver = function(n) { s_bMobile || (n.target.cursor = "pointer") }, this.pulseAnimation = function() { a = createjs.Tween.get(u, { loop: !0 }).to({ scaleX: f * 1.1, scaleY: f * 1.1 }, 850, createjs.Ease.quadOut).to({ scaleX: f, scaleY: f }, 650, createjs.Ease.quadIn) }, this.setPosition = function(n, t) { u.x = n; u.y = t }, this.setX = function(n) { u.x = n }, this.setY = function(n) { u.y = n }, this.getButtonImage = function() { return u }, this.getX = function() { return u.x }, this.getY = function() { return u.y }, this.enable = function() { o = !1; u.filters = []; u.cache(0, 0, s, h) }, this.disable = function() { o = !0; try { var n = (new createjs.ColorMatrix).adjustSaturation(-100).adjustBrightness(40); u.filters = [new createjs.ColorMatrixFilter(n)]; u.cache(0, 0, s, h) } catch (t) {} }, this._init(n, t, i, r), this } function CMenu() { var s, h, i, r, u, c, f, n = null, l = null, e, t, o; this._init = function() { var p, a, v, y; s = createBitmap(s_oSpriteLibrary.getSprite("bg_menu")); s_oStage.addChild(s); s_oLocalStorage.isUsed() ? (p = TEXT_NEW, a = s_oSpriteLibrary.getSprite("but_play"), i = new CTextButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 400, a, TEXT_CONTINUE, SECONDARY_FONT, "#ffffff", 100, s_oStage), i.addEventListener(ON_MOUSE_UP, this._onButContinue, this), i.animNotify()) : p = TEXT_PLAY; a = s_oSpriteLibrary.getSprite("but_play"); h = new CTextButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT - 600, a, p, SECONDARY_FONT, "#ffffff", 100, s_oStage); h.addEventListener(ON_MOUSE_UP, this._onButPlayRelease, this); (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && (a = s_oSpriteLibrary.getSprite("audio_icon"), e = { x: CANVAS_WIDTH - a.height / 2 - 10, y: a.height / 2 + 10 }, u = new CToggle(e.x, e.y, a, s_bAudioActive, s_oStage), u.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this)); a = s_oSpriteLibrary.getSprite("but_credits"); t = { x: a.height / 2 + 10, y: a.height / 2 + 10 }; c = new CGfxButton(t.x, t.y, a, s_oStage); c.addEventListener(ON_MOUSE_UP, this._onButCreditRelease, this); v = window.document; y = v.documentElement; n = y.requestFullscreen || y.mozRequestFullScreen || y.webkitRequestFullScreen || y.msRequestFullscreen; l = v.exitFullscreen || v.mozCancelFullScreen || v.webkitExitFullscreen || v.msExitFullscreen; ENABLE_FULLSCREEN === !1 && (n = !1); n && screenfull.isEnabled && (a = s_oSpriteLibrary.getSprite("but_fullscreen"), o = { x: t.x + a.width / 2 + 10, y: t.y }, f = new CToggle(o.x, o.y, a, s_bFullscreen, s_oStage), f.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); r = new createjs.Shape; r.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(r); createjs.Tween.get(r).to({ alpha: 0 }, 1e3).call(function() { r.visible = !1 }); this.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_oLocalStorage.isAvailable() || new CMsgBox(TEXT_IOS_PRIVATE) }; this.unload = function() { h.unload(); h = null; i && (i.unload(), i = null); (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && (u.unload(), u = null); n && screenfull.isEnabled && f.unload(); s_oStage.removeChild(s); s = null; s_oMenu = null }; this.refreshButtonPos = function(i, r) { c.setPosition(t.x + i, r + t.y); (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && u.setPosition(e.x - i, r + e.y); n && screenfull.isEnabled && f.setPosition(o.x + i, o.y + r) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this._onButPlayRelease = function() { if (s_oLocalStorage.isUsed()) { var n = new CAreYouSurePanel(s_oMenu._onConfirmExit); n.setMsg(TEXT_WARNING_NEW_GAME) } else this._onConfirmExit() }; this._onConfirmExit = function() { s_oLocalStorage.deleteData(); s_oMenu.unload(); $(s_oMain).trigger("start_session"); s_oMain.goToModeMenu() }; this._onButContinue = function() { s_oMenu.unload(); $(s_oMain).trigger("start_session"); s_oMain.gotoGame() }; this._onButCreditRelease = function() { new CCreditsPanel }; this.resetFullscreenBut = function() { n && screenfull.isEnabled && f.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? l.call(window.document) : n.call(window.document.documentElement); sizeHandler() }; s_oMenu = this; this._init() } function CModeMenu() { var o, n, t, i, l, s, a, h, v, c, y, e, r, u, f; this._init = function() { var u, p; o = createBitmap(s_oSpriteLibrary.getSprite("bg_mode_menu")); s_oStage.addChild(o); y = new CTLText(s_oStage, CANVAS_WIDTH / 2 - 500, 220, 1e3, 100, 100, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_TOP_MODE, !0, !0, !1, !1); u = { x: CANVAS_WIDTH / 2, y: 300 }; n = new createjs.Container; n.x = u.x; n.y = u.y + 120; t = new createjs.Container; t.x = u.x; t.y = u.y + 550; i = new createjs.Container; i.x = u.x; i.y = u.y + 980; l = new CTLText(n, -160, -40, 320, 50, 50, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_EASY, !0, !0, !1, !1); p = s_oSpriteLibrary.getSprite("mod_easy_icon"); s = new CGfxButton(u.x, u.y + 280, p, s_oStage); s.addEventListener(ON_MOUSE_UP, this._selectEasy, this); a = new CTLText(t, -160, -40, 320, 50, 50, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_MEDIUM, !0, !0, !1, !1); p = s_oSpriteLibrary.getSprite("mod_medium_icon"); h = new CGfxButton(u.x, u.y + 710, p, s_oStage); h.addEventListener(ON_MOUSE_UP, this._selectMedium, this); v = new CTLText(i, -160, -40, 320, 50, 50, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_HARD, !0, !0, !1, !1); p = s_oSpriteLibrary.getSprite("mod_hard_icon"); c = new CGfxButton(u.x, u.y + 1140, p, s_oStage); c.addEventListener(ON_MOUSE_UP, this._selectHard, this); s_oStage.addChild(n, t, i); p = s_oSpriteLibrary.getSprite("arrow_back"); f = { x: p.width / 2 + 10, y: CANVAS_HEIGHT - p.height / 2 - 10 }; e = new CGfxButton(f.x, f.y, p, s_oStage); e.addEventListener(ON_MOUSE_UP, this._onExit, this); r = new createjs.Shape; r.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(r); createjs.Tween.get(r).to({ alpha: 0 }, 400).call(function() { r.visible = !1 }); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.unload = function() { s_oStage.removeAllChildren(); e.unload(); o = null }; this.refreshButtonPos = function(n, t) { e.setPosition(f.x + n, f.y - t) }; this._selectEasy = function() { u.unload(); $(s_oMain).trigger("start_level", 1); s_oMain.gotoGame(0) }; this._selectMedium = function() { u.unload(); $(s_oMain).trigger("start_level", 1); s_oMain.gotoGame(1) }; this._selectHard = function() { u.unload(); $(s_oMain).trigger("start_level", 1); s_oMain.gotoGame(2) }; this._onExit = function() { u.unload(); s_oMain.gotoMenu() }; u = this; this._init(); s_oModeMenu = this } function CGame(n) { function ot(n) { n || (n = window.event); n.preventDefault(); var t = n.keyCode - 48; t < 10 && t > 0 ? r.pressNumButton(t) : t === -2 ? r.pressDelButton() : t < 58 && t > 48 && (t -= 48, r.pressNumButton(t)) } function st(n) { n.preventDefault(); var t = n.keyCode - 48; t < 10 && t > 0 ? r.releaseNumButton(t) : t === -2 ? r.releaseDelButton() : t < 58 && t > 48 && (t -= 48, r.releaseNumButton(t)) } var h, it, b, c, v, y, rt, l, p, o, e, ft, w, k, i, f, u, r, d = null, et, t, ut, a, s, g, nt, tt; this._init = function() { b = !1; c = !1; v = !1; y = !1; rt = !1; l = !1; e = 0; o = 0; p = 0; w = 0; k = 0; nt = 0; tt = []; var n = createBitmap(s_oSpriteLibrary.getSprite("bg_game")); s_oStage.addChild(n); a = null; r = new CInterface; t = new CGrid; s_oLocalStorage.isUsed() ? this.resumeGame() : this.setNewGame(); s_bMobile === !1 && (document.onkeydown = ot, document.onkeyup = st) }; this.unload = function() { r.unload(); d !== null && d.unload(); createjs.Tween.removeAllTweens(); s_oStage.removeAllChildren(); s_oGame = null }; this.setNewGame = function() { var n, t; for (i = new Array(81), this._generateValidGrid(i), i = this._convertToMatrix(i), f = [], n = 0; n < 9; n++) for (f[n] = [], t = 0; t < 9; t++) f[n][t] = i[n][t]; ut = new CSudokuLoader; it = !0 }; this.resumeGame = function() { var n, o, s; for (f = [], i = [], u = [], n = 0; n < 9; n++) for (f[n] = [], i[n] = [], u[n] = [], o = 0; o < 9; o++) i[n][o] = s_aSolution[n][o], f[n][o] = s_aSolution[n][o], u[n][o] = s_aGridMask[n][o]; if (this._coverGrid(i), this.setGrid(i), s_aGridState !== null) for (n = 0; n < 9; n++) for (o = 0; o < 9; o++) t.isGiven(n, o) || (s_aGridState[n][o] !== 0 ? (s = s_aGridState[n][o], t.resumeNum(s, n, o), r.updateCounterOnButton(s, t.getList(s).length), i[n][o] = s) : s_aNotesWritten !== null && s_aNotesWritten[n][o].length > 0 && t.resumeNotes(s_aNotesWritten[n][o], n, o)); y = s_oGameParam.helpnotes; l = s_oGameParam.helptime; w = s_oGameParam.numhint; e = s_oGameParam.time; s_iDifficultyMode = s_oGameParam.difficulty; l && this.setNoTime(); h = !0 }; this.saveData = function() { nt = 0; s_oGameParam = { helpnotes: y, helptime: l, numhint: w, time: e, difficulty: s_iDifficultyMode }; s_oLocalStorage.saveData() }; this.getHint = function() { var n, r, u; for (w++, n = [], r = 0; r < 9; r++) for (u = 0; u < 9; u++) i[r][u] === 0 && n.push({ row: r, col: u }); if (n.length === 1) { this.gameOver(); return } if (n.length !== 0) { shuffle(n); var e = n[0].row, o = n[0].col, s = f[e][o]; i[e][o] = s; t.setHintNumber(e, o, s); t.setActiveCell(n[0]); t.updateNote(s); t.setActiveCell(n[0]); this._getEndCounterAndSetButCounter(); s_aGridState = i; this.saveData() } }; this.setNoTime = function() { h = !1; r.setNoTime(); l = !0; this.saveData() }; this.solveAndWrite = function() { for (var r, n = 0; n < 9; n++) for (r = 0; r < 9; r++) t.isGiven(n, r) && i[n][r] === f[n][r] || (t.setSolvedNumber(n, r, f[n][r]), i[n][r] = f[n][r]); this._setEndingStateWhenSolve(); rt = !0 }; this.resetGame = function() { for (var r, n = 0; n < 9; n++) for (r = 0; r < 9; r++) t.isGiven(n, r) || (t.deleteResetNumber(n, r), i[n][r] = 0); this._getEndCounterAndSetButCounter(); t.turnOffAllCells(); t.highlightCells() }; this.fillWithNote = function() { var u, r, n, i; for (this.clearNoteFill(), u = t.getList(0), r = 0; r < u.length; r++) for (n = u[r], i = 1; i < 10; i++) t.checkCollision(i, n.row, n.col, !1) !== !0 && t.writeHelpNote(i, n.row, n.col); y = !0; s_aNotesWritten = t.getAllNotes(); this.saveData() }; this.deleteAllNote = function() { this.clearNoteFill(); s_aNotesWritten = t.getAllNotes(); this.saveData() }; this.clearNoteFill = function() { t.deleteAllNote() }; this.setNoteState = function() { b = !b }; this.setDigitState = function() { v = !v; c = !1; p = 0 }; this.setDeleteState = function() { c = !0; p = 0 }; this.setCurNum = function(n) { c = !1; p = n }; this.activeCell = function(n) { v && !c ? (t.setActiveCell(n), this.writeNum(p)) : v && c ? (t.setActiveCell(n), t.deleteCell()) : t.setActiveCell(n) }; this.writeNum = function(n) { var f; if (b) t.writeNote(n), s_aNotesWritten = t.getAllNotes(); else { var e = t.getCurActiveCell().row, o = t.getCurActiveCell().col, u = t.getCurActiveCell().num; this.addHistory(n, u); f = t.writeNum(n); r.updateCounterOnButton(n, t.getList(n).length); u !== 0 && r.updateCounterOnButton(u, t.getList(u).length); f && (i[e][o] = n) } s_aGridState = i; this.saveData() }; this.deleteCell = function() { var n = t.getCurActiveCell().num, u = t.getCurActiveCell().row, f = t.getCurActiveCell().col; t.deleteCell(); n !== 0 && (this.addHistory(0, n), r.updateCounterOnButton(n, t.getList(n).length), i[u][f] = 0, s_aGridState = i); s_aNotesWritten = t.getAllNotes(); this.saveData() }; this.showPausePanel = function(n) { n ? a === null && (a = new CPausePanel) : a !== null && (a.unload(), a = null) }; this.tryShowAd = function() { k++; k === AD_SHOW_COUNTER && (k = 0, $(s_oMain).trigger("show_interlevel_ad")) }; this.restartGame = function() { this.unload(); this._init() }; this.onExit = function() { this.saveData(); this.unload(); s_oMain.gotoMenu() }; this._onExitHelp = function() { h = !0 }; this.checkEndGame = function(n) { n === "add" ? o++ : o--; o === 81 && this.gameOver() }; this.gameOver = function() { var n = Math.floor((TIME_BONUS_LIMIT[s_iDifficultyMode] - e) / 100); d = new CEndPanel(s_oSpriteLibrary.getSprite("msg_box"), y, rt, l, w, n); d.show(e); s_oLocalStorage.deleteData() }; this.addHistory = function(n, i) { var u = t.getCurActiveCell().row, f = t.getCurActiveCell().col, e = t.checkCollision(n, u, f, !1) && n > 0, o = !t.isGiven(u, f) && !(n === i); o && !e && (tt.push({ row: u, col: f, numpushed: n, oldnum: i }), r.enableUndo()) }; this.undo = function() { var f = tt.pop(), e = f.row, o = f.col, n = f.oldnum, u = f.numpushed, s = { row: e, col: o }; t.setActiveCell(s); n === 0 ? (t.deleteCell(), r.updateCounterOnButton(u, t.getList(u).length), i[e][o] = 0) : (t.writeNum(n), r.updateCounterOnButton(n, t.getList(n).length), u !== 0 && r.updateCounterOnButton(u, t.getList(u).length), i[e][o] = n); s_aGridState = i; this.saveData(); tt.length === 0 && r.disableUndo() }; this.pauseTimer = function(n) { h = !n }; this.update = function() { var o, n, t; if (it) for (ut.update(), o = 0; o < 12; o++) { for (n = 0; n < 9; n++) for (t = 0; t < 9; t++) i[n][t] = f[n][t]; if (this._generateMask(s_iDifficultyMode), this._coverGrid(i), ft = solve(i), ft !== 1) { it = !1; ut.unload(); this._coverGrid(i); this.setGrid(i); h = !0; s_oMain.startUpdate(); s_aSolution = f; s_aGridMask = u; this.saveData(); break } } h && (nt += s_iTimeElaps, nt > TIME_SAVE_DATA && this.saveData(), e += s_iTimeElaps, e > 5999e3 && (e = 5999e3), r.refreshTime(formatTime(e))) }; this.setGrid = function(n) { for (var r, i = 0; i < 9; i++) for (r = 0; r < 9; r++) t.setGiven(i, r, n[i][r]); this._getEndCounterAndSetButCounter() }; this._getEndCounterAndSetButCounter = function() { var n, i; for (o = 0, n = 1; n < 10; n++) i = t.getList(n).length, o += i, r.updateCounterOnButton(n, i) }; this._setEndingStateWhenSolve = function() { o = 81; for (var n = 1; n < 10; n++) r.updateCounterOnButton(n, 9); s = new createjs.Shape; s.graphics.beginFill("rgba(255,255,255,0.01)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(s); g = s.on("mousedown", this.buttonDownWhenSolve); s_bMobile || (g = s.on("mouseover", this.buttonOverWhenSolve)) }; this.buttonDownWhenSolve = function() { s.off("mousedown", g); s_bMobile || s.off("mouseover", g); et.gameOver() }; this.buttonOverWhenSolve = function(n) { s_bMobile || (n.target.cursor = "pointer") }; this._convertToMatrix = function(n) { for (var i = 0, r = [], t = 0; t < 81; t += 9) r[i] = [n[t], n[t + 1], n[t + 2], n[t + 3], n[t + 4], n[t + 5], n[t + 6], n[t + 7], n[t + 8]], i++; return r }; this._generateMask = function(n) { function b(n, t) { return n.weightTotal < t.weightTotal ? -1 : n.weightTotal > t.weightTotal ? 1 : 0 } var e, l, c, o, s, h, p, a, r, i, w, f, v, y, t; for (u = [], t = 0; t < 9; t++) for (u[t] = [], i = 0; i < 9; i++) u[t][i] = 0; e = MAX_GIVENS_EASY - RANGE_GIVENS; switch (n) { case EASY_MODE: e = MAX_GIVENS_EASY - RANGE_GIVENS; l = e + Math.ceil(Math.random() * RANGE_GIVENS); c = LOWER_BOUND_EASY; break; case MEDIUM_MODE: e = MAX_GIVENS_MEDIUM - RANGE_GIVENS; l = e + Math.ceil(Math.random() * RANGE_GIVENS); c = LOWER_BOUND_MEDIUM; break; case HARD_MODE: e = MAX_GIVENS_HARD - RANGE_GIVENS; l = e + Math.ceil(Math.random() * RANGE_GIVENS); c = LOWER_BOUND_HARD } for (o = [], t = 0; t < 9; t++) t < c ? o.push(1) : o.push(0); for (s = [], t = 0; t < 9; t++) for (s[t] = 0, shuffle(o), i = 0; i < 9; i++) o[i] === 1 && (u[t][i] = 1); for (h = [], t = 0; t < 9; t++) for (h[t] = 0, shuffle(o), i = 0; i < 9; i++) o[i] === 1 && (u[i][t] = 1); for (p = 0, t = 0; t < 9; t++) for (i = 0; i < 9; i++) u[t][i] === 1 && (s[t]++, h[i]++, p++); if (a = p - l, a < 0) this._generateMask(s_iDifficultyMode); else if (a === 0) return; for (r = [], t = 0; t < 9; t++) for (i = 0; i < 9; i++) u[t][i] === 1 && r.push({ row: t, col: i, weightRow: s[t], weightCol: h[i], weightTotal: s[t] + h[i] }); for (r.sort(b), w = 0; w < a;) { if (f = r.length - 1, f < 0) return; if (r[f].weightRow > c && r[f].weightCol > c) { for (u[r[f].row][r[f].col] = 0, v = r[f].row, y = r[f].col, s[v]--, h[y]--, t = 0; t < r.length; t++) r[t].row === v && (r[t].weightRow = s[v], r[t].weightTotal--), r[t].col === y && (r[t].weightCol = h[y], r[t].weightTotal--); w++ } r.pop() } }; this._coverGrid = function(n) { for (var i, t = 0; t < 9; t++) for (i = 0; i < 9; i++) u[t][i] === 0 && (n[t][i] = 0) }; this.printGrid = function(n) { for (var t, i = "", r = 0; r < 9; r++) { for (t = 0; t < 9; t++) i += n[r][t] + " ", (t === 2 || t === 5) && (i += "| "); i += "\n"; (r === 2 || r === 5) && (i += "---------------------\n") } trace(i) }; this._generateValidGrid = function(n) { for (var o, s, h, f, c, l, a, v, t, r, y, p, i, e, u = 0; u < 9; u++) for (o = 0; o < 9; o++) n[u * 9 + o] = (u * 3 + Math.floor(u / 3) + o) % 9 + 1; for (u = 0; u < 42; u++) { s = Math.ceil(Math.random() * 9); do h = Math.ceil(Math.random() * 9); while (s === h); for (t = 0; t < 9; t++) for (i = 0; i < 9; i++) n[t * 9 + i] === s ? n[t * 9 + i] = h : n[t * 9 + i] === h && (n[t * 9 + i] = s) } for (f = 0; f < 42; f++) for (c = Math.floor(Math.random() * 3), l = Math.floor(Math.random() * 3), t = 0; t < 9; t++) e = n[t * 9 + (c * 3 + f % 3)], n[t * 9 + (c * 3 + f % 3)] = n[t * 9 + (l * 3 + f % 3)], n[t * 9 + (l * 3 + f % 3)] = e; for (r = 0; r < 42; r++) for (a = Math.floor(Math.random() * 3), v = Math.floor(Math.random() * 3), t = 0; t < 9; t++) e = n[t * 9 + (r % 3 * 3 + a)], n[t * 9 + (r % 3 * 3 + a)] = n[t * 9 + (r % 3 * 3 + v)], n[t * 9 + (r % 3 * 3 + v)] = e; for (r = 0; r < 42; r++) for (y = Math.floor(Math.random() * 3), p = Math.floor(Math.random() * 3), i = 0; i < 9; i++) e = n[(r % 3 * 3 + y) * 9 + i], n[(r % 3 * 3 + y) * 9 + i] = n[(r % 3 * 3 + p) * 9 + i], n[(r % 3 * 3 + p) * 9 + i] = e }; s_oGame = this; MAX_GIVENS_EASY = n.max_givens_beginner; MAX_GIVENS_MEDIUM = n.max_givens_intermediate; MAX_GIVENS_HARD = n.max_givens_advanced; TIME_BONUS_LIMIT[0] = n.bonus_time_beginner; TIME_BONUS_LIMIT[1] = n.bonus_time_intermediate; TIME_BONUS_LIMIT[2] = n.bonus_time_advanced; AD_SHOW_COUNTER = n.ad_show_counter; et = this; this._init() } function CInterface() { var n, t, v, y, l, p, u, f, w, a, i, e, b, o, s, h, r, c; return this._init = function() { var b, k, d, g, e; for (n = [], b = { x: 97, y: 1500 }, k = { x: 177.5, y: 150 }, d = 0; d < 9; d++) n[d + 1] = d > 5 ? new CNumButton(b.x + (d - 6) * k.x, b.y + k.y, d + 1) : new CNumButton(b.x + d * k.x, b.y, d + 1); e = s_oSpriteLibrary.getSprite("but_del_toggle"); t = new CDeleteButton(b.x + 3 * k.x, b.y + k.y, e, !1); t.changeMode(); e = s_oSpriteLibrary.getSprite("note_toggle"); v = new CToggle(b.x + 4 * k.x, b.y + k.y, e, !0, s_oStage); v.addEventListener(ON_MOUSE_UP, this._onNoteToggle, this); e = s_oSpriteLibrary.getSprite("mode_toggle"); y = new CToggle(b.x + 5 * k.x, b.y + k.y, e, !0, s_oStage); y.addEventListener(ON_MOUSE_UP, this._onModeToggle, this); e = s_oSpriteLibrary.getSprite("but_exit"); o = { x: CANVAS_WIDTH - e.height / 2 - 20, y: e.height / 2 + 10 }; a = new CGfxButton(o.x, o.y, e, s_oStage); a.addEventListener(ON_MOUSE_UP, this._onExit, this); g = CANVAS_WIDTH - e.width / 2 - 175; s = { x: g, y: e.height / 2 + 10 }; (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && (e = s_oSpriteLibrary.getSprite("audio_icon"), f = new CToggle(s.x, s.y, e, s_bAudioActive, s_oStage), f.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this)); g = CANVAS_WIDTH - e.width / 2 - 257; e = s_oSpriteLibrary.getSprite("config_icon"); h = { x: g, y: e.height / 2 + 10 }; w = new CGfxButton(h.x, h.y, e, s_oStage); w.addEventListener(ON_MOUSE_UP, this._onConf, this); g = CANVAS_WIDTH - e.width / 2 - 490; e = s_oSpriteLibrary.getSprite("but_help_icon"); r = { x: g, y: e.height / 2 + 10 }; l = new CGfxButton(r.x, r.y, e, s_oStage); l.addEventListener(ON_MOUSE_UP, this._onHelpPress, this); g = r.x - e.width - 10; e = s_oSpriteLibrary.getSprite("but_undo"); c = { x: g, y: e.height / 2 + 10 }; i = new CGfxButton(c.x, c.y, e, s_oStage); i.addEventListener(ON_MOUSE_UP, this._onUndoPress, this); this.disableUndo(); e = s_oSpriteLibrary.getSprite("time_display"); u = createBitmap(e); u.x = 30; u.y = 260; s_oStage.addChild(u); p = new CTLText(s_oStage, 55, 276, 150, 60, 60, "center", "#fff", PRIMARY_FONT, 1.1, 0, 0, "00:00", !0, !0, !1, !1); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }, this.unload = function() { (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && (f.unload(), f = null); a.unload(); for (var r = 0; r < 9; r++) n[r + 1].unload(); t.unload(); v.unload(); y.unload(); l.unload(); i.unload(); e = null; s_oInterface = null }, this.refreshButtonPos = function(n, t) { a.setPosition(o.x - n, t + o.y); w.setPosition(h.x - n, t + h.y); l.setPosition(r.x - n, t + r.y); i.setPosition(c.x - n, t + c.y); (DISABLE_SOUND_MOBILE === !1 || s_bMobile === !1) && f.setPosition(s.x - n, t + s.y) }, this.refreshTime = function(n) { p.refreshText(n) }, this._onConf = function() { e = new CConfigPanel }, this.setNoTime = function() { s_oStage.removeChild(p.getText()); s_oStage.removeChild(u) }, this._onHelpPress = function() { new CHelpPanel; s_oGame.pauseTimer(!0) }, this.enableUndo = function() { i.enable() }, this.disableUndo = function() { i.disable() }, this._onUndoPress = function() { s_oGame.undo() }, this._onNoteToggle = function() { s_oGame.setNoteState() }, this._onModeToggle = function() { for (var i = 0; i < 9; i++) n[i + 1].changeMode(); t.changeMode(); this.setAllBlackColor(); s_oGame.setDigitState() }, this.updateCounterOnButton = function(t, i) { t > 0 && t <= 9 && (n[t].clearCounter(), n[t].setCounter(i)) }, this.pressNumButton = function(t) { n[t].buttonDown() }, this.releaseNumButton = function(t) { n[t].buttonRelease() }, this.pressDelButton = function() { t.buttonDown() }, this.releaseDelButton = function() { t.buttonRelease() }, this.setAllBlackColor = function() { for (var i = 0; i < 9; i++) n[i + 1].changeNumColor(!1); t.reset() }, this.resetFullscreenBut = function() { e && e.resetFullscreenBut() }, this.onExitFromConfig = function() { e = null }, this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }, this._onExit = function() { b = new CAreYouSurePanel(s_oInterface._onConfirmExit) }, this._onNegateExit = function() { b = null }, this._onConfirmExit = function() { b = null; $(s_oMain).trigger("end_level", 1); $(s_oMain).trigger("end_session"); $(s_oMain).trigger("show_interlevel_ad"); s_oGame.onExit() }, s_oInterface = this, this._init(), this } function CHelpPanel() { var a, v, u, y, p, w, b, k, f, e, r, n, o, s, h, c, l, t, i; this._init = function() { var o = this, d; r = new createjs.Container; s_oStage.addChild(r); f = createBitmap(s_oSpriteLibrary.getSprite("bg_help")); r.addChild(f); d = { x: CANVAS_WIDTH / 2, y: CANVAS_HEIGHT / 2 - 400 }; a = new CTLText(r, d.x - 350, d.y - 210, 700, 140, 140, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_HELP0, !0, !0, !1, !1); v = new CTLText(r, d.x - 400, d.y, 800, 250, 48, "center", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1, 0, 0, TEXT_HELP1, !0, !0, !0, !1); s = r.on("pressup", function() { o._onExitHelp() }); n = new createjs.Container; n.visible = 0; s_oStage.addChild(n); n.on("pressup", function() { o._onExitHelp() }); if (e = createBitmap(s_oSpriteLibrary.getSprite("bg_help2")), n.addChild(e), u = s_bMobile === !1 ? TEXT_HELP1_PAGE2 : TEXT_HELP1_MOB_PAGE2, y = new CTLText(n, d.x - 400, d.y - 210, 800, 140, 140, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_HELP0_PAGE2, !0, !0, !1, !1), p = new CTLText(n, CANVAS_WIDTH / 2 - 400, CANVAS_HEIGHT / 2 - 470, 800, 80, 35, "center", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1, 0, 0, u, !0, !0, !0, !1), w = new CTLText(n, CANVAS_WIDTH / 2 - 200, CANVAS_HEIGHT / 2 - 300, 600, 150, 35, "left", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1, 0, 0, TEXT_HELP2_PAGE2, !0, !0, !0, !1), b = new CTLText(n, CANVAS_WIDTH / 2 - 380, CANVAS_HEIGHT / 2 + 10, 600, 150, 35, "right", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1, 0, 0, TEXT_HELP3_PAGE2, !0, !0, !0, !1), k = new CTLText(n, CANVAS_WIDTH / 2 - 200, CANVAS_HEIGHT / 2 + 300, 600, 150, 35, "left", PRIMARY_FONT_COLOUR, PRIMARY_FONT, 1, 0, 0, TEXT_HELP4_PAGE2, !0, !0, !0, !1), h = n.on("pressup", function() { o._onExitHelp() }), createjs.Tween.get(n).to({ alpha: 1 }, 700), t = createBitmap(s_oSpriteLibrary.getSprite("arrow")), t.x = 740, t.y = 1450, t.alpha = 0, c = t.on("click", o._changePageTo2), !s_bMobile) t.on("mouseover", o.buttonOver); if (s_oStage.addChild(t), i = createBitmap(s_oSpriteLibrary.getSprite("arrow")), i.scaleX = -1, i.x = 340, i.y = 1450, i.visible = !1, l = i.on("click", o._changePageTo1), !s_bMobile) i.on("mouseover", o.buttonOver); s_oStage.addChild(i); createjs.Tween.get(t).to({ alpha: 1 }, 700) }; this.unload = function() { s_oStage.removeChild(r, n, t, i); var u = this; r.off("pressup", s); n.off("pressup", h); s_bMobile || (t.off("mouseover", c), i.off("mouseover", l)) }; this._changePageTo1 = function() { n.visible = !1; i.visible = !1; r.visible = !0; t.visible = !0 }; this._changePageTo2 = function() { r.visible = !1; t.visible = !1; n.visible = !0; i.visible = !0 }; this.buttonOver = function(n) { s_bMobile || (n.target.cursor = "pointer") }; this._onExitHelp = function() { $(s_oMain).trigger("show_interlevel_ad"); o.unload(); s_oGame._onExitHelp() }; o = this; this._init() } function CPausePanel() { var i, t, n; this._init = function() { i = createBitmap(s_oSpriteLibrary.getSprite("msg_box")); n = new createjs.Text(TEXT_PAUSE, " 120px " + SECONDARY_FONT, PRIMARY_FONT_COLOUR); n.x = CANVAS_WIDTH / 2; n.y = CANVAS_HEIGHT / 2; n.textAlign = "center"; n.textBaseline = "alphabetic"; n.lineWidth = 700; t = new createjs.Container; t.addChild(i, n); s_oStage.addChild(t); s_oStage.update() }; this.unload = function() { s_oStage.removeChild(t) }; this._init() } function CSudokuLoader() { var r, n, i, f, t, u; this._init = function() { r = !0; n = 0; i = new createjs.Container; s_oStage.addChild(i); var e = (new createjs.Graphics).beginFill("rgba(0,0,0,0.8)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); u = new createjs.Shape(e); u.on("click", function() {}); i.addChild(u); f = new CTLText(i, CANVAS_WIDTH * .5 - 400, CANVAS_HEIGHT * .5 - 100, 800, 120, 60, "center", "#fff", SECONDARY_FONT, 1, 0, 0, TEXT_GENERATE_SUDOKU, !0, !0, !0, !1); t = new createjs.Text("", " 180px " + PRIMARY_FONT, "#ffffff"); t.x = CANVAS_WIDTH * .5 - 76; t.y = CANVAS_HEIGHT * .5 + 50; t.textAlign = "left"; t.textBaseline = "alphabetic"; t.lineWidth = 800; i.addChild(t) }; this.unload = function() { r = !1; s_oStage.removeChild(i) }; this.update = function() { r && (n += s_iTimeElaps, n >= 0 && n < TIME_LOOP_WAIT / 4 ? t.text = "" : n >= TIME_LOOP_WAIT / 4 && n < TIME_LOOP_WAIT / 2 ? t.text = "." : n >= TIME_LOOP_WAIT / 2 && n < TIME_LOOP_WAIT * 3 / 4 ? t.text = ".." : n >= TIME_LOOP_WAIT * 3 / 4 && n < TIME_LOOP_WAIT ? t.text = "..." : n = 0) }; s_oSudokuLoader = this; this._init() } function CEndPanel(n, t, i, r, u, f) { var s, o, h, v, e, c, l, y, a; return this._init = function(n, t, i, r, u, f) { var p, a; s = f; u > 0 && (p = Math.floor(TIME_BONUS_LIMIT[s_iDifficultyMode] / 4e3), s -= p * u); t && (s /= 2); (i || r) && (s = 0); s < 0 && (s = 0); o = []; t && o.push(TEXT_HELP_NOTE + " " + TEXT_INFO_NOTE); i && o.push(TEXT_HELP_SOLVE + " " + TEXT_INFO_SOLVE); r && o.push(TEXT_HELP_TIME + " " + TEXT_INFO_SOLVE); u > 0 && (u > 1 ? o.push(u + TEXT_HELP_HINTS + " (-" + p + " " + TEXT_INFO_HINT) : o.push(u + TEXT_HELP_HINT + " (-" + p + " " + TEXT_INFO_HINT)); e = new createjs.Container; e.alpha = 0; e.visible = !1; s_oStage.addChild(e); v = createBitmap(n); e.addChild(v); c = new CTLText(e, CANVAS_WIDTH / 2 - 350, CANVAS_HEIGHT / 2 - 562, 700, 300, 80, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, " ", !0, !0, !0, !1); l = new CTLText(e, CANVAS_WIDTH / 2 - 350, CANVAS_HEIGHT / 2 - 220, 700, 80, 50, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, " ", !0, !0, !0, !1); h = []; a = { x: CANVAS_WIDTH / 2 - 350 }; h[0] = new CTLText(e, a.x, CANVAS_HEIGHT / 2 - 90, 700, 80, 40, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, " ", !0, !0, !0, !1); h[1] = new CTLText(e, a.x, CANVAS_HEIGHT / 2 + 10, 700, 80, 40, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, " ", !0, !0, !0, !1); h[2] = new CTLText(e, a.x, CANVAS_HEIGHT / 2 + 110, 700, 80, 40, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, " ", !0, !0, !0, !1); h[3] = new CTLText(e, a.x, CANVAS_HEIGHT / 2 + 210, 700, 80, 40, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, " ", !0, !0, !0, !1); y = new CTLText(e, a.x, CANVAS_HEIGHT / 2 + 380, 700, 70, 70, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, " ", !0, !0, !1, !1) }, this.unload = function() { e.off("mousedown", a) }, this._initListener = function() { a = e.on("mousedown", this._onExit) }, this.show = function(n) { var a, v, p; if (playSound("game_over", 1, !1), n = formatTime(n), a = [], a[0] = TEXT_EASY, a[1] = TEXT_MEDIUM, a[2] = TEXT_HARD, r ? c.refreshText(TEXT_GAMEOVER + a[s_iDifficultyMode] + TEXT_SUDOKU) : c.refreshText(TEXT_GAMEOVER + a[s_iDifficultyMode] + TEXT_SUDOKU + TEXT_IN + n), o.length === 1 ? l.refreshText(TEXT_HELP_USED) : o.length > 1 && l.refreshText(TEXT_HELPS_USED), o.length > 0) for (v = 0; v < o.length; v++) h[v].refreshText("-" + o[v]); y.refreshText(TEXT_SCORE + " " + s); e.visible = !0; p = this; createjs.Tween.get(e).to({ alpha: 1 }, 500).call(function() { p._initListener() }); $(s_oMain).trigger("save_score", [s, s_iDifficultyMode, n, t, i, r, u]); $(s_oMain).trigger("share_event", f); $(s_oMain).trigger("end_level", 1) }, this._onExit = function() { e.off("mousedown", a); s_oStage.removeChild(e); $(s_oMain).trigger("end_session"); s_oGame.onExit() }, this._init(n, t, i, r, u, f), this } function CConfigPanel() { var s = null, a = null, g, nt, tt, it, rt, ut, ft, h, c, n, v, y, p, w, b, k, l, d, t, i, r, u, f, e, o; this._init = function() { var et, ht, n, ot, st; s_oGame.pauseTimer(!0); et = 750; ht = this; h = createBitmap(s_oSpriteLibrary.getSprite("msg_box")); t = new createjs.Container; t.x = 130; t.y = 450; s_oStage.addChild(t); g = new CTLText(t, 0, -50, 600, 50, 50, "left", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_GETHINT, !0, !0, !1, !1); n = s_oSpriteLibrary.getSprite("but_help_hint"); k = new CGfxButton(et, 0, n, t); k.addEventListener(ON_MOUSE_UP, this._onHintPress, this); i = new createjs.Container; i.x = 130; i.y = 620; s_oStage.addChild(i); nt = new CTLText(i, 0, -50, 600, 50, 50, "left", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_FILL_WITH_NOTE, !0, !0, !1, !1); n = s_oSpriteLibrary.getSprite("but_help_note"); v = new CGfxButton(et, 0, n, i); v.addEventListener(ON_MOUSE_UP, this._onHelpPress, this); r = new createjs.Container; r.x = 130; r.y = 790; s_oStage.addChild(r); tt = new CTLText(r, 0, -50, 600, 50, 50, "left", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_SOLVE, !0, !0, !1, !1); n = s_oSpriteLibrary.getSprite("but_solve"); p = new CGfxButton(et, 0, n, r); p.addEventListener(ON_MOUSE_UP, this._onSolvePress, this); u = new createjs.Container; u.x = 130; u.y = 1210; s_oStage.addChild(u); it = new CTLText(u, 0, -50, 600, 50, 50, "left", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_RESET, !0, !0, !1, !1); n = s_oSpriteLibrary.getSprite("but_reset"); w = new CGfxButton(et, 0, n, u); w.addEventListener(ON_MOUSE_UP, this._onResetPress, this); f = new createjs.Container; f.x = 130; f.y = 1390; s_oStage.addChild(f); rt = new CTLText(f, 0, -50, 600, 50, 50, "left", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_DELETE_ALL_NOTE, !0, !0, !1, !1); n = s_oSpriteLibrary.getSprite("but_del_note"); y = new CGfxButton(et, 0, n, f); y.addEventListener(ON_MOUSE_UP, this._onDelPress, this); e = new createjs.Container; e.x = 130; e.y = 1570; s_oStage.addChild(e); ut = new CTLText(e, 0, -50, 600, 50, 50, "left", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_SETNOTIME, !0, !0, !1, !1); n = s_oSpriteLibrary.getSprite("but_time"); b = new CGfxButton(et, 0, n, e); b.addEventListener(ON_MOUSE_UP, this._onTimePress, this); ot = window.document; st = ot.documentElement; s = st.requestFullscreen || st.mozRequestFullScreen || st.webkitRequestFullScreen || st.msRequestFullscreen; a = ot.exitFullscreen || ot.mozCancelFullScreen || ot.webkitExitFullscreen || ot.msExitFullscreen; ENABLE_FULLSCREEN === !1 && (s = !1); o = new createjs.Container; o.x = 130; o.y = 1030; s_oStage.addChild(o); s && screenfull.isEnabled && (ft = new CTLText(o, 0, -50, 600, 50, 50, "left", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_FULLSCREEN, !0, !0, !1, !1), n = s_oSpriteLibrary.getSprite("but_fullscreen"), l = new CToggle(et, 0, n, s_bFullscreen, o), l.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); c = new createjs.Container; c.addChild(h, t, i, r, u, f, e, o); s_oStage.addChild(c); d = h.on("pressup", function() { ht._onExitHelp() }) }; this.unload = function() { $(s_oMain).trigger("show_interlevel_ad"); s_oStage.removeChild(c); var n = this; h.off("pressup", d); s_oInterface.onExitFromConfig() }; this._onHelpPress = function() { s_oGame.fillWithNote(); n._onExitHelp() }; this._onDelPress = function() { s_oGame.deleteAllNote(); n._onExitHelp() }; this._onSolvePress = function() { s_oGame.solveAndWrite(); n.unload() }; this._onResetPress = function() { $(s_oMain).trigger("restart_level", 1); s_oGame.resetGame(); n._onExitHelp() }; this._onTimePress = function() { s_oGame.setNoTime(); n._onExitHelp() }; this._onHintPress = function() { s_oGame.getHint(); n._onExitHelp() }; this.resetFullscreenBut = function() { s && screenfull.isEnabled && l.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? a.call(window.document) : s.call(window.document.documentElement); sizeHandler() }; this._onExitHelp = function() { n.unload(); s_oGame.pauseTimer(!1) }; n = this; this._init() } function CGrid() { var s, h, c, o, u, i, t, r, n, f, e; this._init = function() { var nt, tt, it, y, rt, p, ut, l; s = !1; h = !1; c = !1; o = 0; n = { row: 0, col: 0 }; r = new createjs.Container; r.x = CANVAS_WIDTH / 2; r.y = 880; s_oStage.addChild(r); var k = CELL_SIZE, d = 4, a = 10, b = CELL_SIZE * 9 + d * 6 + a * 2, v = b * .5, w = k, g = []; for (g.push(k * .5), f = [], l = 0; l < 8; l++) l % 3 == 2 ? (y = (new createjs.Graphics).beginFill("rgba(0,0,0,1)").drawRect(-v, -v + w, b, a), w += k + a) : (y = (new createjs.Graphics).beginFill("rgba(0,0,0,1)").drawRect(-v, -v + w, b, d), w += k + d), g.push(w - k * .5), f[l] = new createjs.Shape(y), r.addChild(f[l]); for (w = k, e = [], l = 0; l < 8; l++) l % 3 == 2 ? (y = (new createjs.Graphics).beginFill("rgba(0,0,0,1)").drawRect(-v + w, -v, a, b), w += k + a) : (y = (new createjs.Graphics).beginFill("rgba(0,0,0,1)").drawRect(-v + w, -v, d, b), w += k + d), e[l] = new createjs.Shape(y), r.addChild(e[l]); for (y = (new createjs.Graphics).beginFill("rgba(0,0,0,1)").drawRect(-v - a, -v - a, a, b + 2 * a), nt = new createjs.Shape(y), r.addChild(nt), y = (new createjs.Graphics).beginFill("rgba(0,0,0,1)").drawRect(v, -v - a, a, b + 2 * a), tt = new createjs.Shape(y), r.addChild(tt), y = (new createjs.Graphics).beginFill("rgba(0,0,0,1)").drawRect(-v - a, -v - a, b + 2 * a, a), it = new createjs.Shape(y), r.addChild(it), y = (new createjs.Graphics).beginFill("rgba(0,0,0,1)").drawRect(-v - a, +v, b + 2 * a, a), rt = new createjs.Shape(y), r.addChild(rt), u = [], l = 0; l < 9; l++) for (u[l] = [], p = 0; p < 9; p++) u[l][p] = { x: g[p], y: g[l] }; for (i = [], l = 0; l < 9; l++) for (i[l] = [], p = 0; p < 9; p++) ut = { row: l, col: p }, i[l][p] = new CCell(u[l][p].x - v, u[l][p].y - v, ut, r); for (t = [], l = 0; l < 10; l++) t[l] = [] }; this.setCurNum = function(n) { o = n }; this.setActiveCell = function(t) { this.turnOffAllCells(); n = { row: t.row, col: t.col }; this.highlightCells(); i[n.row][n.col].getNumber() !== 0 && this.showSameNumbers(i[n.row][n.col].getNumber()) }; this.showCorner = function() { i[n.row][n.col].setCorner(!0) }; this.turnOffAllCells = function() { for (var r, t = 0; t < 9; t++) for (r = 0; r < 9; r++) i[t][r].highlight("off"); i[n.row][n.col].setCorner(!1) }; this.showSameNumbers = function(n) { var r, u; if (n !== 0) { for (r = 0; r < t[n].length; r++) i[t[n][r].row][t[n][r].col].highlight("green"); for (r = 0; r < 9; r++) for (u = 0; u < 9; u++) i[r][u].getNote(n) !== 0 && i[r][u].highlight("green") } }; this.highlightCells = function() { var t, f, e, r, u; for (this.showCorner(), t = 0; t < 9; t++) i[n.row][t].highlight("yellow"); for (t = 0; t < 9; t++) i[t][n.col].highlight("yellow"); for (f = Math.floor(n.row / 3) * 3, e = Math.floor(n.col / 3) * 3, r = 0; r < 3; r++) for (u = 0; u < 3; u++) i[f + r][e + u].highlight("yellow") }; this.deleteCell = function() { i[n.row][n.col].getGiven() || (i[n.row][n.col].getNumber() !== 0 && s_oGame.checkEndGame("remove"), this.deleteSmartFromList(i[n.row][n.col].getNumber()), i[n.row][n.col].clearCell(), this.turnOffAllCells(), this.highlightCells()) }; this.writeNum = function(t) { if (!i[n.row][n.col].getGiven() && t !== 0 && t !== i[n.row][n.col].getNumber()) return (this.turnOffAllCells(), this.highlightCells(), this.checkCollision(t, n.row, n.col, !0)) ? void 0 : (i[n.row][n.col].getNumber() !== 0 && this.deleteCell(), i[n.row][n.col].setNumber(t), this.insertSmartInList(t), this.updateNote(t), this.showSameNumbers(t), s_oGame.checkEndGame("add"), !0) }; this.resumeNum = function(n, r, u) { i[r][u].setNumber(n); t[n].push({ row: r, col: u }); this.updateNote(n); s_oGame.checkEndGame("add") }; this.resumeNotes = function(n, t, r) { for (var f, u = 0; u < n.length; u++) f = n[u], i[t][r].setNote(f) }; this.deleteAllNote = function() { for (var r = 0; r < t[0].length; r++) i[t[0][r].row][t[0][r].col].clearAllNote(); this.turnOffAllCells(); this.highlightCells(); this.showSameNumbers(i[n.row][n.col].getNumber()) }; this.writeNote = function(t) { i[n.row][n.col].getGiven() || (this.turnOffAllCells(), this.highlightCells(), i[n.row][n.col].setNote(t), this.showSameNumbers(i[n.row][n.col].getNumber())) }; this.writeHelpNote = function(n, t, r) { i[t][r].setHelpNote(n) }; this.getAllNotes = function() { for (var t, r = [], n = 0; n < i.length; n++) for (r[n] = [], t = 0; t < i[n].length; t++) r[n][t] = i[n][t].getAllNotesWritten(); return r }; this.setGiven = function(n, r, u) { i[n][r].setGiven(u); t[u].push({ row: n, col: r }) }; this.isGiven = function(n, t) { return i[n][t].getGiven() }; this.setSolvedNumber = function(n, r, u) { i[n][r].setHintNumber(u); t[u].push({ row: n, col: r }); for (var f = 0; f < t[0].length; f++) t[0][f].row === n && t[0][f].col === r && t[0].splice(f, 1) }; this.setHintNumber = function(n, r, u) { i[n][r].setHintNumber(u); t[u].push({ row: n, col: r }); for (var f = 0; f < t[0].length; f++) t[0][f].row === n && t[0][f].col === r && t[0].splice(f, 1) }; this.deleteResetNumber = function(n, r) { var f = i[n][r].getNumber(), u; if (f !== 0) { for (u = 0; u < t[f].length; u++) t[f][u].row === n && t[f][u].col === r && t[f].splice(u, 1); i[n][r].clearCell() } t[0].push({ row: n, col: r }) }; this.updateNote = function(t) { for (var f, e, u, r = 0; r < 9; r++) i[n.row][r].getNote(t) !== 0 && i[n.row][r].clearNote(t), i[r][n.col].getNote(t) !== 0 && i[r][n.col].clearNote(t); for (f = Math.floor(n.row / 3) * 3, e = Math.floor(n.col / 3) * 3, r = 0; r < 3; r++) for (u = 0; u < 3; u++) i[f + r][e + u].getNote(t) !== 0 && i[f + r][e + u].clearNote(t) }; this.checkCollision = function(n, r, u, f) { for (var o = Math.floor(r / 3) * 3, s = Math.floor(u / 3) * 3, e = 0; e < t[n].length; e++) if (t[n][e].row === r || t[n][e].col === u || o <= t[n][e].row && t[n][e].row < o + 3 && s <= t[n][e].col && t[n][e].col < s + 3) return f && i[t[n][e].row][t[n][e].col].highlight("red"), !0 }; this.deleteSmartFromList = function(i) { if (i !== 0) { for (var r = 0; r < t[i].length; r++) t[i][r].row === n.row && t[i][r].col === n.col && t[i].splice(r, 1); t[0].push({ row: n.row, col: n.col }) } }; this.insertSmartInList = function(i) { if (i !== 0) { t[i].push({ row: n.row, col: n.col }); for (var r = 0; r < t[0].length; r++) t[0][r].row === n.row && t[0][r].col === n.col && t[0].splice(r, 1) } }; this.removeList = function(n) { t[n] = {} }; this.getList = function(n) { return t[n] }; this.viewList = function(n) { trace(t[n]); trace(t[n].length) }; this.getCurActiveCell = function() { return { row: n.row, col: n.col, num: i[n.row][n.col].getNumber() } }; this.getCurGrid = function() { for (var t, r = [], n = 0; n < 9; n++) for (r[n] = [], t = 0; t < 9; t++) r[n][t] = i[n][t].getNumber(); return r }; this._init() } function CCell(n, t, i, r) { var l, c, e, u, v, y, s, a, h, o, f; this._init = function(n, t, i, r) { var p, v, o, k; l = !1; p = CELL_SIZE; c = 0; u = []; f = new createjs.Container; f.x = n; f.y = t; r.addChild(f); y = { row: i.row, col: i.col }; var o = s_oSpriteLibrary.getSprite("background"), w = { images: [o], frames: { width: o.width / 2, height: o.height, regX: o.width / 4, regY: o.height / 2 }, animations: { white: [0], grey: [1] } }, b = new createjs.SpriteSheet(w); a = createSprite(b, "white", o.width / 4, o.height / 2, o.width / 2, o.height); f.addChild(a); var o = s_oSpriteLibrary.getSprite("highlight"), w = { images: [o], frames: { width: o.width / 3, height: o.height, regX: o.width / 6, regY: o.height / 2 }, animations: { yellow: [0], green: [1], red: [2] } }, b = new createjs.SpriteSheet(w); s = createSprite(b, "yellow", o.width / 6, o.height / 2, o.width / 2, o.height); s.alpha = .9; s.visible = !1; f.addChild(s); e = []; v = p / 3; e[1] = { x: -v, y: -v }; e[2] = { x: 0, y: -v }; e[3] = { x: v, y: -v }; e[4] = { x: -v, y: 0 }; e[5] = { x: 0, y: 0 }; e[6] = { x: v, y: 0 }; e[7] = { x: -v, y: v }; e[8] = { x: 0, y: v }; e[9] = { x: +v, y: v }; this.clearAllNote(); o = s_oSpriteLibrary.getSprite("cell_selected"); h = createBitmap(o); h.regX = o.width / 2; h.regY = o.height / 2; h.visible = !1; f.addChild(h); k = (new createjs.Graphics).beginFill("rgba(158,158,158,0.01)").drawRect(-p / 2, -p / 2, p, p); f.on("click", this._setActive) }; this.unload = function() { r.removeChild(f) }; this.setGiven = function(n) { n !== 0 && (a.gotoAndStop("grey"), l = !0); this.setNumber(n) }; this.getGiven = function() { return l }; this.setHintNumber = function(n) { n !== 0 && (this.clearNumber(), this.clearAllNote(), o = new createjs.Text(n, "bold 80px " + PRIMARY_FONT, "#add8fd"), o.textAlign = "center", o.textBaseline = "middle", f.addChild(o), c = n) }; this.setNumber = function(n) { n !== 0 && (this.clearNumber(), this.clearAllNote(), o = new createjs.Text(n, "bold 80px " + PRIMARY_FONT, "#000000"), o.textAlign = "center", o.textBaseline = "middle", f.addChild(o), c = n) }; this.getNumber = function() { return c }; this.clearNumber = function() { c = 0; f.removeChild(o) }; this.setNote = function(n) { c === 0 && (u[n] !== 0 ? this.clearNote(n) : (u[n] = new createjs.Text(n, " 30px " + PRIMARY_FONT, "#000000"), u[n].textAlign = "center", u[n].textBaseline = "middle", u[n].x = e[n].x, u[n].y = e[n].y, f.addChild(u[n]))) }; this.setHelpNote = function(n) { this.clearNote(n); u[n] = new createjs.Text(n, " 30px " + PRIMARY_FONT, "#000000"); u[n].textAlign = "center"; u[n].textBaseline = "middle"; u[n].x = e[n].x; u[n].y = e[n].y; f.addChild(u[n]) }; this.getNote = function(n) { return u[n] }; this.getAllNotesWritten = function() { for (var t = [], n = 1; n <= 9; n++) u[n] !== 0 && t.push(n); return t }; this.clearNote = function(n) { f.removeChild(u[n]); u[n] = 0 }; this.clearAllNote = function() { for (var n = 1; n < 10; n++) f.removeChild(u[n]), u[n] = 0 }; this.clearCell = function() { this.clearNumber(); this.clearAllNote() }; this.highlight = function(n) { s.visible = !0; n !== "off" ? s.gotoAndStop(n) : s.visible = !1 }; this.setCorner = function(n) { h.visible = n ? !0 : !1 }; this._setActive = function() { v.highlight("yellow"); s_oGame.activeCell(y) }; v = this; this._init(n, t, i, r) } function CNumButton(n, t, i) { var e, s, c, o, f, r, u, h, l, a, v; this._init = function(n, t, i) { var u, c, l; e = !1; s = i; r = new createjs.Container; r.x = n; r.y = t; s_oStage.addChild(r); u = s_oSpriteLibrary.getSprite("but_num"); o = createBitmap(u); c = u.width; l = u.height; o.regX = c / 2; o.regY = l / 2; f = new createjs.Text(i, "Bold 90px " + PRIMARY_FONT, "#000000"); f.textAlign = "center"; f.textBaseline = "middle"; r.addChild(o, f); h = { x: c / 3 - 2, y: -l / 3 + 5 }; this.setCounter(0); this._initListener() }; this.unload = function() { r.off("mousedown", l); r.off("pressup", a); s_bMobile || r.off("mouseover", v); s_oStage.removeChild(r) }; this._initListener = function() { l = r.on("mousedown", this.buttonDown); a = r.on("pressup", this.buttonRelease); s_bMobile || (v = r.on("mouseover", this.buttonOver)) }; this.buttonRelease = function() { r.scaleX = 1; r.scaleY = 1; s_oGame.tryShowAd(); e ? (s_oGame.setCurNum(s), s_oInterface.setAllBlackColor(), c.changeNumColor(!0)) : s_oGame.writeNum(s) }; this.buttonDown = function() { r.scaleX = .9; r.scaleY = .9 }; this.buttonOver = function(n) { s_bMobile || (n.target.cursor = "pointer") }; this.changeNumColor = function(n) { f.color = n ? "#ff8814" : "#000000" }; this.changeMode = function() { e = !e }; this.setCounter = function(n) { u = new createjs.Text(n, " 30px " + PRIMARY_FONT, "#000000"); u.textAlign = "center"; u.textBaseline = "middle"; u.x = h.x; u.y = h.y; r.addChild(u) }; this.clearCounter = function() { r.removeChild(u) }; c = this; this._init(n, t, i) } function CCreditsPanel() { var f, n, r, i, t, u, e; this._init = function() { var l, o, h, s, c, f; t = new createjs.Shape; t.graphics.beginFill("#0f0f0f").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); t.alpha = .01; u = t.on("click", this._onLogoButRelease); s_oStage.addChild(t); n = new createjs.Container; s_oStage.addChild(n); f = s_oSpriteLibrary.getSprite("credit_bg"); l = createBitmap(f); l.regX = f.width / 2; l.regY = f.height / 2; n.addChild(l); n.x = CANVAS_WIDTH / 2; n.y = CANVAS_HEIGHT / 2; e = { x: n.x, y: n.y }; o = new createjs.Text(TEXT_DEVELOPED, " 80px " + SECONDARY_FONT, "#000000"); o.y = -120; o.textAlign = "center"; o.textBaseline = "middle"; o.lineWidth = 600; o.outline = 5; h = new createjs.Text(TEXT_DEVELOPED, " 80px " + SECONDARY_FONT, PRIMARY_FONT_COLOUR); h.y = o.y; h.textAlign = "center"; h.textBaseline = "middle"; h.lineWidth = 600; n.addChild(h); s = new createjs.Text("www.codethislab.com", " 80px " + SECONDARY_FONT, PRIMARY_FONT_COLOUR); s.y = 230; s.textAlign = "center"; s.textBaseline = "middle"; s.lineWidth = 600; s.outline = 5; c = new createjs.Text("www.codethislab.com", " 80px " + SECONDARY_FONT, PRIMARY_FONT_COLOUR); c.y = s.y; c.textAlign = "center"; c.textBaseline = "middle"; c.lineWidth = 600; n.addChild(c); f = s_oSpriteLibrary.getSprite("ctl_logo"); i = createBitmap(f); i.regX = f.width / 2; i.regY = f.height / 2; n.addChild(i); f = s_oSpriteLibrary.getSprite("but_exit"); r = new CGfxButton(400, -204, f, n); r.addEventListener(ON_MOUSE_UP, this.unload, this) }; this.unload = function() { s_oStage.removeChild(f); s_oStage.removeChild(n); r.unload(); t.off("click", u) }; this._onLogoButRelease = function() { window.open("https://www.codethislab.com/", "_blank") }; this._init() } function CAreYouSurePanel(n, t) { var e, u, r, i, f, o; this._init = function() { i = new createjs.Container; o = i.on("mousedown", function() {}); s_oStage.addChild(i); var n = s_oSpriteLibrary.getSprite("credit_bg"), t = createBitmap(n); t.regX = n.width / 2; t.regY = n.height / 2; i.addChild(t); i.x = CANVAS_WIDTH / 2; i.y = CANVAS_HEIGHT / 2; e = new CTLText(i, -400, -180, 800, 240, 120, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, TEXT_ARE_SURE, !0, !0, !0, !1); u = new CGfxButton(150, 150, s_oSpriteLibrary.getSprite("but_yes"), i); u.addEventListener(ON_MOUSE_UP, this._onButYes, this); r = new CGfxButton(-150, 150, s_oSpriteLibrary.getSprite("but_exit"), i); r.addEventListener(ON_MOUSE_UP, this._onButNo, this); r.pulseAnimation() }; this.unload = function() { r.unload(); u.unload(); i.off("mousedown", o); s_oStage.removeChild(i) }; this._onButYes = function() { f.unload(); n && n() }; this._onButNo = function() { f.unload(); t && t() }; this.setMsg = function(n) { e.refreshText(n) }; f = this; this._init(n, t) } function CTLText(n, t, i, r, u, f, e, o, s, h, c, l, a, v, y, p, w) { this._oContainer = n; this._x = t; this._y = i; this._iWidth = r; this._iHeight = u; this._bMultiline = p; this._iFontSize = f; this._szAlign = e; this._szColor = o; this._szFont = s; this._iPaddingH = c; this._iPaddingV = l; this._bVerticalAlign = y; this._bFitText = v; this._bDebug = w; this._oDebugShape = null; this._fLineHeightFactor = h; this._oText = null; a && this.__createText(a) } function CLocalStorage(n) { var t = !0; this._init = function(n) { try { var t = window.localStorage.getItem(n); this.resetData(); t !== null && t !== undefined && this.loadData() } catch (i) { this.resetData() } }; this.isUsed = function() { return s_aSolution !== null ? !0 : !1 }; this.isAvailable = function() { try { window.localStorage.setItem("ls_available", "ok") } catch (n) { t = !1 } return t }; this.resetData = function() { s_aSolution = null; s_aGridMask = null; s_aGridState = null; s_aNotesWritten = null; s_oGameParam = null }; this.deleteData = function() { window.localStorage.removeItem(n); this.resetData() }; this.saveData = function() { var t = {}; t[LOCALSTORAGE_SOLUTION] = s_aSolution; t[LOCALSTORAGE_MASK] = s_aGridMask; t[LOCALSTORAGE_GRID_STATE] = s_aGridState; t[LOCALSTORAGE_NOTES_WRITTEN] = s_aNotesWritten; t[LOCALSTORAGE_GAME_PARAM] = s_oGameParam; window.localStorage.setItem(n, JSON.stringify(t)) }; this.loadData = function() { var i = JSON.parse(window.localStorage.getItem(n)), t = i[LOCALSTORAGE_SOLUTION]; s_aSolution = t; t = i[LOCALSTORAGE_MASK]; s_aGridMask = t; t = i[LOCALSTORAGE_GRID_STATE]; s_aGridState = t; t = i[LOCALSTORAGE_NOTES_WRITTEN]; s_aNotesWritten = t; t = i[LOCALSTORAGE_GAME_PARAM]; s_oGameParam = t; console.log(i) }; this._init(n) } function CMsgBox(n, t) { var f, u, r, i, e, o; this._init = function(n) { r = new createjs.Shape; r.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); r.alpha = .01; r.on("mousedown", function() {}); s_oStage.addChild(r); i = new createjs.Container; s_oStage.addChild(i); var t = s_oSpriteLibrary.getSprite("credit_bg"), e = createBitmap(t); e.regX = t.width / 2; e.regY = t.height / 2; i.addChild(e); i.x = CANVAS_WIDTH / 2; i.y = CANVAS_HEIGHT / 2; o = { x: i.x, y: i.y }; f = new CTLText(i, -450, -190, 900, 270, 46, "center", PRIMARY_FONT_COLOUR, SECONDARY_FONT, 1, 0, 0, n, !0, !0, !0, !1); u = new CGfxButton(380, 190, s_oSpriteLibrary.getSprite("but_yes"), i); u.addEventListener(ON_MOUSE_UP, this._onButYes, this); u.pulseAnimation() }; this._onButYes = function() { e.unload() }; this.changeMessage = function(n) { f.refreshText(n) }; this.unload = function() { u.unload(); s_oStage.removeChild(r); s_oStage.removeChild(i); r.off("mousedown", function() {}) }; e = this; this._init(n, t) } function extractHostname(n) { var t; return t = n.indexOf("://") > -1 ? n.split("/")[2] : n.split("/")[0], t = t.split(":")[0], t.split("?")[0] } function extractRootDomain(n) { var t = extractHostname(n), i = t.split("."), r = i.length; return r > 2 && (t = i[r - 2] + "." + i[r - 1]), t } function seekAndDestroy() { for (var i = extractRootDomain(PAGE_URL), t = [String.fromCharCode(99, 111, 100, 101, 116, 104, 105, 115, 108, 97, 98, 46, 99, 111, 109), String.fromCharCode(101, 110, 118, 97, 116, 111, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 110, 101, 116)], n = 0; n < t.length; n++) if (t[n] === i) return !0; return !1 } var s_oMenu, s_oModeMenu, s_oGame, s_oInterface, s_oSudokuLoader; (function() { "use strict"; var t = typeof window != "undefined" && typeof window.document != "undefined" ? window.document : {}, r = typeof module != "undefined" && module.exports, n = function() { for (var i, r = [ ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror"], ["webkitRequestFullScreen", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitCancelFullScreen", "webkitfullscreenchange", "webkitfullscreenerror"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror"], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"] ], n = 0, f = r.length, u = {}; n < f; n++) if (i = r[n], i && i[1] in t) { for (n = 0; n < i.length; n++) u[r[0][n]] = i[n]; return u } return !1 }(), u = { change: n.fullscreenchange, error: n.fullscreenerror }, i = { request: function(i) { return new Promise(function(r, u) { var f = function() { this.off("change", f); r() }.bind(this); this.on("change", f); i = i || t.documentElement; Promise.resolve(i[n.requestFullscreen]()).catch(u) }.bind(this)) }, exit: function() { return new Promise(function(i, r) { if (!this.isFullscreen) { i(); return } var u = function() { this.off("change", u); i() }.bind(this); this.on("change", u); Promise.resolve(t[n.exitFullscreen]()).catch(r) }.bind(this)) }, toggle: function(n) { return this.isFullscreen ? this.exit() : this.request(n) }, onchange: function(n) { this.on("change", n) }, onerror: function(n) { this.on("error", n) }, on: function(n, i) { var r = u[n]; r && t.addEventListener(r, i, !1) }, off: function(n, i) { var r = u[n]; r && t.removeEventListener(r, i, !1) }, raw: n }; if (!n) { r ? module.exports = { isEnabled: !1 } : window.screenfull = { isEnabled: !1 }; return } Object.defineProperties(i, { isFullscreen: { get: function() { return Boolean(t[n.fullscreenElement]) } }, element: { enumerable: !0, get: function() { return t[n.fullscreenElement] } }, isEnabled: { enumerable: !0, get: function() { return Boolean(t[n.fullscreenEnabled]) } } }); r ? module.exports = i : window.screenfull = i })(); /*! * Platform.js <https://mths.be/platform> * Copyright 2014-2018 Benjamin Tan <https://bnjmnt4n.now.sh/> * Copyright 2011-2013 John-David Dalton * Available under MIT license <https://mths.be/mit> */ (function() { "use strict"; function p(n) { return n = String(n), n.charAt(0).toUpperCase() + n.slice(1) } function nt(n, t, i) { var r = { "10.0": "10", "6.4": "10 Technical Preview", "6.3": "8.1", "6.2": "8", "6.1": "Server 2008 R2 / 7", "6.0": "Server 2008 / Vista", "5.2": "Server 2003 / XP 64-bit", "5.1": "XP", "5.01": "2000 SP1", "5.0": "2000", "4.0": "NT", "4.90": "ME" }; return t && i && /^Win/i.test(n) && !/^Windows Phone /i.test(n) && (r = r[/[\d.]+$/.exec(n)]) && (n = "Windows " + r), n = String(n), t && i && (n = n.replace(RegExp(t, "i"), i)), o(n.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0]) } function tt(n, t) { var r = -1, i = n ? n.length : 0; if (typeof i == "number" && i > -1 && i <= k) while (++r < i) t(n[r], r, n); else s(n, t) } function o(n) { return n = w(n), /^(?:webOS|i(?:OS|P))/.test(n) ? n : p(n) } function s(n, t) { for (var i in n) g.call(n, i) && t(n[i], i, n) } function t(n) { return n == null ? p(n) : y.call(n).slice(8, -1) } function it(n, t) { var i = n != null ? typeof n[t] : "number"; return !/^(?:boolean|number|string|undefined)$/.test(i) && (i == "object" ? !!n[t] : !0) } function i(n) { return String(n).replace(/([ -])(?!$)/g, "$1?") } function r(n, t) { var i = null; return tt(n, function(r, u) { i = t(i, r, u, n) }), i } function w(n) { return String(n).replace(/^ +| +$/g, "") } function h(n) { function ui(t) { return r(t, function(t, r) { return t || RegExp("\\b" + (r.pattern || i(r)) + "\\b", "i").exec(n) && (r.label || r) }) } function fi(t) { return r(t, function(t, r, u) { return t || (r[p] || r[/^[a-z]+(?: +[a-z]+\b)*/i.exec(p)] || RegExp("\\b" + i(u) + "(?:\\b|\\w*\\d)", "i").exec(n)) && u }) } function ei(t) { return r(t, function(t, r) { return t || RegExp("\\b" + (r.pattern || i(r)) + "\\b", "i").exec(n) && (r.label || r) }) } function oi(t) { return r(t, function(t, r) { var u = r.pattern || i(r); return !t && (t = RegExp("\\b" + u + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(n)) && (t = nt(t, u, r.label || r)), t }) } function wt(t) { return r(t, function(t, r) { var u = r.pattern || i(r); return !t && (t = RegExp("\\b" + u + " *\\d+[.\\w_]*", "i").exec(n) || RegExp("\\b" + u + " *\\w+-[\\w]*", "i").exec(n) || RegExp("\\b" + u + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(n)) && ((t = String(r.label && !RegExp(u, "i").test(r.label) ? r.label : t).split("/"))[1] && !/[\d.]+/.test(t[0]) && (t[0] += " " + t[1]), r = r.label || r, t = o(t[0].replace(RegExp(u, "i"), r).replace(RegExp("; *(?:" + r + "[_-])?", "i"), " ").replace(RegExp("(" + r + ")[-_.]?(\\w)", "i"), "$1 $2"))), t }) } function si(t) { return r(t, function(t, i) { return t || (RegExp(i + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(n) || 0)[1] || null }) } function hi() { return this.description || "" } var g = u, ut = n && typeof n == "object" && t(n) != "String", ot, at, tt; ut && (g = n, n = null); ot = g.navigator || {}; at = ot.userAgent || ""; n || (n = at); var ci = ut || d == b, bt = ut ? !!ot.likeChrome : /\bChrome\b/.test(n) && !/internal|\n/i.test(y.toString()), vt = "Object", kt = ut ? vt : "ScriptBridgingProxyObject", dt = ut ? vt : "Environment", gt = ut && g.java ? "JavaPackage" : t(g.java), ni = ut ? vt : "RuntimeObject", st = /\bJava/.test(gt) && g.java, ti = st && t(g.environment) == dt, ii = st ? "a" : "α", ri = st ? "b" : "β", yt = g.document || {}, ft = g.operamini || g.opera, ht = e.test(ht = ut && ft ? ft["[[Class]]"] : t(ft)) ? ht : ft = null, f, ct = n, v = [], lt = null, et = n == at, a = et && ft && typeof ft.version == "function" && ft.version(), pt, k = ui([{ label: "EdgeHTML", pattern: "Edge" }, "Trident", { label: "WebKit", pattern: "AppleWebKit" }, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko"]), c = ei(["Adobe AIR", "Arora", "Avant Browser", "Breach", "Camino", "Electron", "Epiphany", "Fennec", "Flock", "Galeon", "GreenBrowser", "iCab", "Iceweasel", "K-Meleon", "Konqueror", "Lunascape", "Maxthon", { label: "Microsoft Edge", pattern: "Edge" }, "Midori", "Nook Browser", "PaleMoon", "PhantomJS", "Raven", "Rekonq", "RockMelt", { label: "Samsung Internet", pattern: "SamsungBrowser" }, "SeaMonkey", { label: "Silk", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Sleipnir", "SlimBrowser", { label: "SRWare Iron", pattern: "Iron" }, "Sunrise", "Swiftfox", "Waterfox", "WebPositive", "Opera Mini", { label: "Opera Mini", pattern: "OPiOS" }, "Opera", { label: "Opera", pattern: "OPR" }, "Chrome", { label: "Chrome Mobile", pattern: "(?:CriOS|CrMo)" }, { label: "Firefox", pattern: "(?:Firefox|Minefield)" }, { label: "Firefox for iOS", pattern: "FxiOS" }, { label: "IE", pattern: "IEMobile" }, { label: "IE", pattern: "MSIE" }, "Safari"]), p = wt([{ label: "BlackBerry", pattern: "BB10" }, "BlackBerry", { label: "Galaxy S", pattern: "GT-I9000" }, { label: "Galaxy S2", pattern: "GT-I9100" }, { label: "Galaxy S3", pattern: "GT-I9300" }, { label: "Galaxy S4", pattern: "GT-I9500" }, { label: "Galaxy S5", pattern: "SM-G900" }, { label: "Galaxy S6", pattern: "SM-G920" }, { label: "Galaxy S6 Edge", pattern: "SM-G925" }, { label: "Galaxy S7", pattern: "SM-G930" }, { label: "Galaxy S7 Edge", pattern: "SM-G935" }, "Google TV", "Lumia", "iPad", "iPod", "iPhone", "Kindle", { label: "Kindle Fire", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Nexus", "Nook", "PlayBook", "PlayStation Vita", "PlayStation", "TouchPad", "Transformer", { label: "Wii U", pattern: "WiiU" }, "Wii", "Xbox One", { label: "Xbox 360", pattern: "Xbox" }, "Xoom"]), rt = fi({ Apple: { iPad: 1, iPhone: 1, iPod: 1 }, Archos: {}, Amazon: { Kindle: 1, "Kindle Fire": 1 }, Asus: { Transformer: 1 }, "Barnes & Noble": { Nook: 1 }, BlackBerry: { PlayBook: 1 }, Google: { "Google TV": 1, Nexus: 1 }, HP: { TouchPad: 1 }, HTC: {}, LG: {}, Microsoft: { Xbox: 1, "Xbox One": 1 }, Motorola: { Xoom: 1 }, Nintendo: { "Wii U": 1, Wii: 1 }, Nokia: { Lumia: 1 }, Samsung: { "Galaxy S": 1, "Galaxy S2": 1, "Galaxy S3": 1, "Galaxy S4": 1 }, Sony: { PlayStation: 1, "PlayStation Vita": 1 } }), l = oi(["Windows Phone", "Android", "CentOS", { label: "Chrome OS", pattern: "CrOS" }, "Debian", "Fedora", "FreeBSD", "Gentoo", "Haiku", "Kubuntu", "Linux Mint", "OpenBSD", "Red Hat", "SuSE", "Ubuntu", "Xubuntu", "Cygwin", "Symbian OS", "hpwOS", "webOS ", "webOS", "Tablet OS", "Tizen", "Linux", "Mac OS X", "Macintosh", "Mac", "Windows 98;", "Windows "]); if (k && (k = [k]), rt && !p && (p = wt([rt])), (f = /\bGoogle TV\b/.exec(p)) && (p = f[0]), /\bSimulator\b/i.test(n) && (p = (p ? p + " " : "") + "Simulator"), c == "Opera Mini" && /\bOPiOS\b/.test(n) && v.push("running in Turbo/Uncompressed mode"), c == "IE" && /\blike iPhone OS\b/.test(n) ? (f = h(n.replace(/like iPhone OS/, "")), rt = f.manufacturer, p = f.product) : /^iP/.test(p) ? (c || (c = "Safari"), l = "iOS" + ((f = / OS ([\d_]+)/i.exec(n)) ? " " + f[1].replace(/_/g, ".") : "")) : c != "Konqueror" || /buntu/i.test(l) ? rt && rt != "Google" && (/Chrome/.test(c) && !/\bMobile Safari\b/i.test(n) || /\bVita\b/.test(p)) || /\bAndroid\b/.test(l) && /^Chrome/.test(c) && /\bVersion\//i.test(n) ? (c = "Android Browser", l = /\bAndroid\b/.test(l) ? l : "Android") : c == "Silk" ? (/\bMobi/i.test(n) || (l = "Android", v.unshift("desktop mode")), /Accelerated *= *true/i.test(n) && v.unshift("accelerated")) : c == "PaleMoon" && (f = /\bFirefox\/([\d.]+)\b/.exec(n)) ? v.push("identifying as Firefox " + f[1]) : c == "Firefox" && (f = /\b(Mobile|Tablet|TV)\b/i.exec(n)) ? (l || (l = "Firefox OS"), p || (p = f[1])) : !c || (f = !/\bMinefield\b/i.test(n) && /\b(?:Firefox|Safari)\b/.exec(c)) ? (c && !p && /[\/,]|^[^(]+?\)/.test(n.slice(n.indexOf(f + "/") + 8)) && (c = null), (f = p || rt || l) && (p || rt || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(l)) && (c = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(l) ? l : f) + " Browser")) : c == "Electron" && (f = (/\bChrome\/([\d.]+)\b/.exec(n) || 0)[1]) && v.push("Chromium " + f) : l = "Kubuntu", a || (a = si(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$))", "Version", i(c), "(?:Firefox|Minefield|NetFront)"])), (f = k == "iCab" && parseFloat(a) > 3 && "WebKit" || /\bOpera\b/.test(c) && (/\bOPR\b/.test(n) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(n) && !/^(?:Trident|EdgeHTML)$/.test(k) && "WebKit" || !k && /\bMSIE\b/i.test(n) && (l == "Mac OS" ? "Tasman" : "Trident") || k == "WebKit" && /\bPlayStation\b(?! Vita\b)/i.test(c) && "NetFront") && (k = [f]), c == "IE" && (f = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(n) || 0)[1]) ? (c += " Mobile", l = "Windows Phone " + (/\+$/.test(f) ? f : f + ".x"), v.unshift("desktop mode")) : /\bWPDesktop\b/i.test(n) ? (c = "IE Mobile", l = "Windows Phone 8.x", v.unshift("desktop mode"), a || (a = (/\brv:([\d.]+)/.exec(n) || 0)[1])) : c != "IE" && k == "Trident" && (f = /\brv:([\d.]+)/.exec(n)) && (c && v.push("identifying as " + c + (a ? " " + a : "")), c = "IE", a = f[1]), et) { if (it(g, "global")) if (st && (f = st.lang.System, ct = f.getProperty("os.arch"), l = l || f.getProperty("os.name") + " " + f.getProperty("os.version")), ti) { try { a = g.require("ringo/engine").version.join("."); c = "RingoJS" } catch (li) { (f = g.system) && f.global.system == g.system && (c = "Narwhal", l || (l = f[0].os || null)) } c || (c = "Rhino") } else typeof g.process == "object" && !g.process.browser && (f = g.process) && (typeof f.versions == "object" && (typeof f.versions.electron == "string" ? (v.push("Node " + f.versions.node), c = "Electron", a = f.versions.electron) : typeof f.versions.nw == "string" && (v.push("Chromium " + a, "Node " + f.versions.node), c = "NW.js", a = f.versions.nw)), c || (c = "Node.js", ct = f.arch, l = f.platform, a = /[\d.]+/.exec(f.version), a = a ? a[0] : null)); else t(f = g.runtime) == kt ? (c = "Adobe AIR", l = f.flash.system.Capabilities.os) : t(f = g.phantom) == ni ? (c = "PhantomJS", a = (f = f.version || null) && f.major + "." + f.minor + "." + f.patch) : typeof yt.documentMode == "number" && (f = /\bTrident\/(\d+)/i.exec(n)) ? (a = [a, yt.documentMode], (f = +f[1] + 4) != a[1] && (v.push("IE " + a[1] + " mode"), k && (k[1] = ""), a[1] = f), a = c == "IE" ? String(a[1].toFixed(1)) : a[0]) : typeof yt.documentMode == "number" && /^(?:Chrome|Firefox)\b/.test(c) && (v.push("masking as " + c + " " + a), c = "IE", a = "11.0", k = ["Trident"], l = "Windows"); l = l && o(l) } if (a && (f = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(a) || /(?:alpha|beta)(?: ?\d)?/i.exec(n + ";" + (et && ot.appMinorVersion)) || /\bMinefield\b/i.test(n) && "a") && (lt = /b/i.test(f) ? "beta" : "alpha", a = a.replace(RegExp(f + "\\+?$"), "") + (lt == "beta" ? ri : ii) + (/\d+\+?/.exec(f) || "")), c == "Fennec" || c == "Firefox" && /\b(?:Android|Firefox OS)\b/.test(l)) c = "Firefox Mobile"; else if (c == "Maxthon" && a) a = a.replace(/\.[\d.]+/, ".x"); else if (/\bXbox\b/i.test(p)) p == "Xbox 360" && (l = null), p == "Xbox 360" && /\bIEMobile\b/.test(n) && v.unshift("mobile mode"); else if ((/^(?:Chrome|IE|Opera)$/.test(c) || c && !p && !/Browser|Mobi/.test(c)) && (l == "Windows CE" || /Mobi/i.test(n))) c += " Mobile"; else if (c == "IE" && et) try { g.external === null && v.unshift("platform preview") } catch (li) { v.unshift("embedded") } else(/\bBlackBerry\b/.test(p) || /\bBB10\b/.test(n)) && (f = (RegExp(p.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(n) || 0)[1] || a) ? (f = [f, /BB10/.test(n)], l = (f[1] ? (p = null, rt = "BlackBerry") : "Device Software") + " " + f[0], a = null) : this != s && p != "Wii" && (et && ft || /Opera/.test(c) && /\b(?:MSIE|Firefox)\b/i.test(n) || c == "Firefox" && /\bOS X (?:\d+\.){2,}/.test(l) || c == "IE" && (l && !/^Win/.test(l) && a > 5.5 || /\bWindows XP\b/.test(l) && a > 8 || a == 8 && !/\bTrident\b/.test(n))) && !e.test(f = h.call(s, n.replace(e, "") + ";")) && f.name && (f = "ing as " + f.name + ((f = f.version) ? " " + f : ""), e.test(c) ? (/\bIE\b/.test(f) && l == "Mac OS" && (l = null), f = "identify" + f) : (f = "mask" + f, c = ht ? o(ht.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", /\bIE\b/.test(f) && (l = null), et || (a = null)), k = ["Presto"], v.push(f)); return (f = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(n) || 0)[1]) && (f = [parseFloat(f.replace(/\.(\d)$/, ".0$1")), f], c == "Safari" && f[1].slice(-1) == "+" ? (c = "WebKit Nightly", lt = "alpha", a = f[1].slice(0, -1)) : (a == f[1] || a == (f[2] = (/\bSafari\/([\d.]+\+?)/i.exec(n) || 0)[1])) && (a = null), f[1] = (/\bChrome\/([\d.]+)/i.exec(n) || 0)[1], f[0] == 537.36 && f[2] == 537.36 && parseFloat(f[1]) >= 28 && k == "WebKit" && (k = ["Blink"]), et && (bt || f[1]) ? (k && (k[1] = "like Chrome"), f = f[1] || (f = f[0], f < 530 ? 1 : f < 532 ? 2 : f < 532.05 ? 3 : f < 533 ? 4 : f < 534.03 ? 5 : f < 534.07 ? 6 : f < 534.1 ? 7 : f < 534.13 ? 8 : f < 534.16 ? 9 : f < 534.24 ? 10 : f < 534.3 ? 11 : f < 535.01 ? 12 : f < 535.02 ? "13+" : f < 535.07 ? 15 : f < 535.11 ? 16 : f < 535.19 ? 17 : f < 536.05 ? 18 : f < 536.1 ? 19 : f < 537.01 ? 20 : f < 537.11 ? "21+" : f < 537.13 ? 23 : f < 537.18 ? 24 : f < 537.24 ? 25 : f < 537.36 ? 26 : k != "Blink" ? "27" : "28")) : (k && (k[1] = "like Safari"), f = (f = f[0], f < 400 ? 1 : f < 500 ? 2 : f < 526 ? 3 : f < 533 ? 4 : f < 534 ? "4+" : f < 535 ? 5 : f < 537 ? 6 : f < 538 ? 7 : f < 601 ? 8 : "8")), k && (k[1] += " " + (f += typeof f == "number" ? ".x" : /[.+]/.test(f) ? "" : "+")), c == "Safari" && (!a || parseInt(a) > 45) && (a = f)), c == "Opera" && (f = /\bzbov|zvav$/.exec(l)) ? (c += " ", v.unshift("desktop mode"), f == "zvav" ? (c += "Mini", a = null) : c += "Mobile", l = l.replace(RegExp(" *" + f + "$"), "")) : c == "Safari" && /\bChrome\b/.exec(k && k[1]) && (v.unshift("desktop mode"), c = "Chrome Mobile", a = null, /\bOS X\b/.test(l) ? (rt = "Apple", l = "iOS 4.3+") : l = null), a && a.indexOf(f = /[\d.]+$/.exec(l)) == 0 && n.indexOf("/" + f + "-") > -1 && (l = w(l.replace(f, ""))), k && !/\b(?:Avant|Nook)\b/.test(c) && (/Browser|Lunascape|Maxthon/.test(c) || c != "Safari" && /^iOS/.test(l) && /\bSafari\b/.test(k[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|Web)/.test(c) && k[1]) && (f = k[k.length - 1]) && v.push(f), v.length && (v = ["(" + v.join("; ") + ")"]), rt && p && p.indexOf(rt) < 0 && v.push("on " + rt), p && v.push((/^on /.test(v[v.length - 1]) ? "" : "on ") + p), l && (f = / ([\d.+]+)$/.exec(l), pt = f && l.charAt(l.length - f[0].length - 1) == "/", l = { architecture: 32, family: f && !pt ? l.replace(f[0], "") : l, version: f ? f[1] : null, toString: function() { var n = this.version; return this.family + (n && !pt ? " " + n : "") + (this.architecture == 64 ? " 64-bit" : "") } }), (f = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(ct)) && !/\bi686\b/i.test(ct) ? (l && (l.architecture = 64, l.family = l.family.replace(RegExp(" *" + f), "")), c && (/\bWOW64\b/i.test(n) || et && /\w(?:86|32)$/.test(ot.cpuClass || ot.platform) && !/\bWin64; x64\b/i.test(n)) && v.unshift("32-bit")) : l && /^OS X/.test(l.family) && c == "Chrome" && parseFloat(a) >= 39 && (l.architecture = 64), n || (n = null), tt = {}, tt.description = n, tt.layout = k && k[0], tt.manufacturer = rt, tt.name = c, tt.prerelease = lt, tt.product = p, tt.ua = n, tt.version = c && a, tt.os = l || { architecture: null, family: null, version: null, toString: function() { return "null" } }, tt.parse = h, tt.toString = hi, tt.version && v.unshift(a), tt.name && v.unshift(c), !l || !c || l == String(l).split(" ")[0] && (l == c.split(" ")[0] || p) || v.push(p ? "(" + l + ")" : "on " + l), v.length && (tt.description = v.join(" ")), tt } var c = { "function": !0, object: !0 }, u = c[typeof window] && window || this, b = u, l = c[typeof exports] && exports, a = c[typeof module] && module && !module.nodeType && module, n = l && a && typeof global == "object" && global, f; n && (n.global === n || n.window === n || n.self === n) && (u = n); var k = Math.pow(2, 53) - 1, e = /\bOpera/, d = this, v = Object.prototype, g = v.hasOwnProperty, y = v.toString; f = h(); typeof define == "function" && typeof define.amd == "object" && define.amd ? (u.platform = f, define(function() { return f })) : l && a ? s(f, function(n, t) { l[t] = n }) : u.platform = f }).call(this); var s_iScaleFactor = 1, s_oCanvasLeft, s_oCanvasTop, s_bIsIphone = !1, s_bFocus = !0; if (function(n) { (jQuery.browser = jQuery.browser || {}).mobile = /android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(ad|hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|tablet|treo|up\.(browser|link)|vodafone|wap|webos|windows (ce|phone)|xda|xiino/i.test(n) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(n.substr(0, 4)) }(navigator.userAgent || navigator.vendor || window.opera), $(window).resize(function() { sizeHandler(); s_oGame && s_oGame.showPausePanel(!1); s_oMain.startUpdate(); sizeHandler() }), $(window).blur(function() { isMobile() || (s_oGame && s_oGame.showPausePanel(!0), s_oMain.stopUpdate()) }), $(window).focus(function() { isMobile() || (s_oGame && s_oGame.showPausePanel(!1), s_oMain.startUpdate()) }), window.addEventListener("orientationchange", onOrientationChange), NoClickDelay.prototype = { handleEvent: function(n) { switch (n.type) { case "touchstart": this.onTouchStart(n); break; case "touchmove": this.onTouchMove(n); break; case "touchend": this.onTouchEnd(n) } }, onTouchStart: function(n) { n.preventDefault(); this.moved = !1; this.element.addEventListener("touchmove", this, !1); this.element.addEventListener("touchend", this, !1) }, onTouchMove: function() { this.moved = !0 }, onTouchEnd: function(n) { var t, i; this.element.removeEventListener("touchmove", this, !1); this.element.removeEventListener("touchend", this, !1); this.moved || (t = document.elementFromPoint(n.changedTouches[0].clientX, n.changedTouches[0].clientY), t.nodeType == 3 && (t = t.parentNode), i = document.createEvent("MouseEvents"), i.initEvent("click", !0, !0), t.dispatchEvent(i)) } }, function() { function n(n) { var i = "visible", r = "hidden", u = { focus: i, focusin: i, pageshow: i, blur: r, focusout: r, pagehide: r }; n = n || window.event; n.type in u ? document.body.className = u[n.type] : (document.body.className = this[t] ? "hidden" : "visible", document.body.className === "hidden" ? (s_oMain.stopUpdate(), s_bFocus = !1) : (s_oMain.startUpdate(), s_bFocus = !0)) } var t = "hidden"; t in document ? document.addEventListener("visibilitychange", n) : (t = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", n) : (t = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", n) : (t = "msHidden") in document ? document.addEventListener("msvisibilitychange", n) : "onfocusin" in document ? document.onfocusin = document.onfocusout = n : window.onpageshow = window.onpagehide = window.onfocus = window.onblur = n }(), screenfull.isEnabled) screenfull.on("change", function() { s_bFullscreen = screenfull.isFullscreen; s_oInterface !== null && s_oInterface.resetFullscreenBut(); s_oMenu !== null && s_oMenu.resetFullscreenBut() }); var CANVAS_WIDTH = 1080, CANVAS_HEIGHT = 1920, EDGEBOARD_X = 25, EDGEBOARD_Y = 200, CELL_SIZE = 106, FPS = 30, FPS_TIME = 1e3 / FPS, DISABLE_SOUND_MOBILE = !1, GAME_NAME = "ultimate_sudoku", PRIMARY_FONT = "Arial", SECONDARY_FONT = "blackplotan", PRIMARY_FONT_COLOUR = "#008df0", TIME_LOOP_WAIT = 2e3, STATE_LOADING = 0, STATE_MENU = 1, STATE_HELP = 1, STATE_GAME = 3, EASY_MODE = 0, MEDIUM_MODE = 1, HARD_MODE = 2, ON_MOUSE_DOWN = 0, ON_MOUSE_UP = 1, ON_MOUSE_OVER = 2, ON_MOUSE_OUT = 3, ON_DRAG_START = 4, ON_DRAG_END = 5, MAX_GIVENS_EASY, MAX_GIVENS_MEDIUM, MAX_GIVENS_HARD, RANGE_GIVENS = 0, LOWER_BOUND_EASY = 4, LOWER_BOUND_MEDIUM = 3, LOWER_BOUND_HARD = 2, TIME_BONUS_LIMIT = [], ENABLE_FULLSCREEN, ENABLE_CHECK_ORIENTATION, TIME_SAVE_DATA = 6e4; var s_bMobile, s_iDifficultyMode, s_bAudioActive = !0, s_iCntTime = 0, s_iTimeElaps = 0, s_iPrevTime = 0, s_iCntFps = 0, s_iCurFps = 0, s_oDrawLayer, s_oStage, s_oMain, s_oSpriteLibrary, s_oCanvas, s_bFullscreen = !1, s_aSounds, s_aSoundsInfo; s_oMenu = null; s_oModeMenu = null; s_oInterface = null; CTLText.prototype = { constructor: CTLText, __autofit: function() { if (this._bFitText) { for (var n = this._iFontSize; this._oText.getBounds().height > this._iHeight - this._iPaddingV * 2 || this._oText.getBounds().width > this._iWidth - this._iPaddingH * 2;) if (n--, this._oText.font = n + "px " + this._szFont, this._oText.lineHeight = Math.round(n * this._fLineHeightFactor), this.__updateY(), this.__verticalAlign(), n < 8) break; this._iFontSize = n } }, __verticalAlign: function() { if (this._bVerticalAlign) { var n = this._oText.getBounds().height; this._oText.y -= (n - this._iHeight) / 2 + this._iPaddingV } }, __updateY: function() { this._oText.y = this._y + this._iPaddingV; switch (this._oText.textBaseline) { case "middle": this._oText.y += this._oText.lineHeight / 2 + (this._iFontSize * this._fLineHeightFactor - this._iFontSize) } }, __createText: function(n) { this._bDebug && (this._oDebugShape = new createjs.Shape, this._oDebugShape.graphics.beginFill("rgba(255,0,0,0.5)").drawRect(this._x, this._y, this._iWidth, this._iHeight), this._oContainer.addChild(this._oDebugShape)); this._oText = new createjs.Text(n, this._iFontSize + "px " + this._szFont, this._szColor); this._oText.textBaseline = "middle"; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this._oText.textAlign = this._szAlign; this._oText.lineWidth = this._bMultiline ? this._iWidth - this._iPaddingH * 2 : null; switch (this._szAlign) { case "center": this._oText.x = this._x + this._iWidth / 2; break; case "left": this._oText.x = this._x + this._iPaddingH; break; case "right": this._oText.x = this._x + this._iWidth - this._iPaddingH } this._oContainer.addChild(this._oText); this.refreshText(n) }, setVerticalAlign: function(n) { this._bVerticalAlign = n }, setOutline: function(n) { this._oText !== null && (this._oText.outline = n) }, setShadow: function(n, t, i, r) { this._oText !== null && (this._oText.shadow = new createjs.Shadow(n, t, i, r)) }, setColor: function(n) { this._oText.color = n }, setAlpha: function(n) { this._oText.alpha = n }, removeTweens: function() { createjs.Tween.removeTweens(this._oText) }, getText: function() { return this._oText }, getY: function() { return this._y }, getFontSize: function() { return this._iFontSize }, refreshText: function(n) { n === "" && (n = " "); this._oText === null && this.__createText(n); this._oText.text = n; this._oText.font = this._iFontSize + "px " + this._szFont; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this.__autofit(); this.__updateY(); this.__verticalAlign() } }; var LOCALSTORAGE_SOLUTION = "solution", LOCALSTORAGE_MASK = "gridmask", LOCALSTORAGE_GRID_STATE = "gridstate", LOCALSTORAGE_NOTES_WRITTEN = "noteswritten", LOCALSTORAGE_GAME_PARAM = "gameparam", s_aSolution = null, s_aGridMask = null, s_aGridState = null, s_aNotesWritten = null, s_oGameParam = null; const getClosestTop = () => { let n = window, t = !1; try { while (n.parent.document !== n.document) if (n.parent.document) n = n.parent; else { t = !0; break } } catch (i) { t = !0 } return { topFrame: n, err: t } }, getBestPageUrl = ({ err: n, topFrame: t }) => { let i = ""; if (n) try { try { i = window.top.location.href } catch (r) { let n = window.location.ancestorOrigins; i = n[n.length - 1] } } catch (r) { i = t.document.referrer } else i = t.location.href; return i }, TOPFRAMEOBJ = getClosestTop(), PAGE_URL = getBestPageUrl(TOPFRAMEOBJ)
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка