Skip to content

Instantly share code, notes, and snippets.

View hannut91's full-sized avatar

Yunseok hannut91

View GitHub Profile
@hannut91
hannut91 / IdGenerator.kt
Created August 23, 2023 14:52
디자인 패턴의 아름다움 스터디 코드
import java.net.InetAddress
import java.util.Random
fun random(): String {
val randomChars = CharArray(8)
var count = 0
val random = Random()
while (count < 8) {
val randomAscii = random.nextInt(122)
@hannut91
hannut91 / Calc.kt
Last active June 3, 2022 00:40
코드스피츠 90강 코틀린 과제 1
package org.example.assignment1
val trimRegex = """[^().\d-+*/]""".toRegex()
val parenthesesRegex = """\((-?[.\d]+)([/*+-])(-?[.\d]+)\)""".toRegex()
val expressionRegex = """(-?[.\d]+)([/*+-])(-?[.\d]+)"""
.toRegex()
val multiplyAndDivideRegex = """([.\d]+)([*/])([.\d]+)"""
.toRegex()
fun trim(v: String): String {