This file contains hidden or 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
#simple baduk board on python3.8x | |
#achievement so far | |
#-draw board, lines, star points (GUI by tkinter) | |
#-play game manually and save game record in sgf format | |
# | |
#todo lists | |
#-realize 'clear board' and 'exit' | |
#-remove 'captured stone' from the board automtically | |
app_name='MyBaduk' |
This file contains hidden or 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
def solution(num): | |
if num == 1 : | |
return 0 | |
for i in range(500) : | |
num = num / 2 if num % 2 == 0 else num*3 + 1 | |
if num == 1 : | |
return i+1 # i는 0부터 시작하니까 |
This file contains hidden or 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
Collatz <- function(n) { # 함수정의 | |
counter <- 0 # 반복횟수 계산을 위한 Counter 정의 | |
while(n != 1){ # n이 1이 아닌 경우 계속 반복 | |
if (n %% 2 == 0) { # n이 짝수일 경우 처리 정의 | |
n <- n/2 | |
print(n) | |
counter <- counter + 1 | |
} else { # n이 홀수일 경우 처리 정의 | |
n <- 3*n + 1 | |
print(n) |
This file contains hidden or 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
library(utils) | |
library(dplyr) | |
library(ggplot2) | |
data <- read.csv("https://opendata.ecdc.europa.eu/covid19/casedistribution/csv", na.strings = "", fileEncoding = "UTF-8-BOM") | |
COVID_KR = data %>% filter(geoId =="KR") #한국 | |
COVID_JP = data %>% filter(geoId =="JP") #일본 | |
COVID_CN = data %>% filter(geoId =="CN") #중국 | |
COVID_US = data %>% filter(geoId =="US") #미국 |
This file contains hidden or 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
library(sp) | |
library(RColorBrewer) | |
gadm <- readRDS(file = "gadm36_KOR_1_sp.rds") | |
population <- read.csv("pop_S.csv",header=T) | |
population_sort <- population[order(population$Code),] | |
interval <- c(50,40,30,20,10,0) | |
population_cut <- cut(population_sort$Y2040,breaks=interval) | |
gadm$population <- as.factor(population_cut) |