This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <vector> | |
using namespace std; | |
typedef long long lld; | |
// 중복되는 숫자가 있는가 | |
bool duplCheck(lld n){ | |
bool fq[10]={}; | |
while(n>0){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (req, res, next) { | |
var user_name = req.body.user_name; | |
// avoid infinite loop | |
if (user_name === 'slackbot') { | |
return res.status(200).end(); | |
} | |
var botPayload = null; | |
var notFound = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long lld; | |
int main(){ | |
lld a[100002], T; | |
char sig[100002]; | |
int i, j, n, q; | |
scanf("%d %lld %d", &n, &T, &q); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
string sum(int& bit, string &s, string &p){ | |
int slen = s.length(), plen = p.length(); | |
int i, j, cr = 0; | |
string r = ""; | |
for(i=j=0; i<slen || j<plen; ++i, ++j){ | |
if(i<slen) cr += s[i]-'0'; | |
if(j<plen) cr += p[j]-'0'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function intersects(circle, rect){ | |
var circleDistance = {}; | |
circleDistance.x = Math.abs(circle.x - rect.left); | |
circleDistance.y = Math.abs(circle.y - rect.top); | |
if (circleDistance.x > (rect.width/2 + circle.rad)) { return false; } | |
if (circleDistance.y > (rect.height/2 + circle.rad)) { return false; } | |
if (circleDistance.x <= (rect.width/2)) { return true; } | |
if (circleDistance.y <= (rect.height/2)) { return true; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="pingping"></canvas> | |
<script type="text/javascript" src="..." /> | |
<script type="text/javascript"> | |
var game = new Game('pingpong'); | |
game.start(); | |
game.pushBall(1); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.state = function(stageName){ | |
this.init(stageName); | |
if(stageName == 'PLAY_SOLO' || stageName == 'PLAY_DUO'){ | |
this.balls = []; | |
// ... | |
} else { | |
// ... | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.keypress_table = {}; | |
this.fireKeydown = function(event){ | |
var _this = game; | |
_this.keypress_table[event.code.toString()] = true; | |
if(_this.stage == 'MAIN_MENU'){ | |
switch(event.code){ | |
case 'Digit1': | |
_this.state('SELECT_COMPUTER'); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Ball(boundWidth, boundHeight){ | |
this.x = Math.random()*(boundWidth/5) + (2*boundWidth/5); | |
this.y = Math.random()*(boundHeight/2) + (boundHeight/4); | |
this.dx = Math.random() > 0.5 ? -1 : 1; | |
this.dy = Math.random() > 0.5 ? -1 : 1; | |
this.rad = 10; this.color = "#fff"; this.speed = 2; | |
this.set = function(newX, newY){ this.x = newX; this.y = newY; }; | |
this.setD = function(_dx, _dy){ this.dx = _dx; this.dy = _dy; }; | |
this.randomDirection = function(){ ... }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CmazeGeneratorDlg::drawCell(int row, int col, char wallBit, int cellSize) | |
{ | |
CPen *oldPen, pen; | |
pen.CreatePen(PS_SOLID, 1, RGB(0, 0, 0)); | |
oldPen = mPicCtrl->SelectObject(&pen); | |
// 벽의 위치에 대해 4비트 (1111b) 로 나타낸다. | |
// 1111 은 각각 상/하/좌/우를 의미함. | |
// 위쪽 벽 |
OlderNewer