Skip to content

Instantly share code, notes, and snippets.

View skawnkk's full-sized avatar
💜

junamee skawnkk

💜
View GitHub Profile
@skawnkk
skawnkk / canvas.html
Last active February 7, 2021 16:14
마지막CS (❁´◡`❁)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
<style>
canvas {
width: 600px;
@skawnkk
skawnkk / http.js
Last active February 3, 2021 03:32
http
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
const chalk = require('chalk');
const title = chalk.yellowBright
const dns = require('dns');
const dnsPromises = dns.promises;
const net = require('net');
@skawnkk
skawnkk / cafe.js
Last active January 29, 2021 13:26
CAFE PLAY
//동기, 비동기 기능 더 추가해서....다시 해보긔
const EventEmitter = require("events");
let chalk = require('chalk');
let guide = chalk.blue;
let guide1 = chalk.bold.yellow;
let guide2 = chalk.inverse.blue;
class Cashier extends EventEmitter {
constructor() {
super();
function diagonalDifference(arr) {
let line1 = 0;
let line2 = 0;
for (let i = 0; i < arr.length; i++) {
line1 += arr[i][i];
line2 += arr[i][arr.length - 1 - i];
}
let sum = Math.abs(line1 - line2);
return sum;
}
@skawnkk
skawnkk / doll.js
Last active January 20, 2021 09:25
WEEK3 알고리즘
//크레인 인형뽑기
function solution(board, moves) {
var answer = 0;
let basket = [0]; //처음에 비교할 기본값을 미리 넣어준다.
while (moves.length > 0) {
let move = moves.shift();
for (let line = 0; line < board.length; line++) {
if (board[line][move - 1] !== 0) {
@skawnkk
skawnkk / fp.js
Last active January 19, 2021 08:25
Funtional Programming
const {
log
} = console;
const pipe = (...funcs) => v => {
return funcs.reduce((res, func) => {
return func(res);
}, v);
}
@skawnkk
skawnkk / area.js
Last active January 16, 2021 15:02
OOP_SHAPE
//#CLASS, #OBJECT, #Set(), #super #extends
let {
log
} = console;
//*도형 생성자$프로토타입
//직선길이
class Straight {
@skawnkk
skawnkk / deleteDuplicates.js
Last active January 16, 2021 15:03
week2알고리즘
function ListNode(val, next) {
this.val = (val === undefined ? 0 : val)
this.next = (next === undefined ? null : next)
}
var deleteDuplicates = function (head) {
let curr = head;
//head and next exist
@skawnkk
skawnkk / linkedlist.js
Last active January 30, 2021 04:22
영상편집기 _ single_linked_list
/
class Node {
constructor(data, next = undefined) {
this.data = data;
this.next = next;
}
}
class LinkedList {
@skawnkk
skawnkk / 1000.js
Last active January 16, 2021 15:05
week1_알고리즘(백준)
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
rl.on("line", function (line) {