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
let fs = require('fs'); | |
try { | |
let code = fs.readFileSync('in.txt', 'utf8'); | |
// console.log(code); | |
let codelines = code.split("\n").map(codeline => { | |
return "\"" + codeline.replace("\r","") + "\"" | |
}).join(",\n"); |
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
{ | |
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
"Print to console": { | |
"prefix": "log", | |
"body": [ | |
"console.log('$1');", |
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
let input = [[3,1,1],[2,5,1],[1,5,5],[2,1,1]] | |
let y = 4; | |
let x = 3; | |
function init3d(x, y) { | |
let dp = new Array(y); | |
for (let i = 0; i < y; i++ ) { | |
dp[i] = new Array(x + 2); | |
for (let j = 0; j < x + 2; j++ ) { | |
dp[i][j] = new Array(x + 2); |
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
import Board | |
main = do | |
let board = initboard | |
putStr $ showBoard board |
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 Board ( | |
Cell(..), | |
Row, | |
Board, | |
initboard, | |
showBoard | |
) where | |
import Data.List |
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
{-# LANGUAGE RecordWildCards #-} | |
module Block ( | |
Shape(..), | |
Block(..), | |
genblock, | |
block2coords | |
) where | |
data Shape = I | L | J | O | S | Z | T deriving(Eq) | |
data Block = Block {shape :: Shape, rotate :: Int, coords :: (Int, Int)} |
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
import System.Environment | |
import System.Directory ( removeFile, renameFile ) | |
import System.IO | |
( hClose, | |
openFile, | |
hGetContents, | |
hPutStr, | |
openTempFile, | |
IOMode(ReadMode) ) | |
import Data.List ( delete ) |
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
{-# LANGUAGE RecordWildCards #-} | |
import System.Environment | |
import Data.List | |
data Player = PlayerX | PlayerO | |
data State = Done | Progress | |
data Cell = X | O | Empty | |
type Row = [Cell] | |
type Board = [Row] |
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 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 fakeAjax (url, cb) { | |
var fake_responses = { | |
file1: 'The first text', | |
file2: 'The middle text', | |
file3: 'The last text' | |
} | |
var randomDelay = (Math.round(Math.random() * 1e4) % 8000) + 1000 | |
console.log('Requesting: ' + url) |
NewerOlder