Skip to content

Instantly share code, notes, and snippets.

View sohnryang's full-sized avatar
🍟
Potato inside

Ryang Sohn sohnryang

🍟
Potato inside
View GitHub Profile
@sohnryang
sohnryang / data.json
Created April 7, 2018 10:49
test data for hashcode question
[{"이름": "레오넬", "소속": "바르셀로나", "포지션": "공격"}, {"이름": "호날두", "소속": "레알마드리드", "포지션": "공격"}]

미로 생성기

설명

미로를 자동으로 생성하는 turtlecraft([codingmath.xyz][0]) JS 코드이다.

원리

우선 미로를 만들어내는데 사용할 수 있는 알고리즘이 많다. (구글에 maze generation algorithm 이라고 치면 많은 알고리즘을 볼 수 있다.) 나는 여기서 간단한 DFS(깊이 우선 탐색) 알고리즘을 사용하였다.

무한상상 파이썬 강의 - 1차시

이번 강의에서는 실제로 파이썬으로 코딩을 하기 위해 파이썬을 설치하는 법을 배울 거구요, 간단한 Hello, world! 프로그램을 만들 것입니다.

파이썬 설치하기

파이썬은 macOS, Linux, Windows 등의 여러 가지 OS와 CPU 타입(ARM용도 있더라구요)를 지원합니다. 이번 강의에서는 사용자수가 가장 많기도 하고, 학교 컴퓨터의 OS이기도 한 Windows를 기준으로 설명하겠습니다.

USB에 설치?

무한상상 파이썬 강의 - 0차시

![파이썬 로고][0]

무엇을 배우나요?

이 강의에서는 파이썬을 통해 코딩을 하는 법을 배웁니다. 이 강의의 마지막 부분에서는 간단한 게임을 만들 것이구요, 여러분은 파이썬을 통해 마음만 먹으면 데이터 분석, 해킹, 머신 러닝 등을 할 수 있게 될 겁니다.

파이썬은 무엇인가요?

@sohnryang
sohnryang / .minttyrc
Created June 21, 2017 03:47
my mintty config file
ForegroundColour=238,232,213
BackgroundColour=0,53,65
CursorColour=220,50,47
Black=0,53,65
BoldBlack=0,40,52
Red=203,76,22
BoldRed=220,50,46
Green=133,153,1
BoldGreen=88,110,117
@sohnryang
sohnryang / level4.rb
Created February 26, 2017 03:40
Rubywarrior level 4
class Player
def play_turn(warrior)
if warrior.feel.empty?
if warrior.health < 20 && @health <= warrior.health
warrior.rest!
else
warrior.walk!
end
else
warrior.attack!
@sohnryang
sohnryang / level3.rb
Created February 26, 2017 03:21
Rubywarrior level 3
class Player
def play_turn(warrior)
if warrior.feel.empty?
if warrior.health < 20
warrior.rest!
else
warrior.walk!
end
else
warrior.attack!
@sohnryang
sohnryang / level2.rb
Created February 26, 2017 03:18
Rubywarrior level 2
class Player
def play_turn(warrior)
if warrior.feel.empty?
warrior.walk!
else
warrior.attack!
end
end
end
@sohnryang
sohnryang / level1.rb
Created February 26, 2017 03:15
Rubywarrior level 1
class Player
def play_turn(warrior)
warrior.walk!
end
end
@sohnryang
sohnryang / product.scala
Last active January 31, 2017 22:37
scala for the impatient - writing function product()
def product(s: String): Long = {
s.foldLeft(1L)(_ * _.toInt)
}