Skip to content

Commit

Permalink
Add Nickname Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Diger committed Dec 9, 2023
1 parent 085a110 commit 21564e4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.whatever.raisedragon.domain.user

import com.whatever.raisedragon.domain.BaseEntity
import jakarta.persistence.*
import kotlin.random.Random

@Table(name = "user")
@Entity
Expand Down Expand Up @@ -32,8 +31,8 @@ data class Nickname(
) {
companion object {
fun generateRandomNickname(): Nickname {
val randomAdjective = RandomWordsNickname.adjectives[Random.nextInt(RandomWordsNickname.adjectives.size)]
val randomNoun = RandomWordsNickname.nouns[Random.nextInt(RandomWordsNickname.nouns.size)]
val randomAdjective = RandomWordsNickname.adjectives.random()
val randomNoun = RandomWordsNickname.nouns.random()
return Nickname("$randomAdjective $randomNoun")
}
}
Expand Down

0 comments on commit 21564e4

Please sign in to comment.