版本比较
[工程]洛谷插件:钾洛谷
正文
增加 17 行删除 17 行
89 行未改动90919293949495969798999910010110110210310410573 行未改动179180181182183184183184185186187188189190191191192193193194195196197198199200201201202203204205101 行未改动全部展开307308309310311311312313314315105 行未改动全部展开42142242342442542542642742842949 行未改动47948048148248348348448548648736 行未改动52452552652752852852953053153275 行未改动60860961061161261261361461561627 行未改动64464564664764864864965065165229 行未改动68268368468568668668768868868969069169249 行未改动74274374474574674674774874975028 行未改动89 行未改动//==/UserScript==setTimeout(function(){ 'use strict'; let div=null; let interval=setInterval((function(){ let interval=setInterval((function(){ let color_AC=GM_getValue("color1","#52C41A"); let color_WA=GM_getValue("color2","#E74C3C"); let color_CE=GM_getValue("color3","#FADB14"); let bkcolor=GM_getValue("color4","#EEEEEE"); let divs=document.querySelectorAll('.problems'); let divs=document.querySelectorAll("#app > div.main-container.lside-nav > main > div > div.sidebar-container.reverse > div.main > div:nth-child(3) > div"); divs.forEach(d=>{ if(d.parentElement.children[0].children[0]!=null&&d.parentElement.children[0].children[0].textContent.includes("NOI/NOI+/CTSC"))div=d; if(d.children[0]!=null&&d.children[0].children[0]!=null&&d.children[0].children[0].textContent.includes("NOI/NOI+/CTS"))div=d.children[1]; }); if(div==null){ return; }73 行未改动 clearInterval(interval); function draw(x,y,c1,c2){ x=Math.floor(x); y=Math.floor(y); div.children[(x-1)*12+y-1].children[0].style.color=c1; div.children[(x-1)*12+y-1].children[0].style.backgroundColor=c2; div.children[(x-1)*13+y-1].children[0].style.color=c1; div.children[(x-1)*13+y-1].children[0].style.backgroundColor=c2; } function clear(x,y){ draw(x,y,"#3498db","#fff"); } div.innerHTML=""; let i=1; for(;i<=360;i++){ for(;i<=390;i++){ let t=Math.floor(Math.random()*len); div.insertAdjacentHTML('beforeend',`<span data-v-45a12318 class="problem-id"><a data-v-12b24cc3 data-v-45a12318 href="/problem/${temp[t][0]}"colorscheme="default"class="color-default"title="${temp[t][1]}"data-v-f9624136="">${temp[t][0]}</a></span>`); div.insertAdjacentHTML('beforeend',`<span data-v-2e684a78 class="problem-id"><a data-v-12b24cc3 data-v-45a12318 href="/problem/${temp[t][0]}"colorscheme="default"class="color-default"title="${temp[t][1]}"data-v-f9624136="">${temp[t][0]}</a></span>`); } let posx=1,posy=1; draw(posx,posy,"#fff","#000"); let ingame=0; function game1(Flag){ ingame=1; const ROWS=30; const COLS=12; const COLS=13; const GAME_SPEED=150; let snake=[{x:5,y:5}]; let direction={x:0,y:1}; let food={x:10,y:5};101 行未改动全部展开 } function game2(){ ingame=1; const ROWS=30; const COLS=12; const COLS=13; const GAME_SPEED=500; const SHAPES=[ [[1,1,1,1]], [[1,1],[1,1]],105 行未改动全部展开 function clearLines() { let linesCleared = 0; for (let row = ROWS - 1; row >= 0; row--) { if (board[row].every(cell => cell === 1)) { board.splice(row, 1); board.splice(row, 1); linesCleared++; for (let col = 0; col < COLS; col++) { clear(row + 1, col + 1); }49 行未改动 initGame(); } function game3(){ const ROWS=30; const COLS=12; const COLS=13; const GAME_SPEED=100; let playerX=ROWS; let playerY=COLS; let bullets=[];36 行未改动 function running(){ spawnEnemy(); setTimeout(running,1000-time); } running(); running(); function moveBullets(){ for(let i=bullets.length-1;i>=0;i--){ bullets[i].x--; if(bullets[i].x<0){75 行未改动 initGame(); } function game4() { const ROWS = 30; const COLS = 12; const COLS = 13; const GAME_SPEED = 100; let birdY = 5; let gravity = 0.4; let velocity = 0;27 行未改动 moveBird(); moveObstacles(); spawnObstacle(); checkCollisions(); drawGame(); drawGame(); } function moveBird() { velocity += gravity; birdY += velocity;29 行未改动 for (let i = obstacles.length - 1; i >= 0; i--) { const obstacle = obstacles[i]; if ( obstacle.x === 0 && (birdY >= obstacle.y && birdY < obstacle.y + obstacle.height) (birdY >= obstacle.y && birdY < obstacle.y + obstacle.height) ) { gameOver = true; gameOver = true; break; } } }49 行未改动 break; case 39: e.preventDefault(); clear(posx,posy); if(posy<12)posy++; if(posy<13)posy++; draw(posx,posy,"#fff","#000"); break; case 40: e.preventDefault();28 行未改动